Skip to content

Commit

Permalink
Merge pull request #3426 from pkbhowmick/better-validation
Browse files Browse the repository at this point in the history
Use `clusterctlv1.DeleteForMoveAnnotation` on last systempool validation
  • Loading branch information
k8s-ci-robot authored Oct 19, 2023
2 parents 2d51882 + cf10241 commit 1b6df41
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/v1beta1/azuremanagedmachinepool_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"sigs.k8s.io/cluster-api-provider-azure/util/maps"
webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3"
capifeature "sigs.k8s.io/cluster-api/feature"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -323,7 +324,8 @@ func (m *AzureManagedMachinePool) validateLastSystemNodePool(cli client.Client)
return nil
}

if ownerCluster.Spec.Paused {
// checking if the Cluster is going to be deleted for clusterctl move operation
if _, found := ownerCluster.Annotations[clusterctlv1.DeleteForMoveAnnotation]; found {
return nil
}

Expand Down

0 comments on commit 1b6df41

Please sign in to comment.