Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/v1beta2/awsmachine_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,14 @@ func (*awsMachineWebhook) Default(_ context.Context, obj runtime.Object) error {
r.Spec.CloudInit.SecureSecretsBackend = SecretBackendSecretsManager
}

if r.ignitionEnabled() && r.Spec.Ignition.StorageType == "" {
r.Spec.Ignition.StorageType = DefaultIgnitionStorageType
}
// Defaults the version field if StorageType is not set to `UnencryptedUserData`.
// When using `UnencryptedUserData` the version field is ignored because the userdata defines its version itself.
if r.ignitionEnabled() && r.Spec.Ignition.Version == "" && r.Spec.Ignition.StorageType != IgnitionStorageTypeOptionUnencryptedUserData {
r.Spec.Ignition.Version = DefaultIgnitionVersion
}
if r.ignitionEnabled() && r.Spec.Ignition.StorageType == "" {
r.Spec.Ignition.StorageType = DefaultIgnitionStorageType
}

return nil
}
Expand Down
6 changes: 3 additions & 3 deletions exp/api/v1beta2/awsmachinepool_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,14 @@ func (*AWSMachinePoolWebhook) Default(ctx context.Context, obj runtime.Object) e
r.Spec.DefaultInstanceWarmup.Duration = 300 * time.Second
}

if r.ignitionEnabled() && r.Spec.Ignition.StorageType == "" {
r.Spec.Ignition.StorageType = infrav1.DefaultMachinePoolIgnitionStorageType
}
// Defaults the version field if StorageType is not set to `UnencryptedUserData`.
// When using `UnencryptedUserData` the version field is ignored because the userdata defines its version itself.
if r.ignitionEnabled() && r.Spec.Ignition.Version == "" && r.Spec.Ignition.StorageType != infrav1.IgnitionStorageTypeOptionUnencryptedUserData {
r.Spec.Ignition.Version = infrav1.DefaultIgnitionVersion
}
if r.ignitionEnabled() && r.Spec.Ignition.StorageType == "" {
r.Spec.Ignition.StorageType = infrav1.DefaultMachinePoolIgnitionStorageType
}

return nil
}