upbound / provider-terraform

A Crossplane provider for Terraform
https://marketplace.upbound.io/providers/upbound/provider-terraform/
Apache License 2.0
151 stars 59 forks source link

publishConnectionDetailsTo not working for kubernetes secrets, but writeConnectionSecretToRef does #297

Open applike-ss opened 1 week ago

applike-ss commented 1 week ago

What happened?

I am in the process of setting up the crossplane-terraform provider and can use its Workspace resource to create infrastructure, see its outputs in the status field, however when supplying publishConnectionDetailsTo it does not create a secret in any of the namespaces of the cluster. The default StoreConfig exists and refers to kubernetes and the crossplane-system namespace.

How can we reproduce it?

Add this to your workspace:

  publishConnectionDetailsTo:
    name: xyz

See that it doesn't work for a tf module with outputs, however also see that the outputs are shown in the status field of your Workspace resource.

Now instead of adding the prior part, add this:

  writeConnectionSecretToRef:
    name: xyz
    namespace: crossplane-system

See that your secret gets created with the expected content.

What environment did it happen in?

Please let me know, if I just made a mistake here or whether this should even work. If I'm not mistaken, then writeConnectionSecretToRef is supposed to be replaced by publishConnectionDetailsTo in the long run, so I did not want to add a soon-to-be-deprecated field to my infrastructure code.