Skip to content

[Bug] AWSManagedControlPlane deletion fails validation with BYO VPC #5660

@MinhNguyen-at

Description

@MinhNguyen-at

/kind bug

What steps did you take and what happened:

  1. Create an AWSManagedControlPlane with a self-managed VPC and no addons mentioned in spec
spec:
  network:
    vpc:
      id: vpc-myidhere
  1. Let provisioning complete
  2. Delete AWSManagedControlPlane
  3. Observe event
    E0909 22:20:45.932177 1 controller.go:316] "Reconciler error" err="failed to patch AWSManagedControlPlane cluster-namespace/cluster-name: admission webhook "validation.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io" denied the request: AWSManagedControlPlane.controlplane.cluster.x-k8s.io "cluster-name" is invalid: [spec.addons: Invalid value: "": addons are required to be set explicitly if IPv6 is enabled, spec.network.vpc.enableIPv6: Invalid value: true: changing IP family is not allowed after it has been set]" controller="awsmanagedcontrolplane" controllerGroup="controlplane.cluster.x-k8s.io" controllerKind="AWSManagedControlPlane" AWSManagedControlPlane="cluster-namespace/cluster-name" namespace="cluster-namespace" name="cluster-name" reconcileID="89c04084-8af5-44e3-803e-2ae00242b051"
  4. edit validatingwebhookconfiguration for awsmanagedcontrolplane to not apply to UPDATE
  5. observe deletion complete successfully

What did you expect to happen:
ValidatingWebhookConfiguration does not block a valid change made by the CAPA's inner workings.

Environment:

  • Cluster-api-provider-aws version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-priorityneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions