Skip to content

Commit

Permalink
fix(executor): Do not make unneeded get pod when no sidecars (#5161)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <[email protected]>
  • Loading branch information
alexec committed Feb 22, 2021
1 parent bec80c8 commit 91528cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ dist/kustomize:
dist/kustomize version

# generates several installation files
manifests/install.yaml: $(CRDS) dist/kustomize
manifests/install.yaml: $(MANIFESTS) dist/kustomize
./hack/update-image-tags.sh manifests/base $(VERSION)
dist/kustomize build --load_restrictor=none manifests/cluster-install | ./hack/auto-gen-msg.sh > manifests/install.yaml
dist/kustomize build --load_restrictor=none manifests/namespace-install | ./hack/auto-gen-msg.sh > manifests/namespace-install.yaml
Expand Down Expand Up @@ -386,10 +386,12 @@ install: $(MANIFESTS) $(E2E_MANIFESTS) dist/kustomize
kubectl config set-context --current --namespace=$(KUBE_NAMESPACE)
@echo "installing PROFILE=$(PROFILE) VERSION=$(VERSION), E2E_EXECUTOR=$(E2E_EXECUTOR)"
dist/kustomize build --load_restrictor=none test/e2e/manifests/$(PROFILE) | sed 's/argoproj\//$(IMAGE_NAMESPACE)\//' | sed 's/:latest/:$(VERSION)/' | sed 's/containerRuntimeExecutor: docker/containerRuntimeExecutor: $(E2E_EXECUTOR)/' | kubectl -n $(KUBE_NAMESPACE) apply --prune -l app.kubernetes.io/part-of=argo -f -
ifeq ($(PROFILE),stress)
kubectl -n $(KUBE_NAMESPACE) apply -f test/stress/massive-workflow.yaml
kubectl -n $(KUBE_NAMESPACE) rollout restart deploy workflow-controller
kubectl -n $(KUBE_NAMESPACE) rollout restart deploy argo-server
kubectl -n $(KUBE_NAMESPACE) rollout restart deploy minio
endif
ifeq ($(RUN_MODE),kubernetes)
# scale to 2 replicas so we touch upon leader election
kubectl -n $(KUBE_NAMESPACE) scale deploy/workflow-controller --replicas 2
Expand Down
2 changes: 1 addition & 1 deletion hack/test-examples.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eu -o pipefail

kubectl delete wf -l workflows.argoproj.io/test
./dist/argo delete -l workflows.argoproj.io/test

grep -lR 'workflows.argoproj.io/test' examples/* | while read f ; do
./dist/argo submit --watch --verify $f
Expand Down
3 changes: 3 additions & 0 deletions workflow/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,9 @@ func (we *WorkflowExecutor) monitorDeadline(ctx context.Context, containerNames
// KillSidecars kills any sidecars to the main container
func (we *WorkflowExecutor) KillSidecars(ctx context.Context) error {
sidecarNames := we.Template.GetSidecarNames()
if len(sidecarNames) == 0 {
return nil // exit early as GetTerminationGracePeriodDuration performs `get pod`
}
log.Infof("Killing sidecars %s", strings.Join(sidecarNames, ","))
terminationGracePeriodDuration, _ := we.GetTerminationGracePeriodDuration(ctx)
return we.RuntimeExecutor.Kill(ctx, sidecarNames, terminationGracePeriodDuration)
Expand Down

0 comments on commit 91528cc

Please sign in to comment.