Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interference between status check of multiple Skaffold runs #2496

Closed
corneliusweig opened this issue Jul 18, 2019 · 0 comments · Fixed by #2609
Closed

Interference between status check of multiple Skaffold runs #2496

corneliusweig opened this issue Jul 18, 2019 · 0 comments · Fixed by #2609
Labels
kind/bug Something isn't working priority/p1 High impact feature/bug.

Comments

@corneliusweig
Copy link
Contributor

corneliusweig commented Jul 18, 2019

Skaffold now checks the deployment status. However, the checks for multiple runs can interfere.

For example, with this patch on master:

diff --git a/examples/react-reload/k8s/deployment.yaml b/examples/react-reload/k8s/deployment.yaml
index e4d64794..edc57ba2 100644
--- a/examples/react-reload/k8s/deployment.yaml
+++ b/examples/react-reload/k8s/deployment.yaml
@@ -12,7 +12,7 @@ spec:
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: node
+  name: node-react
 spec:
   selector:
     matchLabels:
diff --git a/pkg/skaffold/deploy/status_check.go b/pkg/skaffold/deploy/status_check.go
index 96b101e8..64317e89 100644
--- a/pkg/skaffold/deploy/status_check.go
+++ b/pkg/skaffold/deploy/status_check.go
@@ -96,6 +96,7 @@ func getDeployments(client kubernetes.Interface, ns string, l *DefaultLabeller)
 		} else {
 			deadline = *d.Spec.ProgressDeadlineSeconds
 		}
+		logrus.Debugf("Register deployment %s for status check", d.Name)
 		depMap[d.Name] = deadline
 	}
 

Skaffold prints the watched deployments.

When doing

cd examples/nodejs
skaffold run
cd ../../examples/react-reload
skaffold dev -v debug 2>&1 | grep Register

It shows that the second run also watches the first deployment:

time="2019-07-18T13:26:16+02:00" level=debug msg="Register deployment node for status check"
time="2019-07-18T13:26:16+02:00" level=debug msg="Register deployment node-react for status check"

Deleting the first deployment with

cd examples/nodejs
skaffold delete

will eventually (after the timeout) lead to a failure of the skaffold dev run.


A possible way out would be to add a new label with a UUID that is generated in every skaffold run. In other words deployments should be selected via

deps, err := client.AppsV1().Deployments(ns).List(metav1.ListOptions{
		LabelSelector: "skaffold-run-uuid=xyz-xyz",
	})

in pkg/skaffold/deploy/status_check.go:80,

cc @tejal29

@balopat balopat added kind/bug Something isn't working priority/p0 Highest priority. We are actively looking at delivering it. labels Jul 18, 2019
@balopat balopat added priority/p1 High impact feature/bug. and removed priority/p0 Highest priority. We are actively looking at delivering it. labels Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working priority/p1 High impact feature/bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants