Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove module/workspace name labels from output ConfigMaps #423

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

jtdoepke
Copy link
Contributor

@jtdoepke jtdoepke commented Jun 5, 2024

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:

  • Make the labels into annotations instead.
  • Do away with the labels entirely.
  • Make any or all of the above configurable using CLI flags.

Usage Example

N/A

References

Community Note

  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

@jtdoepke jtdoepke requested a review from a team as a code owner June 5, 2024 20:23
Copy link

hashicorp-cla-app bot commented Jun 5, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

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
Copy link
Contributor

Hi @jtdoepke,

Thank you for raising this PR!

  • Could you please sign CLA?
  • Let's remove the ModuleName and workspaceName labels and leave workspaceID as it is (please do not truncate it). The workspace ID remains the same length and fits within the label length limit. I understand, that if that changes we will get into the same issue, however, on a long run distance we will need a more reliable solution. I like the alternative proposals that you made and we will definitely take them into account.

Thanks!

@jtdoepke jtdoepke changed the title Truncate output ConfigMap labels at 63 characters Remove module/workspace name labels from output ConfigMaps Jun 6, 2024
@jtdoepke
Copy link
Contributor Author

jtdoepke commented Jun 6, 2024

Hi @arybolovlev,

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

@arybolovlev
Copy link
Contributor

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.'

The names of workspaces and modules can exceed the maximum length of a
Kubernetes label value (63 characters).
@jtdoepke
Copy link
Contributor Author

jtdoepke commented Jun 6, 2024

@arybolovlev changelog files added.

Copy link
Contributor

@arybolovlev arybolovlev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this, @jtdoepke!

@arybolovlev arybolovlev merged commit 6f31f32 into hashicorp:main Jun 7, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Module output label exceeds 63 char limit length
3 participants