Skip to content

Commit b595404

Browse files
Merge pull request #5012 from djoshy/4.18-windows-machineset
OCPBUGS-55428: MSBIC should not update windows machinesets
2 parents b927430 + 0e8c79b commit b595404

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ const (
8989

9090
// Labels and Annotations required for determining architecture of a machineset
9191
MachineSetArchAnnotationKey = "capacity.cluster-autoscaler.kubernetes.io/labels"
92-
ArchLabelKey = "kubernetes.io/arch="
93-
9492
// Name of managed worker secret
9593
ManagedWorkerSecretName = "worker-user-data-managed"
94+
95+
ArchLabelKey = "kubernetes.io/arch="
96+
OSLabelKey = "machine.openshift.io/os-id"
9697
)
9798

9899
// New returns a new machine-set-boot-image controller.
@@ -401,6 +402,13 @@ func (ctrl *Controller) syncMAPIMachineSet(machineSet *machinev1beta1.MachineSet
401402
return fmt.Errorf("unexpected OwnerReference: %v. Please remove this machineset from boot image management to avoid errors", machineSet.GetOwnerReferences()[0].Kind+"/"+machineSet.GetOwnerReferences()[0].Name)
402403
}
403404

405+
if os, ok := machineSet.Spec.Template.Labels[OSLabelKey]; ok {
406+
if os == "Windows" {
407+
klog.Infof("machineset %s has a windows os label, skipping boot image update", machineSet.Name)
408+
return nil
409+
}
410+
}
411+
404412
// Fetch the architecture type of this machineset
405413
arch, err := getArchFromMachineSet(machineSet)
406414
if err != nil {

0 commit comments

Comments
 (0)