Skip to content

Commit 4d64411

Browse files
committed
Escape annotation separately
1 parent 795499e commit 4d64411

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/quack/quack.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ func getTemplateInput(data []byte) ([]byte, error) {
193193
for annotation := range objectMeta.Annotations {
194194
if strings.HasPrefix(annotation, "quack.pusher.com") {
195195
// Remove annotations from input template
196+
escapedAnnotation := strings.Replace(annotation, "/", "~1", -1)
196197
patch := []byte(fmt.Sprintf(`[
197198
{"op": "remove", "path": "/metadata/annotations/%s"}
198-
]`, strings.Replace(annotation, "/", "~1", -1)))
199+
]`, escapedAnnotation))
199200
patchedData, err = applyPatch(data, patch)
200201
if err != nil {
201202
return nil, fmt.Errorf("error removing annotation %s: %v", annotation, err)

0 commit comments

Comments
 (0)