@@ -26,6 +26,7 @@ type MachineSetInput struct {
2626 Role string
2727 UserDataSecret string
2828 Hosts map [string ]icaws.Host
29+ OSImageStream string
2930}
3031
3132// MachineSets returns a list of machinesets for a machinepool.
@@ -48,7 +49,7 @@ func MachineSets(in *MachineSetInput) ([]*machineapi.MachineSet, error) {
4849 replicas ++
4950 }
5051
51- nodeLabels := make (map [string ]string , 3 )
52+ machineSpecLabels := make (map [string ]string , 3 )
5253 nodeTaints := []corev1.Taint {}
5354 instanceType := mpool .InstanceType
5455 publicSubnet := in .PublicSubnet
@@ -71,7 +72,7 @@ func MachineSets(in *MachineSetInput) ([]*machineapi.MachineSet, error) {
7172 if zone .PreferredInstanceType != "" {
7273 instanceType = zone .PreferredInstanceType
7374 }
74- nodeLabels = map [string ]string {
75+ machineSpecLabels = map [string ]string {
7576 "node-role.kubernetes.io/edge" : "" ,
7677 "machine.openshift.io/zone-type" : zone .Type ,
7778 "machine.openshift.io/zone-group" : zone .GroupName ,
@@ -112,13 +113,16 @@ func MachineSets(in *MachineSetInput) ([]*machineapi.MachineSet, error) {
112113 return nil , errors .Wrap (err , "failed to create provider" )
113114 }
114115
116+ // TODO: use const for label
117+ machineSpecLabels ["machine.openshift.io/os-image-stream" ] = in .OSImageStream
118+
115119 name := fmt .Sprintf ("%s-%s-%s" , in .ClusterID , in .Pool .Name , az )
116120 spec := machineapi.MachineSpec {
117121 ProviderSpec : machineapi.ProviderSpec {
118122 Value : & runtime.RawExtension {Object : provider },
119123 },
120124 ObjectMeta : machineapi.ObjectMeta {
121- Labels : nodeLabels ,
125+ Labels : machineSpecLabels ,
122126 },
123127 Taints : nodeTaints ,
124128 }
@@ -150,6 +154,7 @@ func MachineSets(in *MachineSetInput) ([]*machineapi.MachineSet, error) {
150154 "machine.openshift.io/cluster-api-cluster" : in .ClusterID ,
151155 "machine.openshift.io/cluster-api-machine-role" : in .Role ,
152156 "machine.openshift.io/cluster-api-machine-type" : in .Role ,
157+ "machine.openshift.io/os-image-stream" : in .OSImageStream ,
153158 },
154159 },
155160 Spec : spec ,
0 commit comments