crossplane-contrib / provider-upjet-gcp

GCP Provider for Crossplane.
https://marketplace.upbound.io/providers/upbound/provider-family-gcp/
Apache License 2.0
69 stars 76 forks source link

[Bug]: removeDefaultNodePool no longer delete default-pool #607

Open bradkwadsworth-mw opened 3 months ago

bradkwadsworth-mw commented 3 months ago

Is there an existing issue for this?

Affected Resource(s)

Resource MRs required to reproduce the bug

---
apiVersion: compute.gcp.upbound.io/v1beta1
kind: Network
metadata:
  annotations:
    uptest.upbound.io/timeout: "4800"
    meta.upbound.io/example-id: compute/v1beta1/network
  labels:
    testing.upbound.io/example-name: example_network
  name: example-network
spec:
  forProvider:
    autoCreateSubnetworks: false
---
apiVersion: compute.gcp.upbound.io/v1beta1
kind: Subnetwork
metadata:
  annotations:
    meta.upbound.io/example-id: compute/v1beta1/subnetwork
  labels:
    testing.upbound.io/example-name: example_subnet
  name: gke
spec:
  forProvider:
    ipCidrRange: 10.0.0.0/24
    networkSelector:
      matchLabels:
        testing.upbound.io/example-name: example_network
    region: us-central1
    privateIpGoogleAccess: true
    secondaryIpRange:
      - ipCidrRange: 10.1.0.0/16
        rangeName: pods
      - ipCidrRange: 10.2.0.0/20
        rangeName: services
---
apiVersion: compute.gcp.upbound.io/v1beta1
kind: Router
metadata:
  annotations:
    meta.upbound.io/example-id: compute/v1beta1/router
  labels:
    testing.upbound.io/example-name: example_router
  name: example-router
spec:
  forProvider:
    networkSelector:
      matchLabels:
        testing.upbound.io/example-name: example_network
    region: us-central1
---
apiVersion: compute.gcp.upbound.io/v1beta1
kind: RouterNAT
metadata:
  annotations:
    meta.upbound.io/example-id: compute/v1beta1/routernat
  labels:
    testing.upbound.io/example-name: example_routernat
  name: example-routernat
spec:
  forProvider:
    natIpAllocateOption: AUTO_ONLY
    region: us-central1
    routerSelector:
      matchLabels:
        testing.upbound.io/example-name: example_router
    sourceSubnetworkIpRangesToNat: ALL_SUBNETWORKS_ALL_IP_RANGES
---
apiVersion: container.gcp.upbound.io/v1beta1
kind: Cluster
metadata:
  annotations:
    meta.upbound.io/example-id: container/v1beta1/cluster
  labels:
    testing.upbound.io/example-name: cluster
  name: cluster
spec:
  forProvider:
    addonsConfig:
      - gcePersistentDiskCsiDriverConfig:
          - enabled: true
        gcpFilestoreCsiDriverConfig:
          - enabled: true
        gkeBackupAgentConfig:
          - enabled: true
    binaryAuthorization:
      - evaluationMode: PROJECT_SINGLETON_POLICY_ENFORCE
    datapathProvider: ADVANCED_DATAPATH
    deletionProtection: false
    enableAutopilot: false
    enableIntranodeVisibility: true
    enableL4IlbSubsetting: true
    enableShieldedNodes: true
    gatewayApiConfig:
      - channel: CHANNEL_STANDARD
    initialNodeCount: 1
    ipAllocationPolicy:
      - clusterSecondaryRangeName: pods
        servicesSecondaryRangeName: services
    location: us-central1
    masterAuthorizedNetworksConfig:
      - gcpPublicCidrsAccessEnabled: false
        cidrBlocks:
          - cidrBlock: 10.0.0.0/24
            displayName: bastion
    networkSelector:
      matchLabels:
        testing.upbound.io/example-name: example_network
    networkingMode: VPC_NATIVE
    privateClusterConfig:
      - enablePrivateEndpoint: true
        enablePrivateNodes: true
        masterGlobalAccessConfig:
          - enabled: false
        privateEndpointSubnetwork: gke
    releaseChannel:
      - channel: STABLE
    removeDefaultNodePool: true
    subnetworkSelector:
      matchLabels:
        testing.upbound.io/example-name: example_subnet
    workloadIdentityConfig:
      - workloadPool: bradw-nextgen-devops.svc.id.goog

Steps to Reproduce

What happened?

All resources deployed, but the Cluster resource did not delete the default pool after creation when removeDefaultNodePool: true. This worked in v1.7.

Relevant Error Output Snippet

No response

Crossplane Version

1.6

Provider Version

1.8

Kubernetes Version

No response

Kubernetes Distribution

No response

Additional Info

No response

wiggitywhitney commented 2 months ago

+1