8391: Set or Propagate Labels#83
Conversation
- Set labels automatically, based on cluster name, machine set, and pool name - Propagate user-defined labels to VM and VMI CRDs related-to: harvester/harvester#8391 Signed-off-by: Moritz Röhrich <moritz.rohrich@suse.com>
Signed-off-by: Moritz Röhrich <moritz.rohrich@suse.com>
Add module replacement for glog back to ensure fix for CVE-2024-45339 is included. Signed-off-by: Moritz Röhrich <moritz.rohrich@suse.com>
Vicente-Cheng
left a comment
There was a problem hiding this comment.
Generally, LGTM. I'm just curious about the scenario where the labels did not propagate.
Additionally, I suggest separating the refactor commit from the feature enhancement commit.
Most changes are related to the refactor.
That would help the reviewer to get an understanding efficiently.
Thanks!
|
|
||
| WORKDIR ${DAPPER_SOURCE} | ||
|
|
||
| # Make this a separate step, so it doesn't have to be done every time a |
There was a problem hiding this comment.
Do we really need this?
We can set up everything before executing the make test.
| module github.com/harvester/docker-machine-driver-harvester | ||
|
|
||
| go 1.24.7 | ||
| go 1.25.0 |
There was a problem hiding this comment.
Consider using
go 1.25
toolchain go1.25.2
| vm.Spec.Template.Spec.Domain.CPU.DedicatedCPUPlacement = d.CPUPinning | ||
| vm.Spec.Template.Spec.Domain.CPU.IsolateEmulatorThread = d.IsolateEmulatorThread | ||
|
|
||
| vm.Kind = kubevirtv1.VirtualMachineGroupVersionKind.Kind |
There was a problem hiding this comment.
Just curious, why do we move these two lines?
| builder.Labels(labels.Set{ | ||
| machineSetNameLabelKey: machineSetName, | ||
| }) | ||
| builder.VirtualMachineInstanceTemplateLabels(labels.Set{ |
There was a problem hiding this comment.
I am curious about this. I check the current guest cluster VM.
Looks like the VM label (metadata/labels) will propagate to the VMI/virt-launcher pod.
Just curious what case we need to add the same label to the spec/template/metadata/labels?
Which means the VM label did not propagate.
|
The There are labels, annotations on The Back to general, we might require four kinds of general customization to meet different requirements:
vm object: vmi object: |
related-to: harvester/harvester#8391
Problem:
As described in #8391, there is a need to be able to define custom labels for VMs created with the Harvester node driver.
One use case for such labels is that a user, who creates a downstream cluster in Rancher may want to label some of the nodes of that downstream cluster such that they can later be selected by a load balancer as backends.
Solution:
Add a new flag to the Harvester node driver, which expects a string containing the labels and their values.
The format of the string should be that each label and value is separated by
=and each label-value-pair is separated by,.Thus labels may be specified as follows:
will result in the labels:
These labels are applied both to the VM CRD and the VMI CRD.
Related Issue(s):
related-to: harvester/harvester#8391
SURE-9641
Test plan:
TBD
Additional documentation or context