Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Aug 15, 2019
1 parent 9776d34 commit fee3c26
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/resolve/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ func ImageReferences(input []byte, strict bool, builder build.Interface, publish
}
// This simply returns the replaced object, which we discard during the gathering phase.
if _, err := replaceRecursive(obj, func(ref string) (string, error) {
if strict && !strings.HasPrefix(ref, "ko://") {
strictRef := strings.HasPrefix(ref, "ko://")
if strict && !strictRef {
return ref, nil
}
tref := strings.TrimPrefix(ref, "ko://")
if builder.IsSupportedReference(tref) {
refs[tref] = struct{}{}
} else if strict && strings.HasPrefix(ref, "ko://") {
return "", fmt.Errorf("Found strict reference %q but %s is not a valid import path", ref, strings.TrimPrefix(ref, "ko://"))
} else if strict && strictRef {
return "", fmt.Errorf("Found strict reference %q but %s is not a valid import path", ref, tref)
}
return ref, nil
}); err != nil {
Expand Down

0 comments on commit fee3c26

Please sign in to comment.