crossplane-contrib / provider-aws

Crossplane AWS Provider
Apache License 2.0
441 stars 374 forks source link

Kafka Cluster configurationInfo.arnSelector property incorrectly applies Kafka Configuration arn #1409

Closed vgiannone3 closed 2 years ago

vgiannone3 commented 2 years ago

What happened?

I created a crossplane composition which creates Kafka Configuration and Cluster resources. In order to link the two, I used the configurationInfo.arnSelector property in the cluster resource definition, with a match label.

After applying the composition, the configuration resource is created, and then the configuration arn property for the cluster is updated, but not with the arn. It is updated with the name of the Configuration resource. This puts the Cluster resource into a bad state, where it is reporting that the arn does not exist.

As a workaround, I delete the Cluster resource, and once crossplane creates it again, the arn is correctly set. To make this automated, I created a status variable within the composite resource definition, and set the status to the arn. This works for now, but it would be great if the selector worked as advertised.

How can we reproduce it?

Refer to the description above.

What environment did it happen in?

I am also using ArgoCD as the GitOps tool. It's version is 2.3.3

chlunde commented 2 years ago

Could you please do

kubectl get configuration.kafka

I see

a504ae8-kafkacluster-2-config   True    True     arn:aws:kafka:reg:123:configuration/kafkacluster-2-config/uuid-4

If it's not True/True, then kubectl describe it.

Finally,

k describe cluster.kafka

    Configuration Info:
      Arn:  arn:aws:kafka:reg:123:configuration/kafkacluster-2-config/uuid-4
      Arn Ref:
        Name:  kafkacluster-2-config
      Arn Selector:
        Match Controller Ref:  true
      Revision:                1

Events:
  Type     Reason                           Age                From                                     Message
  ----     ------                           ----               ----                                     -------
  Warning  CannotResolveResourceReferences  14m (x3 over 14m)  managed/cluster.kafka.aws.crossplane.io  cannot resolve references: mg.Spec.ForProvider.CustomClusterParameters.CustomBrokerNodeGroupInfo.SecurityGroups: referenced field was empty (referenced resource may not yet be ready)
  Normal   CreatedExternalResource          14m                managed/cluster.kafka.aws.crossplane.io  Successfully requested creation of external resource

(The securitygroup had a bug so it took a while before we fixed that, you should not see the same message)

haarchri commented 2 years ago

it is working like in @chlunde environment also in our environment - please check your configuration