Repository: cilium/cilium
Pull request #14388 (2020-12-12 23:50:11)

test: Add missing gomega Eventually intervals
Gomega time interval between Eventually retries is 10ms. Use 1 second
to clean up the test logs like these:

...
15:31:27  23:31:26 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:27  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:27  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:27  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:27  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:27  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:27  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:27  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:28  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:28  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:28  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:28  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:28  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:28  23:31:27 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:28  23:31:28 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
15:31:28  23:31:28 STEP: Cilium DaemonSet not ready yet: only 1 of 2 desired pods are ready
...

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>


jrajahalme: test-me-please

Patch:
diff --git a/pkg/hubble/peer/handler.go b/pkg/hubble/peer/handler.go
index 984206957d..0f80559640 100644
--- a/pkg/hubble/peer/handler.go
+++ b/pkg/hubble/peer/handler.go
@@ -165,7 +165,8 @@ func nodeAddress(n types.Node) string {
 //
 // When nodeName is not provided, an empty string is returned. All Dot (.) in
 // nodeName are replaced by Hyphen (-). When clusterName is not provided, it
-// defaults to the default cluster name.
+// defaults to the default cluster name. All Dot (.) in clusterName are
+// replaced by Hypen (-).
 func tlsServerName(nodeName, clusterName string) string {
 	if nodeName == "" {
 		return ""
@@ -176,9 +177,11 @@ func tlsServerName(nodeName, clusterName string) string {
 	if clusterName == "" {
 		clusterName = ciliumDefaults.ClusterName
 	}
+	// The cluster name may also contain dots.
+	cn := strings.ReplaceAll(clusterName, ".", "-")
 	return strings.Join([]string{
 		nn,
-		clusterName,
+		cn,
 		defaults.GRPCServiceName,
 		defaults.DomainName,
 	}, ".")
diff --git a/pkg/k8s/factory_functions.go b/pkg/k8s/factory_functions.go
index cec9af9d38..c427beb5c7 100644
--- a/pkg/k8s/factory_functions.go
+++ b/pkg/k8s/factory_functions.go
@@ -391,83 +391,6 @@ func ConvertToK8sService(obj interface{}) interface{} {
 	}
 }
 
-// ConvertToCCNPWithStatus converts a *cilium_v2.CiliumClusterwideNetworkPolicy
-// into *types.SlimCNP or a cache.DeletedFinalStateUnknown into
-// a cache.DeletedFinalStateUnknown with a *types.SlimCNP in its Obj.
-// If the given obj can't be cast into either *cilium_v2.CiliumClusterwideNetworkPolicy
-// nor cache.DeletedFinalStateUnknown, the original obj is returned.
-func ConvertToCCNPWithStatus(obj interface{}) interface{} {
-	switch concreteObj := obj.(type) {
-	case *cilium_v2.CiliumClusterwideNetworkPolicy:
-		t := &types.SlimCNP{
-			CiliumNetworkPolicy: concreteObj.CiliumNetworkPolicy,
-		}
-		// Need to explicitly copy all the fields even though CNP is embedded
-		// inside CCNP. See comment inside CCNP type definition. This is
-		// required for Kubernetes versions < 1.13 because this conversion
-		// function is only used with Kubernetes < 1.13 due to missing Patch
-		// capability in those versions. See
-		// operator/ccnp_event.go:enableCCNPWatcher().
-		t.TypeMeta = concreteObj.TypeMeta
-		t.ObjectMeta = concreteObj.ObjectMeta
-		t.Status = concreteObj.Status
-		return t
-
-	case cache.DeletedFinalStateUnknown:
-		cnp, ok := concreteObj.Obj.(*cilium_v2.CiliumClusterwideNetworkPolicy)
-		if !ok {
-			return obj
-		}
-		t := &types.SlimCNP{
-			CiliumNetworkPolicy: cnp.CiliumNetworkPolicy,
-		}
-		// Need to explicitly copy all the fields even though CNP is embedded
-		// inside CCNP. See comment inside CCNP type definition. This is
-		// required for Kubernetes versions < 1.13 because this conversion
-		// function is only used with Kubernetes < 1.13 due to missing Patch
-		// capability in those versions. See
-		// operator/ccnp_event.go:enableCCNPWatcher().
-		t.TypeMeta = cnp.TypeMeta
-		t.ObjectMeta = cnp.ObjectMeta
-		t.Status = cnp.Status
-		return cache.DeletedFinalStateUnknown{
-			Key: concreteObj.Key,
-			Obj: t,
-		}
-
-	default:
-		return obj
-	}
-}
-
-// ConvertToCNPWithStatus converts a *cilium_v2.CiliumNetworkPolicy or a
-// *cilium_v2.CiliumClusterwideNetworkPolicy into a
-// *types.SlimCNP or a cache.DeletedFinalStateUnknown into
-// a cache.DeletedFinalStateUnknown with a *types.SlimCNP in its Obj.
-// If the given obj can't be cast into either *cilium_v2.CiliumNetworkPolicy
-// nor cache.DeletedFinalStateUnknown, the original obj is returned.
-func ConvertToCNPWithStatus(obj interface{}) interface{} {
-	switch concreteObj := obj.(type) {
-	case *cilium_v2.CiliumNetworkPolicy:
-		return &types.SlimCNP{
-			CiliumNetworkPolicy: concreteObj,
-		}
-	case cache.DeletedFinalStateUnknown:
-		cnp, ok := concreteObj.Obj.(*cilium_v2.CiliumNetworkPolicy)
-		if !ok {
-			return obj
-		}
-		return cache.DeletedFinalStateUnknown{
-			Key: concreteObj.Key,
-			Obj: &types.SlimCNP{
-				CiliumNetworkPolicy: cnp,
-			},
-		}
-	default:
-		return obj
-	}
-}
-
 // ConvertToCCNP converts a *cilium_v2.CiliumClusterwideNetworkPolicy into a
 // *types.SlimCNP without the Status field of the given CNP, or a
 // cache.DeletedFinalStateUnknown into a cache.DeletedFinalStateUnknown with a
@@ -483,10 +406,12 @@ func ConvertToCCNP(obj interface{}) interface{} {
 			CiliumNetworkPolicy: &cilium_v2.CiliumNetworkPolicy{
 				TypeMeta:   concreteObj.TypeMeta,
 				ObjectMeta: concreteObj.ObjectMeta,
-				Spec:       concreteObj.Spec,
-				Specs:      concreteObj.Specs,
 			},
 		}
+		if concreteObj.CiliumNetworkPolicy != nil {
+			cnp.Spec = concreteObj.Spec
+			cnp.Specs = concreteObj.Specs
+		}
 		*concreteObj = cilium_v2.CiliumClusterwideNetworkPolicy{}
 		return cnp
 
@@ -495,16 +420,19 @@ func ConvertToCCNP(obj interface{}) interface{} {
 		if !ok {
 			return obj
 		}
+		slimCNP := &types.SlimCNP{
+			CiliumNetworkPolicy: &cilium_v2.CiliumNetworkPolicy{
+				TypeMeta:   cnp.TypeMeta,
+				ObjectMeta: cnp.ObjectMeta,
+			},
+		}
+		if cnp.CiliumNetworkPolicy != nil {
+			slimCNP.Spec = cnp.Spec
+			slimCNP.Specs = cnp.Specs
+		}
 		dfsu := cache.DeletedFinalStateUnknown{
 			Key: concreteObj.Key,
-			Obj: &types.SlimCNP{
-				CiliumNetworkPolicy: &cilium_v2.CiliumNetworkPolicy{
-					TypeMeta:   cnp.TypeMeta,
-					ObjectMeta: cnp.ObjectMeta,
-					Spec:       cnp.Spec,
-					Specs:      cnp.Specs,
-				},
-			},
+			Obj: slimCNP,
 		}
 		*cnp = cilium_v2.CiliumClusterwideNetworkPolicy{}
 		return dfsu
diff --git a/pkg/policy/mapstate.go b/pkg/policy/mapstate.go
index 88f6550b2a..063272607b 100644
--- a/pkg/policy/mapstate.go
+++ b/pkg/policy/mapstate.go
@@ -174,10 +174,6 @@ func (keys MapState) addKeyWithChanges(key Key, entry MapStateEntry, adds, delet
 	} else if len(entry.selectors) > 0 {
 		// create a new selectors map
 		updatedEntry.selectors = make(map[CachedSelector]struct{}, len(entry.selectors))
-	} else {
-		// Keep the map as nil when empty. This makes a difference for unit testing only.
-		// MergeSelectors below becomes a no-op as 'entry' is empty.
-		updatedEntry.selectors = nil
 	}
 
 	// TODO: Do we need to merge labels as well?
@@ -188,8 +184,7 @@ func (keys MapState) addKeyWithChanges(key Key, entry MapStateEntry, adds, delet
 
 	// Record an incremental Add if desired and entry is new or changed
 	if adds != nil && (!exists || !oldEntry.DatapathEqual(&entry)) {
-		updatedEntry.selectors = nil
-		adds[key] = updatedEntry // copy w/o selectors
+		adds[key] = updatedEntry
 		// Key add overrides any previous delete of the same key
 		if deletes != nil {
 			delete(deletes, key)
@@ -210,11 +205,13 @@ func (keys MapState) deleteKeyWithChanges(key Key, cs CachedSelector, adds, dele
 				if len(entry.selectors) > 0 {
 					return
 				}
+			} else {
+				// 'cs' was not found, do not change anything
+				return
 			}
 		}
 		if deletes != nil {
-			entry.selectors = nil
-			deletes[key] = entry // copy w/o selectors
+			deletes[key] = entry
 			// Remove a potential previously added key
 			if adds != nil {
 				delete(adds, key)
@@ -333,8 +330,7 @@ func (keys MapState) RedirectPreferredInsert(key Key, entry MapStateEntry, adds,
 		// insertion to the bpf map.
 		// TODO: Remove this hack when not needed any more.
 		if adds != nil && entry.IsRedirectEntry() && oldEntry.IsRedirectEntry() {
-			entry.selectors = nil
-			adds[key] = entry // copy w/o selectors
+			adds[key] = entry
 		}
 		return
 	}


Test patch:
diff --git a/pkg/hubble/peer/handler_test.go b/pkg/hubble/peer/handler_test.go
index 4ec653ed45..cdb5f56195 100644
--- a/pkg/hubble/peer/handler_test.go
+++ b/pkg/hubble/peer/handler_test.go
@@ -135,6 +135,20 @@ func TestNodeAdd(t *testing.T) {
 					ServerName: "my-very-long-node-name.cluster.hubble-grpc.cilium.io",
 				},
 			},
+		}, {
+			name: "node name with dots in the cluster name section",
+			arg: types.Node{
+				Name:    "my.very.long.node.name",
+				Cluster: "cluster.name.with.dots",
+			},
+			want: &peerpb.ChangeNotification{
+				Name:    "cluster.name.with.dots/my.very.long.node.name",
+				Address: "",
+				Type:    peerpb.ChangeNotificationType_PEER_ADDED,
+				Tls: &peerpb.TLS{
+					ServerName: "my-very-long-node-name.cluster-name-with-dots.hubble-grpc.cilium.io",
+				},
+			},
 		},
 	}
 	for _, tt := range tests {
diff --git a/pkg/k8s/factory_functions_test.go b/pkg/k8s/factory_functions_test.go
index ccb13a8b2a..4c51c7c537 100644
--- a/pkg/k8s/factory_functions_test.go
+++ b/pkg/k8s/factory_functions_test.go
@@ -969,7 +969,7 @@ func (s *K8sSuite) Test_ConvertToK8sService(c *C) {
 	}
 }
 
-func (s *K8sSuite) Test_ConvertToCNPWithStatus(c *C) {
+func (s *K8sSuite) Test_ConvertToCNP(c *C) {
 	type args struct {
 		obj interface{}
 	}
@@ -1024,12 +1024,12 @@ func (s *K8sSuite) Test_ConvertToCNPWithStatus(c *C) {
 		},
 	}
 	for _, tt := range tests {
-		got := ConvertToCNPWithStatus(tt.args.obj)
+		got := ConvertToCNP(tt.args.obj)
 		c.Assert(got, checker.DeepEquals, tt.want, Commentf("Test Name: %s", tt.name))
 	}
 }
 
-func (s *K8sSuite) Test_ConvertToCCNPWithStatus(c *C) {
+func (s *K8sSuite) Test_ConvertToCCNP(c *C) {
 	type args struct {
 		obj interface{}
 	}
@@ -1050,124 +1050,9 @@ func (s *K8sSuite) Test_ConvertToCCNPWithStatus(c *C) {
 			},
 		},
 		{
-			name: "delete final state unknown conversion",
-			args: args{
-				obj: cache.DeletedFinalStateUnknown{
-					Key: "foo",
-					Obj: &v2.CiliumClusterwideNetworkPolicy{
-						CiliumNetworkPolicy: &v2.CiliumNetworkPolicy{},
-					},
-				},
-			},
-			want: cache.DeletedFinalStateUnknown{
-				Key: "foo",
-				Obj: &types.SlimCNP{
-					CiliumNetworkPolicy: &v2.CiliumNetworkPolicy{},
-				},
-			},
-		},
-		{
-			name: "unknown object type in delete final state unknown conversion",
-			args: args{
-				obj: cache.DeletedFinalStateUnknown{
-					Key: "foo",
-					Obj: 100,
-				},
-			},
-			want: cache.DeletedFinalStateUnknown{
-				Key: "foo",
-				Obj: 100,
-			},
-		},
-		{
-			name: "unknown object type in conversion",
-			args: args{
-				obj: 100,
-			},
-			want: 100,
-		},
-	}
-	for _, tt := range tests {
-		got := ConvertToCCNPWithStatus(tt.args.obj)
-		c.Assert(got, checker.DeepEquals, tt.want, Commentf("Test Name: %s", tt.name))
-	}
-}
-
-func (s *K8sSuite) Test_ConvertToCNP(c *C) {
-	type args struct {
-		obj interface{}
-	}
-	tests := []struct {
-		name string
-		args args
-		want interface{}
-	}{
-		{
-			name: "normal conversion",
+			name: "A CCNP where it doesn't contain neither a spec nor specs",
 			args: args{
-				obj: &v2.CiliumNetworkPolicy{},
-			},
-			want: &types.SlimCNP{
-				CiliumNetworkPolicy: &v2.CiliumNetworkPolicy{},
-			},
-		},
-		{
-			name: "delete final state unknown conversion",
-			args: args{
-				obj: cache.DeletedFinalStateUnknown{
-					Key: "foo",
-					Obj: &v2.CiliumNetworkPolicy{},
-				},
-			},
-			want: cache.DeletedFinalStateUnknown{
-				Key: "foo",
-				Obj: &types.SlimCNP{
-					CiliumNetworkPolicy: &v2.CiliumNetworkPolicy{},
-				},
-			},
-		},
-		{
-			name: "unknown object type in delete final state unknown conversion",
-			args: args{
-				obj: cache.DeletedFinalStateUnknown{
-					Key: "foo",
-					Obj: 100,
-				},
-			},
-			want: cache.DeletedFinalStateUnknown{
-				Key: "foo",
-				Obj: 100,
-			},
-		},
-		{
-			name: "unknown object type in conversion",
-			args: args{
-				obj: 100,
-			},
-			want: 100,
-		},
-	}
-	for _, tt := range tests {
-		got := ConvertToCNP(tt.args.obj)
-		c.Assert(got, checker.DeepEquals, tt.want, Commentf("Test Name: %s", tt.name))
-	}
-}
-
-func (s *K8sSuite) Test_ConvertToCCNP(c *C) {
-	type args struct {
-		obj interface{}
-	}
-	tests := []struct {
-		name string
-		args args
-		want interface{}
-	}{
-		{
-			name: "normal conversion",
-			args: args{
-				obj: &v2.CiliumClusterwideNetworkPolicy{
-					CiliumNetworkPolicy: &v2.CiliumNetworkPolicy{},
-				},
+				obj: &v2.CiliumClusterwideNetworkPolicy{},
 			},
 			want: &types.SlimCNP{
 				CiliumNetworkPolicy: &v2.CiliumNetworkPolicy{},
diff --git a/pkg/policy/distillery_test.go b/pkg/policy/distillery_test.go
index ade82d7ec3..a364b0f774 100644
--- a/pkg/policy/distillery_test.go
+++ b/pkg/policy/distillery_test.go
@@ -425,7 +425,7 @@ func (d *policyDistillery) distillPolicy(owner PolicyOwner, epLabels labels.Labe
 // cache at the time when the expectations are created.
 func (m MapState) clearCachedSelectors() {
 	for k, v := range m {
-		v.selectors = nil
+		v.selectors = make(map[CachedSelector]struct{})
 		m[k] = v
 	}
 }
diff --git a/pkg/policy/mapstate_test.go b/pkg/policy/mapstate_test.go
index 50691b69f4..515c14ea6a 100644
--- a/pkg/policy/mapstate_test.go
+++ b/pkg/policy/mapstate_test.go
@@ -27,13 +27,9 @@ import (
 // No selectors is represented with a 'nil' map.
 func (e MapStateEntry) WithSelectors(selectors ...CachedSelector) MapStateEntry {
 	mse := e
-	if len(selectors) > 0 {
-		mse.selectors = make(map[CachedSelector]struct{}, len(selectors))
-		for _, cs := range selectors {
-			mse.selectors[cs] = struct{}{}
-		}
-	} else {
-		mse.selectors = nil
+	mse.selectors = make(map[CachedSelector]struct{}, len(selectors))
+	for _, cs := range selectors {
+		mse.selectors[cs] = struct{}{}
 	}
 	return mse
 }
@@ -776,11 +772,9 @@ func (ds *PolicyTestSuite) TestMapState_AccumulateMapChanges(c *check.C) {
 			ProxyPort: proxyPort,
 			IsDeny:    deny,
 		}
-		if len(selectors) > 0 {
-			entry.selectors = make(map[CachedSelector]struct{}, len(selectors))
-			for _, cs := range selectors {
-				entry.selectors[cs] = struct{}{}
-			}
+		entry.selectors = make(map[CachedSelector]struct{}, len(selectors))
+		for _, cs := range selectors {
+			entry.selectors[cs] = struct{}{}
 		}
 		return entry
 	}
@@ -811,7 +805,7 @@ func (ds *PolicyTestSuite) TestMapState_AccumulateMapChanges(c *check.C) {
 			HttpIngressKey(42): TestEntry(0, false, csFoo),
 		},
 		adds: MapState{
-			HttpIngressKey(42): TestEntry(0, false),
+			HttpIngressKey(42): TestEntry(0, false, csFoo),
 		},
 		deletes: MapState{},
 	}, {
@@ -835,8 +829,8 @@ func (ds *PolicyTestSuite) TestMapState_AccumulateMapChanges(c *check.C) {
 			HttpIngressKey(43): TestEntry(0, false, csFoo),
 		},
 		adds: MapState{
-			HttpIngressKey(42): TestEntry(0, false),
-			HttpIngressKey(43): TestEntry(0, false),
+			HttpIngressKey(42): TestEntry(0, false, csFoo),
+			HttpIngressKey(43): TestEntry(0, false, csFoo),
 		},
 		deletes: MapState{},
 	}, {
@@ -851,7 +845,7 @@ func (ds *PolicyTestSuite) TestMapState_AccumulateMapChanges(c *check.C) {
 			HttpIngressKey(44): TestEntry(0, false, csBar),
 		},
 		adds: MapState{
-			HttpIngressKey(44): TestEntry(0, false),
+			HttpIngressKey(44): TestEntry(0, false, csBar),
 		},
 		deletes: MapState{},
 	}, {
@@ -869,10 +863,23 @@ func (ds *PolicyTestSuite) TestMapState_AccumulateMapChanges(c *check.C) {
 		deletes: MapState{},
 	}, {
 		continued: true,
-		name:      "test-6 - Deleting 42 from Bar, deleted",
+		name:      "test-5b - Deleting 42 from Foo again, not deleted",
 		args: []args{
 			{cs: csFoo, adds: []int{}, deletes: []int{42}, port: 80, proto: 6, ingress: true, redirect: false, deny: false},
 		},
+		state: MapState{
+			HttpIngressKey(42): TestEntry(0, false, csBar),
+			HttpIngressKey(43): TestEntry(0, false, csFoo),
+			HttpIngressKey(44): TestEntry(0, false, csBar),
+		},
+		adds:    MapState{},
+		deletes: MapState{},
+	}, {
+		continued: true,
+		name:      "test-6 - Deleting 42 from Bar, deleted",
+		args: []args{
+			{cs: csBar, adds: []int{}, deletes: []int{42}, port: 80, proto: 6, ingress: true, redirect: false, deny: false},
+		},
 		state: MapState{
 			HttpIngressKey(43): TestEntry(0, false, csFoo),
 			HttpIngressKey(44): TestEntry(0, false, csBar),
@@ -909,10 +916,10 @@ func (ds *PolicyTestSuite) TestMapState_AccumulateMapChanges(c *check.C) {
 			DNSTCPEgressKey(42): TestEntry(0, false, csBar),
 		},
 		adds: MapState{
-			AnyIngressKey():     TestEntry(0, false),
-			HostIngressKey():    TestEntry(0, false),
-			DNSUDPEgressKey(42): TestEntry(0, false),
-			DNSTCPEgressKey(42): TestEntry(0, false),
+			AnyIngressKey():     TestEntry(0, false, nil),
+			HostIngressKey():    TestEntry(0, false, nil),
+			DNSUDPEgressKey(42): TestEntry(0, false, csBar),
+			DNSTCPEgressKey(42): TestEntry(0, false, csBar),
 		},
 		deletes: MapState{},
 	}, {
@@ -929,7 +936,7 @@ func (ds *PolicyTestSuite) TestMapState_AccumulateMapChanges(c *check.C) {
 			HttpEgressKey(43):   TestEntry(1, false, csFoo),
 		},
 		adds: MapState{
-			HttpEgressKey(43): TestEntry(1, false),
+			HttpEgressKey(43): TestEntry(1, false, csFoo),
 		},
 		deletes: MapState{},
 	}, {
diff --git a/pkg/policy/resolve_deny_test.go b/pkg/policy/resolve_deny_test.go
index db8c6dde7f..1db359158a 100644
--- a/pkg/policy/resolve_deny_test.go
+++ b/pkg/policy/resolve_deny_test.go
@@ -490,8 +490,8 @@ func (ds *PolicyTestSuite) TestMapStateWithIngressDeny(c *C) {
 	// maps on the policy got cleared
 
 	c.Assert(adds, checker.Equals, MapState{
-		{Identity: 192, DestPort: 80, Nexthdr: 6}: rule1MapStateEntry.WithoutSelectors(),
-		{Identity: 194, DestPort: 80, Nexthdr: 6}: rule1MapStateEntry.WithoutSelectors(),
+		{Identity: 192, DestPort: 80, Nexthdr: 6}: rule1MapStateEntry,
+		{Identity: 194, DestPort: 80, Nexthdr: 6}: rule1MapStateEntry,
 	})
 	c.Assert(deletes, checker.Equals, MapState{
 		{Identity: 193, DestPort: 80, Nexthdr: 6}: rule1MapStateEntry.WithoutSelectors(),
diff --git a/pkg/policy/resolve_test.go b/pkg/policy/resolve_test.go
index 27b1590f40..6d2c944365 100644
--- a/pkg/policy/resolve_test.go
+++ b/pkg/policy/resolve_test.go
@@ -664,8 +664,8 @@ func (ds *PolicyTestSuite) TestMapStateWithIngress(c *C) {
 	c.Assert(policy.policyMapChanges.changes, IsNil)
 
 	c.Assert(adds, checker.Equals, MapState{
-		{Identity: 192, DestPort: 80, Nexthdr: 6}: rule1MapStateEntry.WithoutSelectors(),
-		{Identity: 194, DestPort: 80, Nexthdr: 6}: rule1MapStateEntry.WithoutSelectors(),
+		{Identity: 192, DestPort: 80, Nexthdr: 6}: rule1MapStateEntry,
+		{Identity: 194, DestPort: 80, Nexthdr: 6}: rule1MapStateEntry,
 	})
 	c.Assert(deletes, checker.Equals, MapState{
 		{Identity: 193, DestPort: 80, Nexthdr: 6}: rule1MapStateEntry.WithoutSelectors(),
diff --git a/test/helpers/kubectl.go b/test/helpers/kubectl.go
index 77c96c5c42..b60c436bec 100644
--- a/test/helpers/kubectl.go
+++ b/test/helpers/kubectl.go
@@ -436,7 +436,7 @@ func (kub *Kubectl) WaitForCiliumReadiness(offset int, errMsg string) {
 			ginkgoext.By("Number of ready Cilium pods: %d", numPods)
 		}
 		return err
-	}, 4*time.Minute).Should(gomega.BeNil(), errMsg)
+	}, 4*time.Minute, time.Second).Should(gomega.BeNil(), errMsg)
 }
 
 // DeleteResourceInAnyNamespace deletes all objects with the provided name of
diff --git a/test/k8sT/DatapathConfiguration.go b/test/k8sT/DatapathConfiguration.go
index 33a60757cf..ac061dd115 100644
--- a/test/k8sT/DatapathConfiguration.go
+++ b/test/k8sT/DatapathConfiguration.go
@@ -113,14 +113,14 @@ var _ = Describe("K8sDatapathConfig", func() {
 			expEgressRegex := regexp.MustCompile(expEgress)
 			Eventually(func() bool {
 				return searchMonitorLog(expEgressRegex)
-			}, helpers.HelperTimeout).Should(BeTrue(), "Egress ICMPv4 flow (%q) not found in monitor log\n%s", expEgress, monitorOutput)
+			}, helpers.HelperTimeout, time.Second).Should(BeTrue(), "Egress ICMPv4 flow (%q) not found in monitor log\n%s", expEgress, monitorOutput)
 
 			By("Checking that ICMP notifications in ingress direction were observed")
 			expIngress := fmt.Sprintf("ICMPv4.*SrcIP=%s", targetIP)
 			expIngressRegex := regexp.MustCompile(expIngress)
 			Eventually(func() bool {
 				return searchMonitorLog(expIngressRegex)
-			}, helpers.HelperTimeout).Should(BeTrue(), "Ingress ICMPv4 flow (%q) not found in monitor log\n%s", expIngress, monitorOutput)
+			}, helpers.HelperTimeout, time.Second).Should(BeTrue(), "Ingress ICMPv4 flow (%q) not found in monitor log\n%s", expIngress, monitorOutput)
 
 			By("Checking the set of TCP notifications received matches expectations")
 			// | TCP Flags | Direction | Report? | Why?
@@ -138,7 +138,7 @@ var _ = Describe("K8sDatapathConfig", func() {
 			Eventually(func() bool {
 				monitorOutput = monitorRes.CombineOutput().Bytes()
 				return checkMonitorOutput(monitorOutput, egressPktCount, ingressPktCount)
-			}, helpers.HelperTimeout).Should(BeTrue(), "Monitor log did not contain %d ingress and %d egress TCP notifications\n%s",
+			}, helpers.HelperTimeout, time.Second).Should(BeTrue(), "Monitor log did not contain %d ingress and %d egress TCP notifications\n%s",
 				ingressPktCount, egressPktCount, monitorOutput)
 
 			helpers.WriteToReportFile(monitorOutput, monitorLog)
@@ -172,7 +172,7 @@ var _ = Describe("K8sDatapathConfig", func() {
 			Eventually(func() bool {
 				monitorOutput = monitorRes.CombineOutput().Bytes()
 				return checkMonitorOutput(monitorOutput, egressPktCount, ingressPktCount)
-			}, helpers.HelperTimeout).Should(BeTrue(), "monitor aggregation did not result in correct number of TCP notifications\n%s", monitorOutput)
+			}, helpers.HelperTimeout, time.Second).Should(BeTrue(), "monitor aggregation did not result in correct number of TCP notifications\n%s", monitorOutput)
 			helpers.WriteToReportFile(monitorOutput, monitorLog)
 		})
 	})
diff --git a/test/k8sT/Identity.go b/test/k8sT/Identity.go
index ac84450692..1cf2f31c99 100644
--- a/test/k8sT/Identity.go
+++ b/test/k8sT/Identity.go
@@ -69,7 +69,7 @@ var _ = Describe("K8sIdentity", func() {
 			By("Waiting for CiliumIdentity to be garbage collected")
 			Eventually(func() bool {
 				return !kubectl.ExecShort(helpers.KubectlCmd + " get ciliumidentity 99999").WasSuccessful()
-			}, 2*time.Minute).Should(BeTrue(), "CiliumIdentity did not get garbage collected before timeout")
+			}, 2*time.Minute, time.Second).Should(BeTrue(), "CiliumIdentity did not get garbage collected before timeout")
 		})
 	})
 })
diff --git a/test/k8sT/Services.go b/test/k8sT/Services.go
index c40e1a9cd1..f7dac71de4 100644
--- a/test/k8sT/Services.go
+++ b/test/k8sT/Services.go
@@ -385,7 +385,7 @@ var _ = Describe("K8sServicesTest", func() {
 			res := kubectl.Exec(fmt.Sprintf("kubectl label services/%s %s=%s", echoServiceName, serviceProxyLabelName, "dummy-lb"))
 			res.ExpectSuccess("cannot label service")
 
-			// Wait for all cilium pods to remove the serivce from its list.
+			// Wait for all cilium pods to remove the service from its list.
 			By("Validating that Cilium is not handling the service")
 			Eventually(func() int {
 				validPods := 0
diff --git a/test/k8sT/Updates.go b/test/k8sT/Updates.go
index 5f606a0e9a..f0f95ebf50 100644
--- a/test/k8sT/Updates.go
+++ b/test/k8sT/Updates.go
@@ -21,6 +21,7 @@ import (
 	"strings"
 	"time"
 
+	"github.com/cilium/cilium/pkg/versioncheck"
 	. "github.com/cilium/cilium/test/ginkgo-ext"
 	"github.com/cilium/cilium/test/helpers"
 
@@ -433,12 +434,17 @@ func InstallAndValidateCiliumUpgrades(kubectl *helpers.Kubectl, oldHelmChartVers
 
 		opts = map[string]string{
 			"preflight.enabled":   "true ",
-			"agent.enabled":       "false ",
 			"config.enabled":      "false ",
 			"operator.enabled":    "false ",
 			"preflight.image.tag": newImageVersion,
 			"nodeinit.enabled":    "false",
 		}
+		hasNewHelmValues := versioncheck.MustCompile(">=1.8.90")
+		if hasNewHelmValues(versioncheck.MustVersion(newHelmChartVersion)) {
+			opts["agent"] = "false "
+		} else {
+			opts["agent.enabled"] = "false "
+		}
 		if helpers.RunsWithoutKubeProxy() || helpers.RunsOn419Kernel() {
 			switch oldHelmChartVersion {
 			case "1.5-dev", "1.6-dev", "1.7-dev":
diff --git a/test/k8sT/hubble.go b/test/k8sT/hubble.go
index 7027791a85..a143125447 100644
--- a/test/k8sT/hubble.go
+++ b/test/k8sT/hubble.go
@@ -109,7 +109,7 @@ var _ = Describe("K8sHubbleTest", func() {
 				return false
 			}
 
-			Eventually(hubbleObserve, timeout).Should(BeTrue(),
+			Eventually(hubbleObserve, timeout, time.Second).Should(BeTrue(),
 				"hubble observe: filter %q never matched expected string %q", filter, expected)
 		}