terraform-provider-kubectl icon indicating copy to clipboard operation
terraform-provider-kubectl copied to clipboard

Ability to use data from status fields

Open valorl opened this issue 4 years ago • 1 comments

I'm using this provider to create a Flux2 Receiver CR, which, once created, generates a URL path which it exposes under status.URL. I would like to pass this into the gitlab_project_hook to automate setting up that webhook.

However, it appears like this provider only stores the fields that were provided in order to create the resource, but doesn't update any part of the statefile with e.g. the status fields. I would like to be able to access such fields. It could also be explicit using e.g. a extra_tracked_fields variable, which in my case could be set to [ "status.URL" ] An alternative could be to have a data source for fetching the entire object separately, similar to https://github.com/hashicorp/terraform-provider-kubernetes-alpha/issues/25

valorl avatar Apr 26 '21 09:04 valorl

I like the idea about a new datasource - would make the most sense since adding another attribute to kubectl_manifest resource would cause lots of warnings from Terraform v1.x series saying that it had been updated outside of Terraform.

gavinbunney avatar Oct 10 '21 20:10 gavinbunney