Skip to content

Commit

Permalink
Panic when using delete verb
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
  • Loading branch information
pierDipi committed Dec 3, 2021
1 parent 7628c02 commit fd777cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions webhook/resourcesemantics/defaulting/defaulting.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ func NewCallback(function func(context.Context, *unstructured.Unstructured) erro
}
m := make(map[webhook.Operation]struct{})
for _, op := range supportedVerbs {
if op == webhook.Delete {
panic("Verb " + webhook.Delete + " not allowed")
}
if _, has := m[op]; has {
panic("duplicate verbs not allowed")
}
Expand Down

0 comments on commit fd777cc

Please sign in to comment.