hashicorp / hcp-terraform-operator

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

Remove module/workspace name labels from output ConfigMaps #423

Closed jtdoepke closed 3 months ago

jtdoepke commented 3 months ago

Description

Labels on Kubernetes resources can only be 63 characters long. If the workspace/module name is longer than that, the controllers will go into an error loop. This PR truncates the ConfigMap labels at 63 characters.

I'll be the first to admit this is not a very good solution, and I am open to an alternative. I just didn't want to propose a breaking change without getting some input.

Alternatives:

Usage Example

N/A

References

Community Note

hashicorp-cla-app[bot] commented 3 months ago

CLA assistant check
All committers have signed the CLA.

hashicorp-cla-app[bot] commented 3 months ago

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

arybolovlev commented 3 months ago

Hi @jtdoepke,

Thank you for raising this PR!

Thanks!

jtdoepke commented 3 months ago

Hi @arybolovlev,

I've signed the CLA and updated the PR to just remove the name labels.

arybolovlev commented 3 months ago

Thank you, @jtdoepke!

Please push change log entries. I will then approve this PR, merge, and cut a new release with this fix.

$ changie new --kind BUG\ FIXES --custom "PR=423" --body '`Module`: Fix an issue where the controller cannot create ConfigMap and Secret for outputs when a Module custom resource `metadata.name` is longer than 63 characters. This issue occurs because the controller uses the custom resource name as the value for the ModuleName label in ConfigMap and Secret. The `ModuleName` label has been removed."'

$ changie new --kind BUG\ FIXES --custom "PR=423" --body '`Workspace`: Fix an issue where the controller cannot create ConfigMap and Secret for outputs when a Workspace custom resource `metadata.name` is longer than 63 characters. This issue occurs because the controller uses the custom resource name as the value for the `workspaceName` label in ConfigMap and Secret. The `workspaceName` label has been removed.'
jtdoepke commented 3 months ago

@arybolovlev changelog files added.