Skip to content

Commit

Permalink
Add pool labels to machine tags. (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Nov 19, 2020
1 parent 80557b6 commit 9585517
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions pkg/controller/worker/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,24 +253,30 @@ func (w *workerDelegate) generateMachineConfig(ctx context.Context) error {
kubernetesTopologyZoneTag = fmt.Sprintf("topology.kubernetes.io/zone=%s", infrastructureConfig.PartitionID)
)

tags := []string{
kubernetesClusterTag,
kubernetesRoleTag,
kubernetesInstanceTypeTag,
kubernetesTopologyRegionTag,
kubernetesTopologyZoneTag,

metalClusterIDTag,
metalClusterNameTag,
metalClusterProjectTag,
}

for k, v := range pool.Labels {
tags = append(tags, fmt.Sprintf("%s=%s", k, v))
}

machineClassSpec := map[string]interface{}{
"partition": infrastructureConfig.PartitionID,
"size": pool.MachineType,
"project": projectID,
"network": privateNetwork.ID,
"image": machineImage,
"tags": []string{
kubernetesClusterTag,
kubernetesRoleTag,
kubernetesInstanceTypeTag,
kubernetesTopologyRegionTag,
kubernetesTopologyZoneTag,

metalClusterIDTag,
metalClusterNameTag,
metalClusterProjectTag,
},
"sshkeys": []string{string(w.worker.Spec.SSHPublicKey)},
"tags": tags,
"sshkeys": []string{string(w.worker.Spec.SSHPublicKey)},
"secret": map[string]interface{}{
"cloudConfig": string(pool.UserData),
},
Expand Down

0 comments on commit 9585517

Please sign in to comment.