Only attempt to delete bootstrap data secret if InsecureSkipSecretsManager isn't set
@@ -733,9 +733,11 @@ func (r *AWSMachineReconciler) ignitionUserData(scope *scope.MachineScope, objec
}
func (r *AWSMachineReconciler) deleteBootstrapData(machineScope *scope.MachineScope, clusterScope cloud.ClusterScoper, objectStoreScope scope.S3Scope) error {
+ if !machineScope.AWSMachine.Spec.CloudInit.InsecureSkipSecretsManager {
if err := r.deleteEncryptedBootstrapDataSecret(machineScope, clusterScope); err != nil {
return err
}
+ }
if objectStoreScope != nil {
// Bootstrap data will be removed from S3 if it is already populated.
