Skip to content

Commit e33522c

Browse files
Merge pull request #2130 from apoorvajagtap/issue_1843
🐛 Remove the logical-cluster & sync-target labels from syncer namespace
2 parents b96cf4e + 50e39ac commit e33522c

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

pkg/cliplugins/workload/plugin/sync.go

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,6 @@ type templateInput struct {
569569
// required to deploy the syncer.
570570
type templateArgs struct {
571571
templateInput
572-
// LabelSafeLogicalCluster is the qualified kcp logical cluster name that is
573-
// safe to appear as a label value
574-
LabelSafeLogicalCluster string
575572
// ServiceAccount is the name of the service account to create in the syncer
576573
// namespace on the pcluster.
577574
ServiceAccount string
@@ -606,16 +603,15 @@ type templateArgs struct {
606603
// of the namespace.
607604
func renderSyncerResources(input templateInput, syncerID string) ([]byte, error) {
608605
tmplArgs := templateArgs{
609-
templateInput: input,
610-
LabelSafeLogicalCluster: strings.ReplaceAll(input.LogicalCluster, ":", "_"),
611-
ServiceAccount: syncerID,
612-
ClusterRole: syncerID,
613-
ClusterRoleBinding: syncerID,
614-
GroupMappings: getGroupMappings(input.ResourcesToSync),
615-
Secret: syncerID,
616-
SecretConfigKey: SyncerSecretConfigKey,
617-
Deployment: syncerID,
618-
DeploymentApp: syncerID,
606+
templateInput: input,
607+
ServiceAccount: syncerID,
608+
ClusterRole: syncerID,
609+
ClusterRoleBinding: syncerID,
610+
GroupMappings: getGroupMappings(input.ResourcesToSync),
611+
Secret: syncerID,
612+
SecretConfigKey: SyncerSecretConfigKey,
613+
Deployment: syncerID,
614+
DeploymentApp: syncerID,
619615
}
620616

621617
syncerTemplate, err := embeddedResources.ReadFile("syncer.yaml")

pkg/cliplugins/workload/plugin/sync_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ apiVersion: v1
2929
kind: Namespace
3030
metadata:
3131
name: kcp-syncer-sync-target-name-34b23c4k
32-
labels:
33-
workload.kcp.io/logical-cluster: root_default_foo
34-
workload.kcp.io/sync-target: sync-target-name
3532
---
3633
apiVersion: v1
3734
kind: ServiceAccount
@@ -188,9 +185,6 @@ apiVersion: v1
188185
kind: Namespace
189186
metadata:
190187
name: kcp-syncer-sync-target-name-34b23c4k
191-
labels:
192-
workload.kcp.io/logical-cluster: root_default_foo
193-
workload.kcp.io/sync-target: sync-target-name
194188
---
195189
apiVersion: v1
196190
kind: ServiceAccount

pkg/cliplugins/workload/plugin/syncer.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ apiVersion: v1
33
kind: Namespace
44
metadata:
55
name: {{.Namespace}}
6-
labels:
7-
workload.kcp.io/logical-cluster: {{.LabelSafeLogicalCluster}}
8-
workload.kcp.io/sync-target: {{.SyncTarget}}
96
---
107
apiVersion: v1
118
kind: ServiceAccount

0 commit comments

Comments
 (0)