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

[Request] Allow modifying annotations #564

Closed
jgonera opened this issue Nov 20, 2018 · 2 comments
Closed

[Request] Allow modifying annotations #564

jgonera opened this issue Nov 20, 2018 · 2 comments

Comments

@jgonera
Copy link

jgonera commented Nov 20, 2018

I have a deploy script that works more or less like this (simplified version):

kustomize edit set imagetag myimage:$VERSION
kustomize edit add annotation deployTimestamp:$(date -u +"%Y-%m-%dT%H%M%SZ")
kustomize build | kubectl apply -f -

git add .
git commit --message="Deploy $VERSION"
git push origin master

I'm using annotations to be able to force a deploy even if I didn't change anything, but it seems that kustomize edit add annotation will not modify an existing annotation:

Error: annotation deployTimestamp already in kustomization file

Could this behavior be changed? Or maybe I should approach this differently?

@Liujingfang1
Copy link
Contributor

Maybe a --force flag. What do yo think? @monopole

@2opremio
Copy link
Contributor

2opremio commented Feb 17, 2019

@Liujingfang1 Is a --force flag still acceptable? I may find the time to create a PR.

Derailing a bit, I have always found the distinction of edit add and edit set really inconvenient for automation. My expected behavior would be add it if it doesn't exist and and edit it if it does. In that way I would expect a --force flag for other commands like edit set image too.

Thus, would it make sense to add --force to more commands?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants