Skip to content

Commit 3619625

Browse files
committed
Replace strings.TrimRight with strings.TrimSuffix
TrimRight was not correctly used. It takes a set of characters as the second argument and any chars matching the set on the right side of the string would be trimmed. TrimSuffix does exactly what I originally intended. Signed-off-by: Aurel Canciu <[email protected]>
1 parent ae455c9 commit 3619625

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/update/setters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func UpdateWithSetters(tracelog logr.Logger, inpath, outpath string, policies []
160160
// annoyingly, neither the library imported above, nor an
161161
// alternative I found, will yield the original image name;
162162
// this is an easy way to get it
163-
name := strings.TrimRight(image, ":"+tag)
163+
name := strings.TrimSuffix(image, ":"+tag)
164164

165165
imageSetter := fmt.Sprintf("%s:%s", policy.GetNamespace(), policy.GetName())
166166
tracelog.Info("adding setter", "name", imageSetter)

0 commit comments

Comments
 (0)