Skip to content

Commit d9a57b6

Browse files
Merge pull request #1320 from huali9/fix43608
OCPBUGS-43608: add webhook for fields that are not working
2 parents c2d9e7f + 4f3670c commit d9a57b6

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pkg/webhooks/machine_webhook.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,30 @@ func validateAWS(m *machinev1beta1.Machine, config *admissionConfig) (bool, []st
732732
)
733733
}
734734

735+
if providerSpec.Subnet.ARN != nil {
736+
warnings = append(
737+
warnings,
738+
"can't use providerSpec.subnet.arn, only providerSpec.subnet.id or providerSpec.subnet.filters can be used to reference Subnet",
739+
)
740+
}
741+
735742
if providerSpec.IAMInstanceProfile == nil {
736743
warnings = append(warnings, "providerSpec.iamInstanceProfile: no IAM instance profile provided: nodes may be unable to join the cluster")
744+
} else {
745+
746+
if providerSpec.IAMInstanceProfile.ARN != nil {
747+
warnings = append(
748+
warnings,
749+
"can't use providerSpec.iamInstanceProfile.arn, only providerSpec.iamInstanceProfile.id can be used to reference IAMInstanceProfile",
750+
)
751+
}
752+
753+
if providerSpec.IAMInstanceProfile.Filters != nil {
754+
warnings = append(
755+
warnings,
756+
"can't use providerSpec.iamInstanceProfile.filters, only providerSpec.iamInstanceProfile.id can be used to reference IAMInstanceProfile",
757+
)
758+
}
737759
}
738760

739761
if providerSpec.CapacityReservationID != "" {

0 commit comments

Comments
 (0)