Skip to content

Commit

Permalink
Only attempt to delete bootstrap data secret if InsecureSkipSecretsMa…
Browse files Browse the repository at this point in the history
…nager isn't set
  • Loading branch information
David Mather committed Apr 8, 2022
1 parent eaafc00 commit 823459d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions controllers/awsmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,10 @@ func (r *AWSMachineReconciler) ignitionUserData(scope *scope.MachineScope, objec
}

func (r *AWSMachineReconciler) deleteBootstrapData(machineScope *scope.MachineScope, clusterScope cloud.ClusterScoper, objectStoreScope scope.S3Scope) error {
if err := r.deleteEncryptedBootstrapDataSecret(machineScope, clusterScope); err != nil {
return err
if !machineScope.AWSMachine.Spec.CloudInit.InsecureSkipSecretsManager {
if err := r.deleteEncryptedBootstrapDataSecret(machineScope, clusterScope); err != nil {
return err
}
}

if objectStoreScope != nil {
Expand Down

0 comments on commit 823459d

Please sign in to comment.