Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Conversation

@rodrigovalin
Copy link
Contributor

Username with underscore in name will prevent Secret from being created.

Open questions:

  • Should we add other characters to be replaced as well?

@irajdeep
Copy link
Contributor

irajdeep commented Feb 4, 2022

We should try to make any non-compatible RFC 1123 compatible, in addition to this(underscore) special case. We have had a discussion around this, in this ticket: https://jira.mongodb.org/browse/CLOUDP-95810

@rodrigovalin
Copy link
Contributor Author

I think we should be good with transforming : / ? # [ ] @ into - as described in https://docs.mongodb.com/manual/reference/connection-string/. Do you agree that that solution is sufficient?

@irajdeep
Copy link
Contributor

irajdeep commented Feb 4, 2022

I think we should be good with transforming : / ? # [ ] @ into - as described in https://docs.mongodb.com/manual/reference/connection-string/. Do you agree that that solution is sufficient?

I think this would make sense. In addition to this, we should deal it the way we handle scramCredentialsSecretName which has the same problem:

  1. Ask the user to provide an optional secret ref name for storing the credential.
  2. Perform a DNS1123 name validation at the custom resource level if it is specified.

And if not specified then perform the transformation, if the generated name is non-complaint. WDYT.

@rodrigovalin
Copy link
Contributor Author

Considering that we have an internal ticket for the bigger fix, we could fix this problem with this preliminary solution right away; and then work on the other implementation once that ticket has been triagged.

@irajdeep
Copy link
Contributor

irajdeep commented Feb 7, 2022

Yeah, for now, we can transform : / ? # [ ] @ into - and get this merged and revisit the optional secretRef later.

@rodrigovalin rodrigovalin changed the title Fix Secret creation with username with _. Fix Secret creation with username with rfc-1123 non-allowed-chars. Feb 7, 2022
@rodrigovalin
Copy link
Contributor Author

@irajdeep ready for another review

Copy link
Contributor

@irajdeep irajdeep left a comment

Choose a reason for hiding this comment

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

LGTM

@rodrigovalin rodrigovalin merged commit 4b79fbb into master Feb 7, 2022
@rodrigovalin rodrigovalin deleted the fixes-name-with-underscore branch February 7, 2022 10:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Credentials secret creation fails when user name contains underscore

3 participants