Skip to content

Commit

Permalink
Merge pull request #4589 from AndiDog/machine-pool-bootstrap-config-r…
Browse files Browse the repository at this point in the history
…ef-rotation

Fix launch template reconciliation if bootstrap data secret cannot be read
  • Loading branch information
k8s-ci-robot authored Nov 4, 2023
2 parents 0e57135 + 2b13c74 commit 07e91d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cloud/scope/machinepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (m *MachinePoolScope) getBootstrapData() ([]byte, string, error) {
key := types.NamespacedName{Namespace: m.Namespace(), Name: *m.MachinePool.Spec.Template.Spec.Bootstrap.DataSecretName}

if err := m.Client.Get(context.TODO(), key, secret); err != nil {
return nil, "", errors.Wrapf(err, "failed to retrieve bootstrap data secret for AWSMachine %s/%s", m.Namespace(), m.Name())
return nil, "", errors.Wrapf(err, "failed to retrieve bootstrap data secret %s for AWSMachine %s/%s", key.Name, m.Namespace(), m.Name())
}

value, ok := secret.Data["value"]
Expand Down
1 change: 1 addition & 0 deletions pkg/cloud/services/ec2/launchtemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func (s *Service) ReconcileLaunchTemplate(
bootstrapData, err := scope.GetRawBootstrapData()
if err != nil {
record.Eventf(scope.GetMachinePool(), corev1.EventTypeWarning, "FailedGetBootstrapData", err.Error())
return err
}
bootstrapDataHash := userdata.ComputeHash(bootstrapData)

Expand Down

0 comments on commit 07e91d2

Please sign in to comment.