mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
fix: sort webhookconfig.operations (#10274)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
This commit is contained in:
parent
84e0ced314
commit
e58d7120c6
16 changed files with 56 additions and 52 deletions
|
@ -86,6 +86,10 @@ func (wh *webhook) buildRulesWithOperations(final map[string][]admissionregistra
|
|||
continue
|
||||
}
|
||||
|
||||
slices.SortFunc(operations, func(a, b admissionregistrationv1.OperationType) int {
|
||||
return cmp.Compare(a, b)
|
||||
})
|
||||
|
||||
rules = append(rules, admissionregistrationv1.RuleWithOperations{
|
||||
Rule: admissionregistrationv1.Rule{
|
||||
APIGroups: []string{gv.Group},
|
||||
|
|
|
@ -17,10 +17,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- v1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- pods
|
||||
- pods/ephemeralcontainers
|
||||
|
|
|
@ -11,10 +11,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- '*'
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- '*/scale'
|
||||
scope: '*'
|
||||
|
|
|
@ -12,10 +12,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- '*'
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- '*'
|
||||
- pods/ephemeralcontainers
|
||||
|
|
|
@ -12,10 +12,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- '*'
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- '*/*'
|
||||
scope: '*'
|
||||
|
|
|
@ -11,9 +11,9 @@ webhooks:
|
|||
apiVersions:
|
||||
- v1
|
||||
operations:
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- CONNECT
|
||||
resources:
|
||||
- configmaps
|
||||
scope: Namespaced
|
||||
|
|
|
@ -11,10 +11,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- v1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- pods
|
||||
- pods/ephemeralcontainers
|
||||
|
|
|
@ -11,10 +11,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- v1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- pods/attach
|
||||
- pods/binding
|
||||
|
|
|
@ -12,10 +12,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- v1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- configmaps
|
||||
scope: Namespaced
|
||||
|
@ -24,10 +24,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- v1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- customresourcedefinitions
|
||||
scope: '*'
|
||||
|
|
|
@ -12,10 +12,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- v1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- configmaps
|
||||
scope: Namespaced
|
||||
|
@ -24,10 +24,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- v1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- customresourcedefinitions
|
||||
scope: '*'
|
||||
|
|
|
@ -12,10 +12,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- 'v1'
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- 'configmaps'
|
||||
- 'secrets'
|
||||
|
|
|
@ -12,10 +12,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- 'v1'
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- 'configmaps'
|
||||
scope: 'Namespaced'
|
||||
|
|
|
@ -12,10 +12,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- '*'
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- '*'
|
||||
- pods/ephemeralcontainers
|
||||
|
|
|
@ -12,10 +12,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- v1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- configmaps
|
||||
scope: Namespaced
|
||||
|
@ -24,10 +24,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- v1
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- deployments
|
||||
scope: Namespaced
|
||||
|
|
|
@ -12,10 +12,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- '*'
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- '*'
|
||||
- pods/ephemeralcontainers
|
||||
|
|
|
@ -12,10 +12,10 @@ webhooks:
|
|||
apiVersions:
|
||||
- '*'
|
||||
operations:
|
||||
- CREATE
|
||||
- UPDATE
|
||||
- DELETE
|
||||
- CONNECT
|
||||
- CREATE
|
||||
- DELETE
|
||||
- UPDATE
|
||||
resources:
|
||||
- '*'
|
||||
- pods/ephemeralcontainers
|
||||
|
|
Loading…
Reference in a new issue