File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import (
2323 "net/http"
2424 "net/url"
2525 "path"
26+ "sort"
2627 "strconv"
2728
2829 "k8s.io/api/admissionregistration/v1beta1"
@@ -237,6 +238,10 @@ func (s *Server) mutatingWHConfigs() (runtime.Object, error) {
237238 mutatingWebhooks = append (mutatingWebhooks , * wh )
238239 }
239240
241+ sort .Slice (mutatingWebhooks , func (i , j int ) bool {
242+ return mutatingWebhooks [i ].Name < mutatingWebhooks [j ].Name
243+ })
244+
240245 if len (mutatingWebhooks ) > 0 {
241246 return & admissionregistration.MutatingWebhookConfiguration {
242247 TypeMeta : metav1.TypeMeta {
@@ -268,6 +273,10 @@ func (s *Server) validatingWHConfigs() (runtime.Object, error) {
268273 validatingWebhooks = append (validatingWebhooks , * wh )
269274 }
270275
276+ sort .Slice (validatingWebhooks , func (i , j int ) bool {
277+ return validatingWebhooks [i ].Name < validatingWebhooks [j ].Name
278+ })
279+
271280 if len (validatingWebhooks ) > 0 {
272281 return & admissionregistration.ValidatingWebhookConfiguration {
273282 TypeMeta : metav1.TypeMeta {
You can’t perform that action at this time.
0 commit comments