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

Don’t replace existing labels #4105

Merged
merged 1 commit into from May 5, 2020

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented May 5, 2020

When a Kubernetes resource has pre-existing labels, we must not change their values. Otherwise, we can break a label selector such as the one used in Deployments.

Fixes #3718

Signed-off-by: David Gageot david@gageot.net

@codecov
Copy link

codecov bot commented May 5, 2020

Codecov Report

Merging #4105 into master will increase coverage by 0.26%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
pkg/skaffold/deploy/kubectl/labels.go 93.10% <100.00%> (+0.24%) ⬆️
pkg/skaffold/deploy/labels.go 54.87% <100.00%> (+39.02%) ⬆️
...affold/kubernetes/portforward/kubectl_forwarder.go 65.85% <0.00%> (-2.44%) ⬇️

pkg/skaffold/deploy/labels_test.go Outdated Show resolved Hide resolved
pkg/skaffold/deploy/kubectl/labels_test.go Outdated Show resolved Hide resolved
pkg/skaffold/deploy/labels_test.go Show resolved Hide resolved
Copy link
Contributor

@nkubala nkubala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

pkg/skaffold/deploy/labels_test.go Show resolved Hide resolved
Fixes GoogleContainerTools#3718

Signed-off-by: David Gageot <david@gageot.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

labels break some deployments: selector does not match template labels
4 participants