hashicorp / terraform-cloud-operator

Kubernetes Operator allows managing HCP Terraform resources via Kubernetes Custom Resources.
https://developer.hashicorp.com/terraform/cloud-docs
Mozilla Public License 2.0
114 stars 27 forks source link

Migrating from v1 to v2 operator - module variables referencing workspace variables? #409

Closed nabadger closed 1 month ago

nabadger commented 1 month ago

Operator Version, Kind and Kubernetes Version

YAML Manifest File

N/A

Output Log

Kubectl Outputs

Question

I'm migrating from the k8s v1 operator to the newer v2 operator.

In the existing v1 operator we define a single Workspace CR with all of our variables.

In the v2 operator we define a Workspace CR with variables, but it also looks like we have to specify those variables in the Module CR as well.

This seems like we're duplicating some references here, vs say "use all the variables defined in the Workspace.

I just wanted to clarify if I'm using this correctly - i.e. is it right that I duplicate the variable names?

Thanks!

References

Community Note

arybolovlev commented 1 month ago

Hi @nabadger,

This is not a duplicate, but a reference. The Module controller implements API-driven workflow and it requires specifying which variables defined in a workspace will be used.

Thanks!

nabadger commented 1 month ago

Thanks - makes sense to me now.