Skip to content

Commit

Permalink
Merge pull request #2130 from apoorvajagtap/issue_1843
Browse files Browse the repository at this point in the history
🐛 Remove the logical-cluster & sync-target labels from syncer namespace
  • Loading branch information
openshift-merge-robot authored Oct 5, 2022
2 parents b96cf4e + 50e39ac commit e33522c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
22 changes: 9 additions & 13 deletions pkg/cliplugins/workload/plugin/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,6 @@ type templateInput struct {
// required to deploy the syncer.
type templateArgs struct {
templateInput
// LabelSafeLogicalCluster is the qualified kcp logical cluster name that is
// safe to appear as a label value
LabelSafeLogicalCluster string
// ServiceAccount is the name of the service account to create in the syncer
// namespace on the pcluster.
ServiceAccount string
Expand Down Expand Up @@ -606,16 +603,15 @@ type templateArgs struct {
// of the namespace.
func renderSyncerResources(input templateInput, syncerID string) ([]byte, error) {
tmplArgs := templateArgs{
templateInput: input,
LabelSafeLogicalCluster: strings.ReplaceAll(input.LogicalCluster, ":", "_"),
ServiceAccount: syncerID,
ClusterRole: syncerID,
ClusterRoleBinding: syncerID,
GroupMappings: getGroupMappings(input.ResourcesToSync),
Secret: syncerID,
SecretConfigKey: SyncerSecretConfigKey,
Deployment: syncerID,
DeploymentApp: syncerID,
templateInput: input,
ServiceAccount: syncerID,
ClusterRole: syncerID,
ClusterRoleBinding: syncerID,
GroupMappings: getGroupMappings(input.ResourcesToSync),
Secret: syncerID,
SecretConfigKey: SyncerSecretConfigKey,
Deployment: syncerID,
DeploymentApp: syncerID,
}

syncerTemplate, err := embeddedResources.ReadFile("syncer.yaml")
Expand Down
6 changes: 0 additions & 6 deletions pkg/cliplugins/workload/plugin/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ apiVersion: v1
kind: Namespace
metadata:
name: kcp-syncer-sync-target-name-34b23c4k
labels:
workload.kcp.io/logical-cluster: root_default_foo
workload.kcp.io/sync-target: sync-target-name
---
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -188,9 +185,6 @@ apiVersion: v1
kind: Namespace
metadata:
name: kcp-syncer-sync-target-name-34b23c4k
labels:
workload.kcp.io/logical-cluster: root_default_foo
workload.kcp.io/sync-target: sync-target-name
---
apiVersion: v1
kind: ServiceAccount
Expand Down
3 changes: 0 additions & 3 deletions pkg/cliplugins/workload/plugin/syncer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ apiVersion: v1
kind: Namespace
metadata:
name: {{.Namespace}}
labels:
workload.kcp.io/logical-cluster: {{.LabelSafeLogicalCluster}}
workload.kcp.io/sync-target: {{.SyncTarget}}
---
apiVersion: v1
kind: ServiceAccount
Expand Down

0 comments on commit e33522c

Please sign in to comment.