Skip to content

Commit

Permalink
Merge pull request #18 from kartverket/port-alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Espen Henriksen authored Jul 21, 2022
2 parents 94cc1e1 + 14bb21d commit f736da8
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 f736da8

Please sign in to comment.