Skip to content

Commit d59f7af

Browse files
authored
Merge pull request #10 from pusher/ignore-status-patches
Ignore any patch that starts with `/status`
2 parents 1177f4e + 450ea35 commit d59f7af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/quack/quack.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ func (ah *AdmissionHook) createPatch(old []byte, new []byte) ([]byte, error) {
170170
allowedOps := []jsonpatch.JsonPatchOperation{}
171171
for _, op := range patch {
172172
// Don't patch the lastAppliedConfig created by kubectl
173-
if op.Path == lastAppliedConfigPath || strings.HasPrefix(op.Path, quackAnnotationPrefix) || contains(ah.IgnoredPaths, op.Path) {
173+
if op.Path == lastAppliedConfigPath ||
174+
strings.HasPrefix(op.Path, quackAnnotationPrefix) ||
175+
contains(ah.IgnoredPaths, op.Path) ||
176+
strings.HasPrefix(op.Path, "/status") {
174177
continue
175178
}
176179
allowedOps = append(allowedOps, op)

0 commit comments

Comments
 (0)