Skip to content

Commit bba00cf

Browse files
authored
Merge pull request #2717 from jackfrancis/validate-one-aks-system-pool
AKS: clarify that one system pool is required
2 parents 725e373 + c6fa76a commit bba00cf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

exp/api/v1beta1/azuremanagedmachinepool_webhook.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,9 @@ func (m *AzureManagedMachinePool) ValidateUpdate(oldRaw runtime.Object, client c
154154
if m.Spec.Mode != string(NodePoolModeSystem) && old.Spec.Mode == string(NodePoolModeSystem) {
155155
// validate for last system node pool
156156
if err := m.validateLastSystemNodePool(client); err != nil {
157-
allErrs = append(allErrs, field.Invalid(
157+
allErrs = append(allErrs, field.Forbidden(
158158
field.NewPath("Spec", "Mode"),
159-
m.Spec.Mode,
160-
"Last system node pool cannot be mutated to user node pool"))
159+
"Cannot change node pool mode to User, you must have at least one System node pool in your cluster"))
161160
}
162161
}
163162

0 commit comments

Comments
 (0)