Skip to content

Commit b0284c9

Browse files
committedMar 5, 2025
fix(netpol): set shortened name for label as well
1 parent 0ba0b3c commit b0284c9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎internal/pkg/netpol/netpol.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ package netpol
33
import (
44
"context"
55
"fmt"
6+
"os"
7+
68
"github.com/nais/liberator/pkg/namegen"
79
"k8s.io/apimachinery/pkg/util/validation"
8-
"os"
910

1011
"github.com/nais/cloudsql-migrator/internal/pkg/common_main"
1112
"github.com/nais/cloudsql-migrator/internal/pkg/config"
@@ -47,7 +48,7 @@ func CreateNetworkPolicy(ctx context.Context, cfg *config.Config, source *resolv
4748
PodSelector: metav1.LabelSelector{
4849
MatchLabels: map[string]string{
4950
// This label must match the label on the job running the migration, as set by nais-cli
50-
"migrator.nais.io/migration-name": fmt.Sprintf("migration-%s-%s", cfg.ApplicationName, target.Name),
51+
"migrator.nais.io/migration-name": name,
5152
},
5253
},
5354
Egress: []v1.NetworkPolicyEgressRule{{

0 commit comments

Comments
 (0)