Skip to content

Commit

Permalink
keep only pod-selector for egress rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rurkss committed Feb 8, 2024
1 parent 0c2091e commit e68beb6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
7 changes: 0 additions & 7 deletions operator/redisfailover/service/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,13 +511,6 @@ func generateSentinelNetworkPolicy(rf *redisfailoverv1.RedisFailover, labels map
Egress: []np.NetworkPolicyEgressRule{
np.NetworkPolicyEgressRule{
To: []np.NetworkPolicyPeer{
np.NetworkPolicyPeer{
NamespaceSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app.kubernetes.io/instance": namespace,
},
},
},
np.NetworkPolicyPeer{
PodSelector: &metav1.LabelSelector{
MatchLabels: redisfailoverLabels,
Expand Down
21 changes: 0 additions & 21 deletions operator/redisfailover/service/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1481,13 +1481,6 @@ func TestSentinelNetworkPolicy(t *testing.T) {
Egress: []networkingv1.NetworkPolicyEgressRule{
networkingv1.NetworkPolicyEgressRule{
To: []networkingv1.NetworkPolicyPeer{
networkingv1.NetworkPolicyPeer{
NamespaceSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app.kubernetes.io/instance": namespace,
},
},
},
networkingv1.NetworkPolicyPeer{
PodSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
Expand Down Expand Up @@ -1557,13 +1550,6 @@ func TestSentinelNetworkPolicy(t *testing.T) {
Egress: []networkingv1.NetworkPolicyEgressRule{
networkingv1.NetworkPolicyEgressRule{
To: []networkingv1.NetworkPolicyPeer{
networkingv1.NetworkPolicyPeer{
NamespaceSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app.kubernetes.io/instance": namespace,
},
},
},
networkingv1.NetworkPolicyPeer{
PodSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
Expand Down Expand Up @@ -1643,13 +1629,6 @@ func TestSentinelNetworkPolicy(t *testing.T) {
Egress: []networkingv1.NetworkPolicyEgressRule{
networkingv1.NetworkPolicyEgressRule{
To: []networkingv1.NetworkPolicyPeer{
networkingv1.NetworkPolicyPeer{
NamespaceSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app.kubernetes.io/instance": namespace,
},
},
},
networkingv1.NetworkPolicyPeer{
PodSelector: &metav1.LabelSelector{
MatchLabels: map[string]string{
Expand Down

0 comments on commit e68beb6

Please sign in to comment.