Skip to content

Commit 2b13c74

Browse files
committed
Fix launch template reconciliation if bootstrap data secret cannot be read
1 parent 28f3422 commit 2b13c74

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/cloud/scope/machinepool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func (m *MachinePoolScope) getBootstrapData() ([]byte, string, error) {
167167
key := types.NamespacedName{Namespace: m.Namespace(), Name: *m.MachinePool.Spec.Template.Spec.Bootstrap.DataSecretName}
168168

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

173173
value, ok := secret.Data["value"]

pkg/cloud/services/ec2/launchtemplate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func (s *Service) ReconcileLaunchTemplate(
5959
bootstrapData, err := scope.GetRawBootstrapData()
6060
if err != nil {
6161
record.Eventf(scope.GetMachinePool(), corev1.EventTypeWarning, "FailedGetBootstrapData", err.Error())
62+
return err
6263
}
6364
bootstrapDataHash := userdata.ComputeHash(bootstrapData)
6465

0 commit comments

Comments
 (0)