1
0
Fork 0
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:
shuting 2024-05-21 21:22:08 +08:00 committed by GitHub
parent 84e0ced314
commit e58d7120c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 56 additions and 52 deletions

View file

@ -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},

View file

@ -17,10 +17,10 @@ webhooks:
apiVersions:
- v1
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- pods
- pods/ephemeralcontainers

View file

@ -11,10 +11,10 @@ webhooks:
apiVersions:
- '*'
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- '*/scale'
scope: '*'

View file

@ -12,10 +12,10 @@ webhooks:
apiVersions:
- '*'
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- '*'
- pods/ephemeralcontainers

View file

@ -12,10 +12,10 @@ webhooks:
apiVersions:
- '*'
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- '*/*'
scope: '*'

View file

@ -11,9 +11,9 @@ webhooks:
apiVersions:
- v1
operations:
- CONNECT
- CREATE
- UPDATE
- CONNECT
resources:
- configmaps
scope: Namespaced

View file

@ -11,10 +11,10 @@ webhooks:
apiVersions:
- v1
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- pods
- pods/ephemeralcontainers

View file

@ -11,10 +11,10 @@ webhooks:
apiVersions:
- v1
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- pods/attach
- pods/binding

View file

@ -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: '*'

View file

@ -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: '*'

View file

@ -12,10 +12,10 @@ webhooks:
apiVersions:
- 'v1'
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- 'configmaps'
- 'secrets'

View file

@ -12,10 +12,10 @@ webhooks:
apiVersions:
- 'v1'
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- 'configmaps'
scope: 'Namespaced'

View file

@ -12,10 +12,10 @@ webhooks:
apiVersions:
- '*'
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- '*'
- pods/ephemeralcontainers

View file

@ -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

View file

@ -12,10 +12,10 @@ webhooks:
apiVersions:
- '*'
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- '*'
- pods/ephemeralcontainers

View file

@ -12,10 +12,10 @@ webhooks:
apiVersions:
- '*'
operations:
- CREATE
- UPDATE
- DELETE
- CONNECT
- CREATE
- DELETE
- UPDATE
resources:
- '*'
- pods/ephemeralcontainers