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

Use annotations instead of labels on created k8s resources #4466

Closed
wants to merge 2 commits into from

Conversation

nkubala
Copy link
Contributor

@nkubala nkubala commented Jul 13, 2020

fixes #3133

this will still leave two labels on created resources - skaffold.dev/run-id, and app.kubernetes.io/managed-by=skaffold. this does remove the version from the managed-by label though, so changing skaffold version will not cause issues.

@nkubala nkubala requested a review from a team as a code owner July 13, 2020 23:31
@nkubala nkubala requested a review from briandealwis July 13, 2020 23:31
@codecov
Copy link

codecov bot commented Jul 13, 2020

Codecov Report

Merging #4466 into master will decrease coverage by 0.01%.
The diff coverage is 62.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4466      +/-   ##
==========================================
- Coverage   72.26%   72.25%   -0.02%     
==========================================
  Files         331      333       +2     
  Lines       12863    12988     +125     
==========================================
+ Hits         9296     9384      +88     
- Misses       2975     3012      +37     
  Partials      592      592              
Impacted Files Coverage Δ
pkg/skaffold/build/build.go 0.00% <ø> (ø)
pkg/skaffold/build/gcb/types.go 27.77% <0.00%> (-3.48%) ⬇️
pkg/skaffold/build/local/types.go 65.78% <0.00%> (-3.66%) ⬇️
pkg/skaffold/build/tag/custom.go 30.00% <0.00%> (-7.50%) ⬇️
pkg/skaffold/build/tag/date_time.go 42.85% <0.00%> (-4.52%) ⬇️
pkg/skaffold/build/tag/env_template.go 80.76% <0.00%> (-6.74%) ⬇️
pkg/skaffold/build/tag/git_commit.go 83.33% <0.00%> (-2.61%) ⬇️
pkg/skaffold/build/tag/sha256.go 58.33% <0.00%> (-11.67%) ⬇️
pkg/skaffold/deploy/labeller.go 45.45% <7.69%> (-4.55%) ⬇️
pkg/skaffold/deploy/helm.go 77.83% <50.00%> (-0.30%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6af3198...82d5f33. Read the comment docs.

@@ -68,7 +68,7 @@ spec:
expectedOut: `apiVersion: v1
kind: Pod
metadata:
labels:
annotations:
Copy link
Contributor

@tejal29 tejal29 Jul 14, 2020

Choose a reason for hiding this comment

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

shd we still have these annotations? We are not using any of the annotations for driving any metrics.
With the new MetadataEvent we are capturing all these metrics via IDEs

Copy link
Contributor

@tejal29 tejal29 Jul 15, 2020

Choose a reason for hiding this comment

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

I remember these were initially added to get some metrics on how folks are using skaffold. I might be wrong.
I don't think any of our users are using these labels to query objects. Removing these won't be a backward compatible change.
We also have --label field for users to optionally add user labels.
WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you meant removing them won't be a backwards incompatible change? we're already removing them as labels which would theoretically break people who are using those labels to filter resources, but I think we're fine to do that.

curious point though as to whether we should even have them. putting them as annotations makes them silent metadata, so I'm inclined to just leave them even though they may be useless, but I also don't care much and can remove them if you think we should

Copy link
Contributor

@tejal29 tejal29 Jul 16, 2020

Choose a reason for hiding this comment

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

I think you meant removing them won't be a backwards incompatible change?

Correct.

curious point though as to whether we should even have them. putting them as annotations makes them silent metadata, so I'm inclined to just leave them even though they may be useless, but I also don't care much and can remove them if you think we should

Removing them could simplify the code a lot. We don't need the Annotations method in the interface. Merging annotations etc is not needed.

@nkubala
Copy link
Contributor Author

nkubala commented Jul 16, 2020

thinking about this a little more i think we could remove a lot of code if we get rid of the unnecessary annotations. going to close this PR and reopen another shortly

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.

Updating Skaffold breaks redeploys since it changes labels
4 participants