Skip to content

Commit

Permalink
fix(setup): Fix network policy not matching db pod
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Mar 25, 2024
1 parent 8954d1d commit 109cffd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/util/cmd_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ func createJob(ctx context.Context, conf *config.Global, actionName string) erro
Egress: []networkingv1.NetworkPolicyEgressRule{
{
To: []networkingv1.NetworkPolicyPeer{{
PodSelector: ptr.To(metav1.LabelSelector{MatchLabels: conf.DBPod.Labels}),
NamespaceSelector: ptr.To(metav1.LabelSelector{MatchLabels: map[string]string{
"kubernetes.io/metadata.name": conf.Client.Namespace,
}}),
}},
Ports: []networkingv1.NetworkPolicyPort{{
Port: ptr.To(intstr.FromInt32(int32(conf.Port))),
Expand Down

0 comments on commit 109cffd

Please sign in to comment.