Skip to content

Commit

Permalink
Fixed aliasing of DNS and XDS ports
Browse files Browse the repository at this point in the history
  • Loading branch information
hagen93 committed Jul 21, 2022
1 parent 94cc1e1 commit 14bb21d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions controllers/network_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ func (r *NetworkPolicyReconciler) Reconcile(ctx context.Context, req reconcile.R
labels = map[string]string{"k8s-app": "kube-dns"}
networkPolicy.Spec.Egress[1].To[0].PodSelector.MatchLabels = labels

port := intstr.FromInt(53)
networkPolicy.Spec.Egress[1].Ports[0].Port = &port
dnsPort := intstr.FromInt(53)
networkPolicy.Spec.Egress[1].Ports[0].Port = &dnsPort
protocol := new(corev1.Protocol)
*protocol = corev1.ProtocolTCP
networkPolicy.Spec.Egress[1].Ports[0].Protocol = protocol
networkPolicy.Spec.Egress[1].Ports[1].Port = &port
networkPolicy.Spec.Egress[1].Ports[1].Port = &dnsPort
protocol = new(corev1.Protocol)
*protocol = corev1.ProtocolUDP
networkPolicy.Spec.Egress[1].Ports[1].Protocol = protocol
Expand All @@ -196,8 +196,8 @@ func (r *NetworkPolicyReconciler) Reconcile(ctx context.Context, req reconcile.R
labels = map[string]string{"app": "istiod"}
networkPolicy.Spec.Egress[2].To[0].PodSelector.MatchLabels = labels

port = intstr.FromInt(15012)
networkPolicy.Spec.Egress[2].Ports[0].Port = &port
xdsPort := intstr.FromInt(15012)
networkPolicy.Spec.Egress[2].Ports[0].Port = &xdsPort

// Egress rules for internal peers
for _, rule := range application.Spec.AccessPolicy.Outbound.Rules {
Expand Down

0 comments on commit 14bb21d

Please sign in to comment.