Skip to content

Improve chart name validation #1377

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

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Improve chart name validation #1377

merged 1 commit into from
Feb 21, 2024

Conversation

darkowlzz
Copy link
Contributor

Allow periods in the chart name and validate chart name before packaging it.

Fixes #1367

Allow periods in the chart name and validate chart name before
packaging it.

Signed-off-by: Sunny <github@darkowlzz.space>
@darkowlzz darkowlzz added the area/helm Helm related issues and pull requests label Feb 20, 2024
@@ -81,9 +81,9 @@ func (r RemoteReference) Validate() error {
if r.Name == "" {
return fmt.Errorf("no name set for remote chart reference")
}
name := regexp.MustCompile("^([-a-z0-9]+/?)+$")
name := regexp.MustCompile(`^([-a-z0-9]+/?\.?)+$`)
Copy link
Contributor Author

@darkowlzz darkowlzz Feb 20, 2024

Choose a reason for hiding this comment

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

Using "`" here to avoid double escaping "\". Suggested by linter.

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @darkowlzz 🏅

@darkowlzz darkowlzz added the backport:release/v1.2.x To be backported to release/v1.2.x label Feb 21, 2024
@darkowlzz darkowlzz merged commit 76db76c into main Feb 21, 2024
@darkowlzz darkowlzz deleted the chart-name-validations branch February 21, 2024 11:37
@fluxcdbot
Copy link
Member

Successfully created backport PR for release/v1.2.x:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm Helm related issues and pull requests backport:release/v1.2.x To be backported to release/v1.2.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redundant validation on chart name
4 participants