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

Ensure volume name does not end with a trailing dash #1081

Conversation

SaschaSchwarze0
Copy link
Member

Changes

In certain use cases, for example for a bundle source, we need to turn a secret name into a volume name to mount its data in the container. For this we have a translation function. But that had a problem.

Assuming the secret name is abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcd-efgh.

It prefixed shp- -> shp-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcd-efgh.

It trimmed to at most 63 characters -> shp-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcd-.

And that was it.

But now the volume name ended with a dash which is not allowed. Adding code to trim trailing dashes.

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

Release Notes

Secret names which had a dash at the 59th characters could not be used for a bundle source because of an error in the translation of secret into volume names

@SaschaSchwarze0 SaschaSchwarze0 added the kind/bug Categorizes issue or PR as related to a bug. label Jul 13, 2022
@openshift-ci openshift-ci bot added the release-note Label for when a PR has specified a release note label Jul 13, 2022
Copy link
Contributor

@qu1queee qu1queee left a comment

Choose a reason for hiding this comment

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

ty, good catch

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 13, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 13, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qu1queee

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 13, 2022
@openshift-ci openshift-ci bot merged commit 9dad094 into shipwright-io:main Jul 13, 2022
@SaschaSchwarze0 SaschaSchwarze0 deleted the sascha-ensure-no-trailing-dash branch August 5, 2022 15:05
@SaschaSchwarze0 SaschaSchwarze0 added this to the release-v0.11.0 milestone Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Label for when a PR has specified a release note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants