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

Adding label in snapshot #29

Open
sebglon opened this issue Sep 5, 2017 · 5 comments
Open

Adding label in snapshot #29

sebglon opened this issue Sep 5, 2017 · 5 comments
Labels
enhancement needs-pr The maintainers are not working on this, but will help getting a PR merged.

Comments

@sebglon
Copy link

sebglon commented Sep 5, 2017

Can we add static label or copy label from disk to snapshot?
a good idea can to to permit json templating with PV/PVC description.

@miracle2k
Copy link
Owner

Manual labels, or copying labels from the disk is a neat idea, though I do wonder if we should do it, because we are potentially extending the interface that backends have to implement.

What's the use case specifically? I am not sure what you mean by JSON templating either. Can you explain more?

@miracle2k miracle2k added the needs-pr The maintainers are not working on this, but will help getting a PR merged. label Aug 31, 2018
@haizaar
Copy link

haizaar commented Oct 23, 2018

+1 for that.

My use case is spending management. We label all our GCP resources by "service" label to help breaking down the spending later on. I would account snapshots costs as part of the respective disk/resource/service costs. Therefore I would like to be able to specify either:

  • Additional labels names to be copied from the original resource
  • Or even manually set desired label key/val in annotations

We don't need anything fancy like templating. KISS will work great.

@iakat
Copy link

iakat commented May 15, 2019

You can set custom labels with environment variables: https://github.com/miracle2k/k8s-snapshots/blob/d4af616c1641465b0367054166cc2c5a9de0326f/k8s_snapshots/config.py

pass SNAPSHOT_AUTHOR_LABEL and SNAPSHOT_AUTHOR_LABEL_KEY to override the defaults.

@mdnfiras
Copy link

mdnfiras commented May 5, 2022

hi, have this been implemented? or work in progress?

@mdnfiras
Copy link

mdnfiras commented May 5, 2022

i don't know why @sim1 's comment is downvoted, it actually works and can serve as a temporary workaround if you need just one label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs-pr The maintainers are not working on this, but will help getting a PR merged.
Projects
None yet
Development

No branches or pull requests

5 participants