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