Skip to content

Commit 56f1d91

Browse files
authored
ignore difference in the order of namesapceList (#382)
* ignore difference in the order of namesapceList Signed-off-by: Allen Li <[email protected]> * typo Signed-off-by: Allen Li <[email protected]> * increasing waiting time Signed-off-by: Allen Li <[email protected]> --------- Signed-off-by: Allen Li <[email protected]>
1 parent 5cf2341 commit 56f1d91

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

common/scripts/lint_go.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# limitations under the License.
1616
#
1717

18-
GOGC=25 golangci-lint run -c ./common/config/.golangci.yml --timeout=180s
18+
GOGC=25 golangci-lint run -c ./common/config/.golangci.yml --timeout=480s

controllers/namespacescope_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ func (r *NamespaceScopeReconciler) patchMutatingWebhook(ctx context.Context, web
12661266
if webhook.NamespaceSelector.MatchExpressions != nil {
12671267
if webhook.NamespaceSelector.MatchExpressions[0].Values != nil {
12681268
namespaces := webhook.NamespaceSelector.MatchExpressions[0].Values
1269-
if reflect.DeepEqual(namespaces, nsList) {
1269+
if !util.CheckListDifference(namespaces, nsList) {
12701270
klog.V(2).Infof("Namespace selector has been patched, skip patching webhook")
12711271
skipPatch = true
12721272
}
@@ -1305,7 +1305,7 @@ func (r *NamespaceScopeReconciler) patchValidatingWebhook(ctx context.Context, w
13051305
if webhook.NamespaceSelector.MatchExpressions != nil {
13061306
if webhook.NamespaceSelector.MatchExpressions[0].Values != nil {
13071307
namespaces := webhook.NamespaceSelector.MatchExpressions[0].Values
1308-
if reflect.DeepEqual(namespaces, nsList) {
1308+
if !util.CheckListDifference(namespaces, nsList) {
13091309
klog.V(2).Infof("Namespace selector has been patched, skip patching webhook")
13101310
skipPatch = true
13111311
}

0 commit comments

Comments
 (0)