diff --git a/chart/tests/role_test.yaml b/chart/tests/role_test.yaml index de651ad03..10667ba72 100644 --- a/chart/tests/role_test.yaml +++ b/chart/tests/role_test.yaml @@ -17,9 +17,9 @@ tests: rbac: role: overwriteRules: - - apiGroups: [ "" ] - resources: [ "configmaps" ] - verbs: [ "create" ] + - apiGroups: [""] + resources: ["configmaps"] + verbs: ["create"] asserts: - hasDocuments: count: 1 @@ -30,9 +30,9 @@ tests: path: rules count: 1 content: - apiGroups: [ "" ] - resources: [ "configmaps" ] - verbs: [ "create" ] + apiGroups: [""] + resources: ["configmaps"] + verbs: ["create"] - it: check plugin extra rules set: @@ -41,17 +41,17 @@ tests: rbac: role: extraRules: - - apiGroups: [ "" ] - resources: [ "test123" ] - verbs: [ "test123" ] + - apiGroups: [""] + resources: ["test123"] + verbs: ["test123"] plugins: test: rbac: role: extraRules: - - apiGroups: [ "" ] - resources: [ "test" ] - verbs: [ "test" ] + - apiGroups: [""] + resources: ["test"] + verbs: ["test"] asserts: - hasDocuments: count: 1 @@ -62,16 +62,16 @@ tests: path: rules count: 1 content: - apiGroups: [ "" ] - resources: [ "test123" ] - verbs: [ "test123" ] + apiGroups: [""] + resources: ["test123"] + verbs: ["test123"] - contains: path: rules count: 1 content: - apiGroups: [ "" ] - resources: [ "test" ] - verbs: [ "test" ] + apiGroups: [""] + resources: ["test"] + verbs: ["test"] - it: check generic sync set: @@ -79,9 +79,9 @@ tests: genericSync: role: extraRules: - - apiGroups: [ "" ] - resources: [ "test" ] - verbs: [ "test" ] + - apiGroups: [""] + resources: ["test"] + verbs: ["test"] asserts: - hasDocuments: count: 1 @@ -92,9 +92,9 @@ tests: path: rules count: 1 content: - apiGroups: [ "" ] - resources: [ "test" ] - verbs: [ "test" ] + apiGroups: [""] + resources: ["test"] + verbs: ["test"] - it: check extra rules set: @@ -114,9 +114,9 @@ tests: path: rules count: 1 content: - apiGroups: [ "" ] - resources: [ "test" ] - verbs: [ "test" ] + apiGroups: [""] + resources: ["test"] + verbs: ["test"] - it: check defaults release: @@ -171,9 +171,9 @@ tests: - contains: path: rules content: - apiGroups: [ "metrics.k8s.io" ] - resources: [ "pods" ] - verbs: [ "get", "list" ] + apiGroups: ["metrics.k8s.io"] + resources: ["pods"] + verbs: ["get", "list"] - it: external secret test set: @@ -197,7 +197,8 @@ tests: content: apiGroups: ["external-secrets.io"] resources: ["externalsecrets"] - verbs: ["create", "delete", "patch", "update", "get", "list", "watch"] + verbs: + ["create", "delete", "patch", "update", "get", "list", "watch"] - it: external secret test store sync set: integrations: @@ -222,7 +223,8 @@ tests: content: apiGroups: ["external-secrets.io"] resources: ["secretstores"] - verbs: ["create", "delete", "patch", "update", "get", "list", "watch"] + verbs: + ["create", "delete", "patch", "update", "get", "list", "watch"] - it: kubeVirt test set: integrations: @@ -241,26 +243,38 @@ tests: path: rules content: apiGroups: ["kubevirt.io"] - resources: ["virtualmachines", "virtualmachines/status", "virtualmachineinstances", "virtualmachineinstances/status", "virtualmachineinstancemigrations", "virtualmachineinstancemigrations/status"] - verbs: ["create", "delete", "patch", "update", "get", "list", "watch"] + resources: + [ + "virtualmachines", + "virtualmachines/status", + "virtualmachineinstances", + "virtualmachineinstances/status", + "virtualmachineinstancemigrations", + "virtualmachineinstancemigrations/status", + ] + verbs: + ["create", "delete", "patch", "update", "get", "list", "watch"] - contains: path: rules content: - apiGroups: [ "cdi.kubevirt.io" ] - resources: [ "datavolumes", "datavolumes/status" ] - verbs: [ "create", "delete", "patch", "update", "get", "list", "watch" ] + apiGroups: ["cdi.kubevirt.io"] + resources: ["datavolumes", "datavolumes/status"] + verbs: + ["create", "delete", "patch", "update", "get", "list", "watch"] - contains: path: rules content: - apiGroups: [ "clone.kubevirt.io" ] - resources: [ "virtualmachineclones", "virtualmachineclones/status" ] - verbs: [ "create", "delete", "patch", "update", "get", "list", "watch" ] + apiGroups: ["clone.kubevirt.io"] + resources: ["virtualmachineclones", "virtualmachineclones/status"] + verbs: + ["create", "delete", "patch", "update", "get", "list", "watch"] - contains: path: rules content: - apiGroups: [ "pool.kubevirt.io" ] - resources: [ "virtualmachinepools", "virtualmachinepools/status" ] - verbs: [ "create", "delete", "patch", "update", "get", "list", "watch" ] + apiGroups: ["pool.kubevirt.io"] + resources: ["virtualmachinepools", "virtualmachinepools/status"] + verbs: + ["create", "delete", "patch", "update", "get", "list", "watch"] - it: crd sync set: @@ -288,24 +302,26 @@ tests: - contains: path: rules content: - apiGroups: [ "my-group-2" ] - resources: [ "test" ] - verbs: ["create", "delete", "patch", "update", "get", "list", "watch"] + apiGroups: ["my-group-2"] + resources: ["test"] + verbs: + ["create", "delete", "patch", "update", "get", "list", "watch"] - contains: path: rules content: - apiGroups: [ "my-group-3.com" ] - resources: [ "tests" ] - verbs: ["create", "delete", "patch", "update", "get", "list", "watch"] + apiGroups: ["my-group-3.com"] + resources: ["tests"] + verbs: + ["create", "delete", "patch", "update", "get", "list", "watch"] - - it: translate + - it: patches set: sync: toHost: customResources: test.my-group-2: enabled: true - translate: + patches: - path: "test" expression: "test" release: @@ -314,14 +330,14 @@ tests: asserts: - notFailedTemplate: {} - - it: translate 2 + - it: patches 2 set: sync: toHost: customResources: test.my-group-2: enabled: true - translate: + patches: - path: "test" reference: apiVersion: "v1" diff --git a/chart/tests/statefulset_test.yaml b/chart/tests/statefulset_test.yaml index c18ab17c1..ef4508bb6 100644 --- a/chart/tests/statefulset_test.yaml +++ b/chart/tests/statefulset_test.yaml @@ -887,11 +887,11 @@ tests: customResources: test.cert-manager.io: enabled: true - translate: + patches: - path: spec.dnsNames[*] expression: "value.startsWith('www.') ? value.slice(4) : value" reverseExpression: '"www."+value' asserts: - - equal: - path: kind - value: StatefulSet + - equal: + path: kind + value: StatefulSet diff --git a/chart/values.schema.json b/chart/values.schema.json index 70d9de31f..b0847f0a8 100755 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -1016,18 +1016,18 @@ "additionalProperties": false, "type": "object" }, - "EnableSwitchWithTranslate": { + "EnableSwitchWithPatches": { "properties": { "enabled": { "type": "boolean", "description": "Enabled defines if this option should be enabled." }, - "translate": { + "patches": { "items": { "$ref": "#/$defs/TranslatePatch" }, "type": "array", - "description": "Translate the patch according to the given patches." + "description": "Patches patch the resource according to the provided specification." } }, "additionalProperties": false, @@ -2910,12 +2910,12 @@ "type": "boolean", "description": "All defines if all resources of that type should get synced or only the necessary ones that are needed." }, - "translate": { + "patches": { "items": { "$ref": "#/$defs/TranslatePatch" }, "type": "array", - "description": "Translate the patch according to the given patches." + "description": "Patches patch the resource according to the provided specification." } }, "additionalProperties": false, @@ -3047,12 +3047,12 @@ "$ref": "#/$defs/SyncRewriteHosts", "description": "RewriteHosts is a special option needed to rewrite statefulset containers to allow the correct FQDN. virtual cluster will add\na small container to each stateful set pod that will initially rewrite the /etc/hosts file to match the FQDN expected by\nthe virtual cluster." }, - "translate": { + "patches": { "items": { "$ref": "#/$defs/TranslatePatch" }, "type": "array", - "description": "Translate the patch according to the given patches." + "description": "Patches patch the resource according to the provided specification." } }, "additionalProperties": false, @@ -3101,11 +3101,11 @@ "description": "ConfigMaps defines if config maps created within the virtual cluster should get synced to the host cluster." }, "ingresses": { - "$ref": "#/$defs/EnableSwitchWithTranslate", + "$ref": "#/$defs/EnableSwitchWithPatches", "description": "Ingresses defines if ingresses created within the virtual cluster should get synced to the host cluster." }, "services": { - "$ref": "#/$defs/EnableSwitchWithTranslate", + "$ref": "#/$defs/EnableSwitchWithPatches", "description": "Services defines if services created within the virtual cluster should get synced to the host cluster." }, "endpoints": { @@ -3117,7 +3117,7 @@ "description": "NetworkPolicies defines if network policies created within the virtual cluster should get synced to the host cluster." }, "persistentVolumeClaims": { - "$ref": "#/$defs/EnableSwitchWithTranslate", + "$ref": "#/$defs/EnableSwitchWithPatches", "description": "PersistentVolumeClaims defines if persistent volume claims created within the virtual cluster should get synced to the host cluster." }, "persistentVolumes": { @@ -3161,12 +3161,12 @@ "type": "boolean", "description": "Enabled defines if this option should be enabled." }, - "translate": { + "patches": { "items": { "$ref": "#/$defs/TranslatePatch" }, "type": "array", - "description": "Translate the patch according to the given patches." + "description": "Patches patch the resource according to the provided specification." } }, "additionalProperties": false, diff --git a/chart/values.yaml b/chart/values.yaml index 7a83f960a..bb4ea9d3a 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -4,12 +4,14 @@ sync: toHost: # Services defines if services created within the virtual cluster should get synced to the host cluster. services: + # Enabled defines if this option should be enabled. enabled: true # Endpoints defines if endpoints created within the virtual cluster should get synced to the host cluster. endpoints: enabled: true # PersistentVolumeClaims defines if persistent volume claims created within the virtual cluster should get synced to the host cluster. persistentVolumeClaims: + # Enabled defines if this option should be enabled. enabled: true # ConfigMaps defines if config maps created within the virtual cluster should get synced to the host cluster. configMaps: @@ -55,6 +57,7 @@ sync: memory: 64Mi # Ingresses defines if ingresses created within the virtual cluster should get synced to the host cluster. ingresses: + # Enabled defines if this option should be enabled. enabled: false # PriorityClasses defines if priority classes created within the virtual cluster should get synced to the host cluster. priorityClasses: diff --git a/config/config.go b/config/config.go index d24092ed1..7c4211d46 100644 --- a/config/config.go +++ b/config/config.go @@ -413,10 +413,10 @@ type SyncToHost struct { ConfigMaps SyncAllResource `json:"configMaps,omitempty"` // Ingresses defines if ingresses created within the virtual cluster should get synced to the host cluster. - Ingresses EnableSwitchWithTranslate `json:"ingresses,omitempty"` + Ingresses EnableSwitchWithPatches `json:"ingresses,omitempty"` // Services defines if services created within the virtual cluster should get synced to the host cluster. - Services EnableSwitchWithTranslate `json:"services,omitempty"` + Services EnableSwitchWithPatches `json:"services,omitempty"` // Endpoints defines if endpoints created within the virtual cluster should get synced to the host cluster. Endpoints EnableSwitch `json:"endpoints,omitempty"` @@ -425,7 +425,7 @@ type SyncToHost struct { NetworkPolicies EnableSwitch `json:"networkPolicies,omitempty"` // PersistentVolumeClaims defines if persistent volume claims created within the virtual cluster should get synced to the host cluster. - PersistentVolumeClaims EnableSwitchWithTranslate `json:"persistentVolumeClaims,omitempty"` + PersistentVolumeClaims EnableSwitchWithPatches `json:"persistentVolumeClaims,omitempty"` // PersistentVolumes defines if persistent volumes created within the virtual cluster should get synced to the host cluster. PersistentVolumes EnableSwitch `json:"persistentVolumes,omitempty"` @@ -450,12 +450,12 @@ type SyncToHost struct { CustomResources map[string]SyncToHostCustomResource `json:"customResources,omitempty"` } -type EnableSwitchWithTranslate struct { +type EnableSwitchWithPatches struct { // Enabled defines if this option should be enabled. Enabled bool `json:"enabled,omitempty"` - // Translate the patch according to the given patches. - Translate []TranslatePatch `json:"translate,omitempty"` + // Patches patch the resource according to the provided specification. + Patches []TranslatePatch `json:"patches,omitempty"` } type SyncFromHost struct { @@ -494,8 +494,8 @@ type SyncToHostCustomResource struct { // Enabled defines if this option should be enabled. Enabled bool `json:"enabled,omitempty"` - // Translate the patch according to the given patches. - Translate []TranslatePatch `json:"translate,omitempty"` + // Patches patch the resource according to the provided specification. + Patches []TranslatePatch `json:"patches,omitempty"` } type TranslatePatch struct { @@ -570,8 +570,8 @@ type SyncAllResource struct { // All defines if all resources of that type should get synced or only the necessary ones that are needed. All bool `json:"all,omitempty"` - // Translate the patch according to the given patches. - Translate []TranslatePatch `json:"translate,omitempty"` + // Patches patch the resource according to the provided specification. + Patches []TranslatePatch `json:"patches,omitempty"` } type SyncPods struct { @@ -594,8 +594,8 @@ type SyncPods struct { // the virtual cluster. RewriteHosts SyncRewriteHosts `json:"rewriteHosts,omitempty"` - // Translate the patch according to the given patches. - Translate []TranslatePatch `json:"translate,omitempty"` + // Patches patch the resource according to the provided specification. + Patches []TranslatePatch `json:"patches,omitempty"` } type SyncRewriteHosts struct { diff --git a/pkg/controllers/resources/configmaps/syncer.go b/pkg/controllers/resources/configmaps/syncer.go index 761d44786..e3c5319c1 100644 --- a/pkg/controllers/resources/configmaps/syncer.go +++ b/pkg/controllers/resources/configmaps/syncer.go @@ -72,7 +72,7 @@ func (s *configMapSyncer) SyncToHost(ctx *synccontext.SyncContext, event *syncco } pObj := translate.HostMetadata(event.Virtual, s.VirtualToHost(ctx, types.NamespacedName{Name: event.Virtual.Name, Namespace: event.Virtual.Namespace}, event.Virtual)) - err = pro.ApplyPatchesHostObject(ctx, nil, pObj, event.Virtual, ctx.Config.Sync.ToHost.ConfigMaps.Translate) + err = pro.ApplyPatchesHostObject(ctx, nil, pObj, event.Virtual, ctx.Config.Sync.ToHost.ConfigMaps.Patches) if err != nil { return ctrl.Result{}, err } @@ -94,7 +94,7 @@ func (s *configMapSyncer) SyncToVirtual(ctx *synccontext.SyncContext, event *syn return ctrl.Result{}, nil } - err = pro.ApplyPatchesVirtualObject(ctx, nil, vObj, event.Host, ctx.Config.Sync.ToHost.ConfigMaps.Translate) + err = pro.ApplyPatchesVirtualObject(ctx, nil, vObj, event.Host, ctx.Config.Sync.ToHost.ConfigMaps.Patches) if err != nil { return ctrl.Result{}, err } @@ -117,7 +117,7 @@ func (s *configMapSyncer) Sync(ctx *synccontext.SyncContext, event *synccontext. return ctrl.Result{}, nil } - patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.ConfigMaps.Translate)) + patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.ConfigMaps.Patches)) if err != nil { return ctrl.Result{}, fmt.Errorf("new syncer patcher: %w", err) } diff --git a/pkg/controllers/resources/ingresses/syncer.go b/pkg/controllers/resources/ingresses/syncer.go index 3142d88c0..568994922 100644 --- a/pkg/controllers/resources/ingresses/syncer.go +++ b/pkg/controllers/resources/ingresses/syncer.go @@ -55,7 +55,7 @@ func (s *ingressSyncer) SyncToHost(ctx *synccontext.SyncContext, event *synccont return ctrl.Result{}, err } - err = pro.ApplyPatchesHostObject(ctx, nil, pObj, event.Virtual, ctx.Config.Sync.ToHost.Ingresses.Translate) + err = pro.ApplyPatchesHostObject(ctx, nil, pObj, event.Virtual, ctx.Config.Sync.ToHost.Ingresses.Patches) if err != nil { return ctrl.Result{}, err } @@ -64,7 +64,7 @@ func (s *ingressSyncer) SyncToHost(ctx *synccontext.SyncContext, event *synccont } func (s *ingressSyncer) Sync(ctx *synccontext.SyncContext, event *synccontext.SyncEvent[*networkingv1.Ingress]) (_ ctrl.Result, retErr error) { - patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.Ingresses.Translate)) + patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.Ingresses.Patches)) if err != nil { return ctrl.Result{}, fmt.Errorf("new syncer patcher: %w", err) } @@ -91,7 +91,7 @@ func (s *ingressSyncer) SyncToVirtual(ctx *synccontext.SyncContext, event *syncc } vIngress := translate.VirtualMetadata(event.Host, s.HostToVirtual(ctx, types.NamespacedName{Name: event.Host.Name, Namespace: event.Host.Namespace}, event.Host)) - err := pro.ApplyPatchesVirtualObject(ctx, nil, vIngress, event.Host, ctx.Config.Sync.ToHost.Ingresses.Translate) + err := pro.ApplyPatchesVirtualObject(ctx, nil, vIngress, event.Host, ctx.Config.Sync.ToHost.Ingresses.Patches) if err != nil { return ctrl.Result{}, err } diff --git a/pkg/controllers/resources/persistentvolumeclaims/syncer.go b/pkg/controllers/resources/persistentvolumeclaims/syncer.go index 06af25562..a2ac63e5f 100644 --- a/pkg/controllers/resources/persistentvolumeclaims/syncer.go +++ b/pkg/controllers/resources/persistentvolumeclaims/syncer.go @@ -101,7 +101,7 @@ func (s *persistentVolumeClaimSyncer) SyncToHost(ctx *synccontext.SyncContext, e return ctrl.Result{}, err } - err = pro.ApplyPatchesHostObject(ctx, nil, newPvc, event.Virtual, ctx.Config.Sync.ToHost.PersistentVolumeClaims.Translate) + err = pro.ApplyPatchesHostObject(ctx, nil, newPvc, event.Virtual, ctx.Config.Sync.ToHost.PersistentVolumeClaims.Patches) if err != nil { return ctrl.Result{}, err } @@ -148,7 +148,7 @@ func (s *persistentVolumeClaimSyncer) Sync(ctx *synccontext.SyncContext, event * } // patch objects - patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.PersistentVolumeClaims.Translate)) + patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.PersistentVolumeClaims.Patches)) if err != nil { return ctrl.Result{}, fmt.Errorf("new syncer patcher: %w", err) } @@ -195,7 +195,7 @@ func (s *persistentVolumeClaimSyncer) SyncToVirtual(ctx *synccontext.SyncContext } vPvc := translate.VirtualMetadata(event.Host, s.HostToVirtual(ctx, types.NamespacedName{Name: event.Host.Name, Namespace: event.Host.Namespace}, event.Host), s.excludedAnnotations...) - err := pro.ApplyPatchesVirtualObject(ctx, nil, vPvc, event.Host, ctx.Config.Sync.ToHost.PersistentVolumeClaims.Translate) + err := pro.ApplyPatchesVirtualObject(ctx, nil, vPvc, event.Host, ctx.Config.Sync.ToHost.PersistentVolumeClaims.Patches) if err != nil { return ctrl.Result{}, err } diff --git a/pkg/controllers/resources/pods/syncer.go b/pkg/controllers/resources/pods/syncer.go index 14f57d7c0..222c85d6c 100644 --- a/pkg/controllers/resources/pods/syncer.go +++ b/pkg/controllers/resources/pods/syncer.go @@ -225,7 +225,7 @@ func (s *podSyncer) SyncToHost(ctx *synccontext.SyncContext, event *synccontext. return ctrl.Result{}, nil } - err = pro.ApplyPatchesHostObject(ctx, nil, pPod, event.Virtual, ctx.Config.Sync.ToHost.Pods.Translate) + err = pro.ApplyPatchesHostObject(ctx, nil, pPod, event.Virtual, ctx.Config.Sync.ToHost.Pods.Patches) if err != nil { return ctrl.Result{}, err } @@ -332,7 +332,7 @@ func (s *podSyncer) Sync(ctx *synccontext.SyncContext, event *synccontext.SyncEv } // patch objects - patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.Pods.Translate)) + patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.Pods.Patches)) if err != nil { return ctrl.Result{}, fmt.Errorf("new syncer patcher: %w", err) } @@ -368,7 +368,7 @@ func (s *podSyncer) SyncToVirtual(ctx *synccontext.SyncContext, event *syncconte vPod.Spec.DeprecatedServiceAccount = "" } - err := pro.ApplyPatchesVirtualObject(ctx, nil, vPod, event.Host, ctx.Config.Sync.ToHost.Pods.Translate) + err := pro.ApplyPatchesVirtualObject(ctx, nil, vPod, event.Host, ctx.Config.Sync.ToHost.Pods.Patches) if err != nil { return ctrl.Result{}, err } diff --git a/pkg/controllers/resources/secrets/syncer.go b/pkg/controllers/resources/secrets/syncer.go index 3533adf0d..8d4ee327c 100644 --- a/pkg/controllers/resources/secrets/syncer.go +++ b/pkg/controllers/resources/secrets/syncer.go @@ -82,7 +82,7 @@ func (s *secretSyncer) SyncToHost(ctx *synccontext.SyncContext, event *syncconte newSecret.Type = corev1.SecretTypeOpaque } - err = pro.ApplyPatchesHostObject(ctx, nil, newSecret, event.Virtual, ctx.Config.Sync.ToHost.Secrets.Translate) + err = pro.ApplyPatchesHostObject(ctx, nil, newSecret, event.Virtual, ctx.Config.Sync.ToHost.Secrets.Patches) if err != nil { return ctrl.Result{}, err } @@ -106,7 +106,7 @@ func (s *secretSyncer) Sync(ctx *synccontext.SyncContext, event *synccontext.Syn } // patch objects - patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.Secrets.Translate)) + patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.Secrets.Patches)) if err != nil { return ctrl.Result{}, fmt.Errorf("new syncer patcher: %w", err) } @@ -155,7 +155,7 @@ func (s *secretSyncer) SyncToVirtual(ctx *synccontext.SyncContext, event *syncco return ctrl.Result{}, nil } - err = pro.ApplyPatchesVirtualObject(ctx, nil, vObj, event.Host, ctx.Config.Sync.ToHost.Secrets.Translate) + err = pro.ApplyPatchesVirtualObject(ctx, nil, vObj, event.Host, ctx.Config.Sync.ToHost.Secrets.Patches) if err != nil { return ctrl.Result{}, err } diff --git a/pkg/controllers/resources/services/syncer.go b/pkg/controllers/resources/services/syncer.go index 8659ce81f..800d9e4df 100644 --- a/pkg/controllers/resources/services/syncer.go +++ b/pkg/controllers/resources/services/syncer.go @@ -75,7 +75,7 @@ func (s *serviceSyncer) SyncToHost(ctx *synccontext.SyncContext, event *synccont } pObj := s.translate(ctx, event.Virtual) - err := pro.ApplyPatchesHostObject(ctx, nil, pObj, event.Virtual, ctx.Config.Sync.ToHost.Services.Translate) + err := pro.ApplyPatchesHostObject(ctx, nil, pObj, event.Virtual, ctx.Config.Sync.ToHost.Services.Patches) if err != nil { return ctrl.Result{}, err } @@ -106,7 +106,7 @@ func (s *serviceSyncer) Sync(ctx *synccontext.SyncContext, event *synccontext.Sy } // patch the service - patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.Services.Translate)) + patch, err := patcher.NewSyncerPatcher(ctx, event.Host, event.Virtual, patcher.TranslatePatches(ctx.Config.Sync.ToHost.Services.Patches)) if err != nil { return ctrl.Result{}, fmt.Errorf("new syncer patcher: %w", err) } @@ -178,7 +178,7 @@ func (s *serviceSyncer) SyncToVirtual(ctx *synccontext.SyncContext, event *syncc } vObj := s.translateToVirtual(ctx, event.Host) - err := pro.ApplyPatchesVirtualObject(ctx, nil, vObj, event.Host, ctx.Config.Sync.ToHost.Services.Translate) + err := pro.ApplyPatchesVirtualObject(ctx, nil, vObj, event.Host, ctx.Config.Sync.ToHost.Services.Patches) if err != nil { return ctrl.Result{}, err }