Skip to content

Commit

Permalink
Fetch userdata from secret ref.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Feb 5, 2025
1 parent 5b35af5 commit 5457e96
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controller/worker/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ func (w *workerDelegate) generateMachineConfig(ctx context.Context) error {
Image: machineImage,
})

userData, err := worker.FetchUserData(ctx, w.client, w.worker.Namespace, pool)
if err != nil {
return err
}

var (
metalClusterIDTag = fmt.Sprintf("%s=%s", tag.ClusterID, w.cluster.Shoot.GetUID())
metalClusterNameTag = fmt.Sprintf("%s=%s", tag.ClusterName, w.worker.Namespace)
Expand Down Expand Up @@ -157,7 +162,7 @@ func (w *workerDelegate) generateMachineConfig(ctx context.Context) error {
"tags": tags,
"sshkeys": []string{string(w.worker.Spec.SSHPublicKey)},
"secret": map[string]interface{}{
"cloudConfig": string(pool.UserData),
"cloudConfig": userData,
},
"credentialsSecretRef": map[string]interface{}{
"name": w.worker.Spec.SecretRef.Name,
Expand Down

0 comments on commit 5457e96

Please sign in to comment.