Fix typo. Thanks buildbot. Also comments at 80 chars

Signed-off-by: Scott Rigby <scott@r6by.com>
pull/10521/head
Scott Rigby 3 years ago
parent fb0eeebf66
commit 157ac85ab7
No known key found for this signature in database
GPG Key ID: C7C6FBB5B91C1155

@ -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]

Loading…
Cancel
Save