Skip to content

Commit

Permalink
Fix typo. Thanks buildbot. Also comments at 80 chars
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Rigby <scott@r6by.com>
  • Loading branch information
scottrigby committed Jan 10, 2022
1 parent fb0eeeb commit 157ac85
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions internal/experimental/registry/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@ func ctx(out io.Writer, debug bool) context.Context {
return ctx
}

// parseReference will parse and validate the reference, and clean tags when applicable
// tags are only cleaned when plus (+) signs are present, and are converted to underscores (_) before pushing
// See https://github.com/helm/helm/issues/10166
// parseReference will parse and validate the reference, and clean tags when
// applicable tags are only cleaned when plus (+) signs are present, and are
// converted to underscores (_) before pushing
// See https://github.com/helm/helm/issues/10166
func parseReference(raw string) (registry.Reference, error) {
// The sole possible reference modification is replacing plus (+) signs present in tags with underscores (_)
// To do this properly, we first need to identify a tag, and then pass it on to the reference parser
// NOTE: Passing immediately to the reference parser will fail since (+) signs are an invalid tag character, and
// simply replacing all plus (+) occurances could invalidate other portions of the URI
// The sole possible reference modification is replacing plus (+) signs
// present in tags with underscores (_). To do this properly, we first
// need to identify a tag, and then pass it on to the reference parser
// NOTE: Passing immediately to the reference parser will fail since (+)
// signs are an invalid tag character, and simply replacing all plus (+)
// occurrences could invalidate other portions of the URI
parts := strings.Split(raw, ":")
if len(parts) > 1 && !strings.Contains(parts[len(parts)-1], "/") {
tag := parts[len(parts)-1]
Expand Down

0 comments on commit 157ac85

Please sign in to comment.