crossplane-contrib / provider-upjet-aws

AWS Provider for Crossplane.
https://marketplace.upbound.io/providers/upbound/provider-family-aws/
Apache License 2.0
146 stars 123 forks source link

TransitGatewayVPCAttachment update subnetIdSelector to new labels does not work #1097

Closed Donimax closed 9 months ago

Donimax commented 9 months ago

Is there an existing issue for this?

Affected Resource(s)

TransitGatewayVPCAttachment.ec2.aws.upbound.io/v1beta1

Resource MRs required to reproduce the bug

apiVersion: ec2.aws.upbound.io/v1beta1
kind: VPC
metadata:
  name: testing-vpc
spec:
  forProvider:
    region: us-west-1
    cidrBlock: 172.16.0.0/16
    tags:
      Name: testingVpc
---
apiVersion: ec2.aws.upbound.io/v1beta1
kind: Subnet
metadata:

  labels:
    tgwa: test1
  name: test-subnet1
spec:
  forProvider:
    availabilityZone: us-west-1a
    cidrBlock: 172.16.1.0/24
    region: us-west-1
    vpcIdRef:
      name: testing-vpc
---
apiVersion: ec2.aws.upbound.io/v1beta1
kind: Subnet
metadata:
  labels:
    tgwa: test1
  name: test-subnet2
spec:
  forProvider:
    availabilityZone: us-west-1c
    cidrBlock: 172.16.2.0/24
    region: us-west-1
    vpcIdRef:
      name: testing-vpc
---
apiVersion: ec2.aws.upbound.io/v1beta1
kind: Subnet
metadata:
  labels:
    tgwa: test2
  name: test-subnet3
spec:
  forProvider:
    availabilityZone: us-west-1a
    cidrBlock: 172.16.3.0/24
    region: us-west-1
    vpcIdRef:
      name: testing-vpc
---
apiVersion: ec2.aws.upbound.io/v1beta1
kind: Subnet
metadata:
  labels:
    tgwa: test2
  name: test-subnet4
spec:
  forProvider:
    availabilityZone: us-west-1c
    cidrBlock: 172.16.4.0/24
    region: us-west-1
    vpcIdRef:
      name: testing-vpc
---
apiVersion: ec2.aws.upbound.io/v1beta1
kind: TransitGateway
metadata:
  labels:
    testing.upbound.io/example-name: test
  name: test
spec:
  forProvider:
    multicastSupport: enable
    region: us-west-1
---
apiVersion: ec2.aws.upbound.io/v1beta1
kind: TransitGatewayVPCAttachment
metadata:
  labels:
    testing.upbound.io/example-name: test
  name: test
spec:
  forProvider:
    region: us-west-1
    subnetIdSelector:
      matchLabels:
        tgwa: test1
    transitGatewayIdRef:
      name: test
    vpcIdRef:
      name: testing-vpc

Steps to Reproduce

What happened?

After changing the subnetIdSelector to the other 2 subnets it should update the TransitGatewayVPCAttachment resource to them.

Relevant Error Output Snippet

No response

Crossplane Version

1.14.5

Provider Version

0.47.1

Kubernetes Version

v1.28.2

Kubernetes Distribution

EKS

Additional Info

No response

haarchri commented 9 months ago

did you tried to use https://marketplace.upbound.io/providers/upbound/provider-aws-ec2/v0.47.1/resources/ec2.aws.upbound.io/TransitGatewayVPCAttachment/v1beta1#doc:spec-forProvider-subnetIdSelector-policy-resolve

Use 'Always' to resolve the reference on every reconcile.

      policy:
        resolve: Always
Donimax commented 9 months ago

@haarchri Works, thx