Skip to content

Commit 28215aa

Browse files
authored
refactor: remove target namespace (#3221)
1 parent de97690 commit 28215aa

File tree

24 files changed

+15
-274
lines changed

24 files changed

+15
-274
lines changed

.github/workflows/e2e.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,6 @@ jobs:
343343
haValues="-f ./test/values_ha.yaml"
344344
fi
345345
346-
if [ "${{ matrix.test-suite-path }}" = "./test/e2e_target_namespace" ]; then
347-
kubectl apply -f "${{ matrix.test-suite-path }}/role.yaml"
348-
fi
349-
350346
if [ "${{ matrix.test-suite-path }}" = "./test/e2e" ]; then
351347
kubectl create namespace from-host-sync-test
352348
kubectl create namespace from-host-sync-test-2

chart/templates/limitrange.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ apiVersion: v1
44
kind: LimitRange
55
metadata:
66
name: vc-{{ .Release.Name }}
7-
{{- if .Values.experimental.syncSettings.targetNamespace }}
8-
namespace: {{ .Values.experimental.syncSettings.targetNamespace }}
9-
{{- else }}
107
namespace: {{ .Release.Namespace }}
11-
{{- end }}
128
labels:
139
app: vcluster
1410
chart: "{{ include "vcluster.version.label" $ }}"

chart/templates/networkpolicy.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ apiVersion: networking.k8s.io/v1
33
kind: NetworkPolicy
44
metadata:
55
name: vc-work-{{ .Release.Name }}
6-
{{- if .Values.experimental.syncSettings.targetNamespace }}
7-
namespace: {{ .Values.experimental.syncSettings.targetNamespace }}
8-
{{- else }}
96
namespace: {{ .Release.Namespace }}
10-
{{- end }}
117
labels:
128
app: vcluster
139
chart: "{{ include "vcluster.version.label" $ }}"

chart/templates/resourcequota.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ apiVersion: v1
44
kind: ResourceQuota
55
metadata:
66
name: vc-{{ .Release.Name }}
7-
{{- if .Values.experimental.syncSettings.targetNamespace }}
8-
namespace: {{ .Values.experimental.syncSettings.targetNamespace }}
9-
{{- else }}
107
namespace: {{ .Release.Namespace }}
11-
{{- end }}
128
labels:
139
app: vcluster
1410
chart: "{{ include "vcluster.version.label" $ }}"

chart/values.schema.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,10 +1850,6 @@
18501850
},
18511851
"ExperimentalSyncSettings": {
18521852
"properties": {
1853-
"targetNamespace": {
1854-
"type": "string",
1855-
"description": "TargetNamespace is the namespace where the workloads should get synced to.\nDeprecated: Removed in 0.29.0."
1856-
},
18571853
"setOwner": {
18581854
"type": "boolean",
18591855
"description": "SetOwner specifies if vCluster should set an owner reference on the synced objects to the vCluster service. This allows for easy garbage collection."

chart/values.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,9 +1192,6 @@ plugins: {}
11921192
experimental:
11931193
# SyncSettings are advanced settings for the syncer controller.
11941194
syncSettings:
1195-
# TargetNamespace is the namespace where the workloads should get synced to.
1196-
# Deprecated: Removed in 0.29.0.
1197-
targetNamespace: ""
11981195
# SetOwner specifies if vCluster should set an owner reference on the synced objects to the vCluster service. This allows for easy garbage collection.
11991196
setOwner: true
12001197

config/config.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,10 +2914,6 @@ func (e Experimental) JSONSchemaExtend(base *jsonschema.Schema) {
29142914
}
29152915

29162916
type ExperimentalSyncSettings struct {
2917-
// TargetNamespace is the namespace where the workloads should get synced to.
2918-
// Deprecated: Removed in 0.29.0.
2919-
TargetNamespace string `json:"targetNamespace,omitempty"`
2920-
29212917
// SetOwner specifies if vCluster should set an owner reference on the synced objects to the vCluster service. This allows for easy garbage collection.
29222918
SetOwner bool `json:"setOwner,omitempty"`
29232919

config/legacyconfig/migrate.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ func convertBaseValues(oldConfig BaseHelm, newConfig *config.Config) error {
412412
}
413413

414414
if oldConfig.Isolation.Namespace != nil {
415-
return fmt.Errorf("isolation.namespace is no longer supported, use experimental.syncSettings.targetNamespace instead")
415+
return fmt.Errorf("isolation.namespace is no longer supported")
416416
}
417417
if oldConfig.Isolation.NodeProxyPermission.Enabled != nil {
418418
return fmt.Errorf("isolation.nodeProxyPermission.enabled is no longer supported, use rbac.clusterRole.overwriteRules instead")
@@ -815,11 +815,7 @@ func migrateFlag(distro, key, value string, newConfig *config.Config) error {
815815

816816
newConfig.ControlPlane.Proxy.ExtraSANs = append(newConfig.ControlPlane.Proxy.ExtraSANs, strings.Split(value, ",")...)
817817
case "target-namespace":
818-
if value == "" {
819-
return fmt.Errorf("value is missing")
820-
}
821-
822-
newConfig.Experimental.SyncSettings.TargetNamespace = value
818+
return fmt.Errorf("this is not supported anymore, vCluster needs to be created in the same namespace as the target workloads")
823819
case "service-name":
824820
return fmt.Errorf("this is not supported anymore, the service needs to be the vCluster name")
825821
case "name":

config/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ plugins: {}
642642

643643
experimental:
644644
syncSettings:
645-
targetNamespace: ""
646645
setOwner: true
647646

648647
deploy:

pkg/config/config.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ type VirtualClusterConfig struct {
2626
// Name is the name of the vCluster
2727
Name string `json:"name"`
2828

29-
// HostTargetNamespace is the namespace of the host cluster where the workloads should get created in
30-
HostTargetNamespace string `json:"hostTargetNamespace,omitempty"`
31-
3229
// HostNamespace is the namespace in the host cluster where the vCluster is running
3330
HostNamespace string `json:"hostNamespace,omitempty"`
3431

@@ -120,7 +117,6 @@ func (v VirtualClusterConfig) LegacyOptions() (*legacyconfig.LegacyVirtualCluste
120117
BindAddress: v.ControlPlane.Proxy.BindAddress,
121118
Port: v.ControlPlane.Proxy.Port,
122119
Name: v.Name,
123-
TargetNamespace: v.HostTargetNamespace,
124120
ServiceName: v.Name,
125121
SetOwner: v.Experimental.SyncSettings.SetOwner,
126122
SyncAllNodes: v.Sync.FromHost.Nodes.Selector.All,

0 commit comments

Comments
 (0)