-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add common labels and annotations to infra and workload parts #1087
Comments
Relates a little to #965 |
Developer Info: For this issue we need to work and a couple of different files.
|
hey @SchSeba , not sure if anyone started to work on this, haven't seen anyone assigned so I decided to give it a go. I just pushed to my fork some initial changes but got some doubts about points 2, 6 and 7.
Small clarification on point 5 would it be Thanks! |
Hi @tripledes!! :) Thanks for helping us make kubevirt amazing.
I think just add to all the kinds inside our templates.
Just config a const string like this Then just like the pod.label you can add it with vmi.label we are using the same meta data like kubernetes so you should have a label list in the object. Please replay on the issue if you have any problem or any other question Thanks again! |
@SchSeba Thanks for the tips! I just did a new push to my fork https://github.com/tripledes/kubevirt/commit/bd5455b35c4c96402f6a84f5171372f9009b7255. Currently it seems to compile (testing as I write), will have a look to the result. If you happen to get some time to review the commit, please do let me know if you see anything wrong. Regarding unit tests, I haven't had a look yet but I assume I'll have to modify or add some so we make sure the labels are there right? UPDATE: Doing some testing, the controller was crashing at me cause the Labels map for VM/I/RS was not initialized, so I added the following code to if vm.Labels == nil {
vm.Labels = map[string]string{}
} That seems to do the trick, but now I get:
That's because I'm using |
Hey, I've updated the code, https://github.com/tripledes/kubevirt/commit/94ee3c11b9cc1ecf028c72778dd20a7fbbf88e81 Currently doing the split in So far I've used https://raw.githubusercontent.com/kubevirt/demo/master/manifests/vm.yaml to test and the labels are added: ➜ kubevirt issue_1087 ✓ cluster/kubectl.sh get vm -o yaml | grep -A 3 labels:
labels:
app.kubernetes.io/managed-by: kubectl
app.kubernetes.io/version: v0.7.0-25
name: testvm
➜ kubevirt issue_1087 ✓ cluster/kubectl.sh get vmi -o yaml | grep -A 3 labels
labels:
app.kubernetes.io/managed-by: kubectl
app.kubernetes.io/version: v0.7.0-25
guest: testvm |
Hey @tripledes good job! I agree with you the split don't need to be there. My recommendation is to make the split in the version.sh level. We want to print the version command just like kubernetes Kubernetes version output
KubeVirt version output
So I think it will be good to remove everything after the @fabiand sounds good? |
@SchSeba @fabiand I was checking out how they do it on Kubernetes and found out that the output from last comment is likely from a K8s release, building it from master I get: Client Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.0-alpha.0.2410+6764a795869d26", GitCommit:"6764a795869d2631eb75f222f776ec5a80b61e37", GitTreeState:"clean", BuildDate:"2018-07-24T08:03:35Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"} I couldn't find anywhere in k8s code where they use the version for labels, so I guess that's why they don't bother. If we still want to use version as a label and keep How does that sound? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
4 similar comments
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
/close Closing this for now. Will probably be revisited by the operator peeps. /cc @rthallisey some annotations that the operator might want to add (see the initial link in the description) |
@fabiand: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
In this PR kubernetes/website#8703 SIG App is defining a common set of labels to add some sematics to Kubernetes objects in order to allow "tooling" to discover relationships between them and understand what an application is composed of.
KubeVirt should follow this pattern.
Benefits:
The text was updated successfully, but these errors were encountered: