diff --git a/go.mod b/go.mod index 086f17b..20c4e22 100644 --- a/go.mod +++ b/go.mod @@ -35,6 +35,7 @@ require ( ) require ( + dario.cat/mergo v1.0.0 // indirect github.com/Microsoft/go-winio v0.5.2 // indirect github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 // indirect github.com/acomagu/bufpipe v1.0.3 // indirect diff --git a/go.sum b/go.sum index e7cff24..cdb16ef 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,14 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 h1:ra2OtmuW0AE5csawV4YXMNGNQQXvLRps3z2Z59OPO+I= github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY= @@ -122,6 +126,7 @@ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= diff --git a/helm/crds/provisioning.totalsoft.ro_azuredatabases.yaml b/helm/crds/provisioning.totalsoft.ro_azuredatabases.yaml index ad68941..3fd8c63 100644 --- a/helm/crds/provisioning.totalsoft.ro_azuredatabases.yaml +++ b/helm/crds/provisioning.totalsoft.ro_azuredatabases.yaml @@ -98,6 +98,13 @@ spec: - resourceGroupName - serverName type: object + tenantOverrides: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: Overrides for tenants. Dictionary with tenant name as + key, spec override as value. The spec override has the same structure + as Spec + type: object required: - dbName - domainRef diff --git a/helm/crds/provisioning.totalsoft.ro_azuremanageddatabases.yaml b/helm/crds/provisioning.totalsoft.ro_azuremanageddatabases.yaml index ee50005..a2b7936 100644 --- a/helm/crds/provisioning.totalsoft.ro_azuremanageddatabases.yaml +++ b/helm/crds/provisioning.totalsoft.ro_azuremanageddatabases.yaml @@ -116,6 +116,13 @@ spec: - backupFileName - storageContainer type: object + tenantOverrides: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: Overrides for tenants. Dictionary with tenant name as + key, spec override as value. The spec override has the same structure + as Spec + type: object required: - dbName - domainRef diff --git a/helm/crds/provisioning.totalsoft.ro_azurevirtualdesktops.yaml b/helm/crds/provisioning.totalsoft.ro_azurevirtualdesktops.yaml index 99fdde9..ecea69d 100644 --- a/helm/crds/provisioning.totalsoft.ro_azurevirtualdesktops.yaml +++ b/helm/crds/provisioning.totalsoft.ro_azurevirtualdesktops.yaml @@ -175,6 +175,13 @@ spec: subnetId: description: 'Subnet of the VNet used by the virtual machine eg: /subscriptions/05a50a12-6628-4627-bd30-19932dac39f8/resourceGroups/charismaonline.qa/providers/Microsoft.Network/virtualNetworks/charismaonline-vnet/subnets/default' type: string + tenantOverrides: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: Overrides for tenants. Dictionary with tenant name as + key, spec override as value. The spec override has the same structure + as Spec + type: object users: properties: admins: diff --git a/helm/crds/provisioning.totalsoft.ro_azurevirtualmachines.yaml b/helm/crds/provisioning.totalsoft.ro_azurevirtualmachines.yaml index fe277e7..88f5357 100644 --- a/helm/crds/provisioning.totalsoft.ro_azurevirtualmachines.yaml +++ b/helm/crds/provisioning.totalsoft.ro_azurevirtualmachines.yaml @@ -160,6 +160,13 @@ spec: subnetId: description: 'Subnet of the VNet used by the virtual machine eg: /subscriptions/05a50a12-6628-4627-bd30-19932dac39f8/resourceGroups/charismaonline.qa/providers/Microsoft.Network/virtualNetworks/charismaonline-vnet/subnets/default' type: string + tenantOverrides: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: Overrides for tenants. Dictionary with tenant name as + key, spec override as value. The spec override has the same structure + as Spec + type: object vmName: description: Virtual Machine name prefix. Will have platform and tenant suffix. diff --git a/helm/crds/provisioning.totalsoft.ro_helmreleases.yaml b/helm/crds/provisioning.totalsoft.ro_helmreleases.yaml index 286f4b7..6e16162 100644 --- a/helm/crds/provisioning.totalsoft.ro_helmreleases.yaml +++ b/helm/crds/provisioning.totalsoft.ro_helmreleases.yaml @@ -827,6 +827,13 @@ spec: - chart - interval type: object + tenantOverrides: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: Overrides for tenants. Dictionary with tenant name as + key, spec override as value. The spec override has the same structure + as Spec + type: object required: - domainRef - platformRef diff --git a/internal/controllers/provisioning/provisioners/pulumi/azure_virtual_desktop_test.go b/internal/controllers/provisioning/provisioners/pulumi/azure_virtual_desktop_test.go index 1716791..01b2fe9 100644 --- a/internal/controllers/provisioning/provisioners/pulumi/azure_virtual_desktop_test.go +++ b/internal/controllers/provisioning/provisioners/pulumi/azure_virtual_desktop_test.go @@ -56,7 +56,9 @@ func newVirtualDesktop(name, platform string) *provisioningv1.AzureVirtualDeskto Namespace: metav1.NamespaceDefault, }, Spec: provisioningv1.AzureVirtualDesktopSpec{ - PlatformRef: platform, + ProvisioningMeta: provisioningv1.ProvisioningMeta{ + PlatformRef: platform, + }, HostPoolName: "test-vm", VmSize: "Standard_B1s", OSDiskType: "Standard_LRS", diff --git a/internal/controllers/provisioning/provisioners/pulumi/azure_virtual_machine_test.go b/internal/controllers/provisioning/provisioners/pulumi/azure_virtual_machine_test.go index 8c7a96a..5ef549b 100644 --- a/internal/controllers/provisioning/provisioners/pulumi/azure_virtual_machine_test.go +++ b/internal/controllers/provisioning/provisioners/pulumi/azure_virtual_machine_test.go @@ -56,7 +56,9 @@ func newVm(name, platform string) *provisioningv1.AzureVirtualMachine { Namespace: metav1.NamespaceDefault, }, Spec: provisioningv1.AzureVirtualMachineSpec{ - PlatformRef: platform, + ProvisioningMeta: provisioningv1.ProvisioningMeta{ + PlatformRef: platform, + }, VmName: "test-vm", VmSize: "Standard_B1s", OSDiskType: "Standard_LRS", diff --git a/internal/controllers/provisioning/provisioners/pulumi/helm_release_test.go b/internal/controllers/provisioning/provisioners/pulumi/helm_release_test.go index 21c4d1c..b7f6a20 100644 --- a/internal/controllers/provisioning/provisioners/pulumi/helm_release_test.go +++ b/internal/controllers/provisioning/provisioners/pulumi/helm_release_test.go @@ -108,7 +108,9 @@ func newHr(name, platform string) *provisioningv1.HelmRelease { Namespace: metav1.NamespaceDefault, }, Spec: provisioningv1.HelmReleaseSpec{ - PlatformRef: platform, + ProvisioningMeta: provisioningv1.ProvisioningMeta{ + PlatformRef: platform, + }, Release: flux.HelmReleaseSpec{ Interval: metav1.Duration{Duration: 10 * time.Second}, Chart: flux.HelmChartTemplate{ diff --git a/internal/controllers/provisioning/provisioning_controller.go b/internal/controllers/provisioning/provisioning_controller.go index b0cd829..4513510 100644 --- a/internal/controllers/provisioning/provisioning_controller.go +++ b/internal/controllers/provisioning/provisioning_controller.go @@ -2,6 +2,7 @@ package provisioning import ( "context" + "encoding/json" "fmt" "reflect" "strings" @@ -10,6 +11,7 @@ import ( "k8s.io/utils/strings/slices" corev1 "k8s.io/api/core/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/api/errors" apimeta "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -31,6 +33,8 @@ import ( informers "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions" platformInformersv1 "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions/platform/v1alpha1" provisioningInformersv1 "totalsoft.ro/platform-controllers/pkg/generated/informers/externalversions/provisioning/v1alpha1" + + "dario.cat/mergo" ) const ( @@ -253,6 +257,11 @@ func (c *ProvisioningController) syncHandler(key string) error { n := 0 for _, db := range azureDbs { if db.Spec.PlatformRef == platform && slices.Contains(tenant.Spec.DomainRefs, db.Spec.DomainRef) { + err := applyTenantOverrides(db, tenant.Name) + if err != nil { + return err + } + azureDbs[n] = db n++ } @@ -267,6 +276,11 @@ func (c *ProvisioningController) syncHandler(key string) error { n = 0 for _, db := range azureManagedDbs { if db.Spec.PlatformRef == platform && slices.Contains(tenant.Spec.DomainRefs, db.Spec.DomainRef) { + err := applyTenantOverrides(db, tenant.Name) + if err != nil { + return err + } + azureManagedDbs[n] = db n++ } @@ -281,6 +295,11 @@ func (c *ProvisioningController) syncHandler(key string) error { n = 0 for _, hr := range helmReleases { if hr.Spec.PlatformRef == platform && slices.Contains(tenant.Spec.DomainRefs, hr.Spec.DomainRef) { + err := applyTenantOverrides(hr, tenant.Name) + if err != nil { + return err + } + helmReleases[n] = hr n++ } @@ -295,6 +314,11 @@ func (c *ProvisioningController) syncHandler(key string) error { n = 0 for _, vm := range azureVirtualMachines { if vm.Spec.PlatformRef == platform && slices.Contains(tenant.Spec.DomainRefs, vm.Spec.DomainRef) { + err := applyTenantOverrides(vm, tenant.Name) + if err != nil { + return err + } + azureVirtualMachines[n] = vm n++ } @@ -307,9 +331,14 @@ func (c *ProvisioningController) syncHandler(key string) error { } n = 0 - for _, vm := range azureVirtualDesktops { - if vm.Spec.PlatformRef == platform && slices.Contains(tenant.Spec.DomainRefs, vm.Spec.DomainRef) { - azureVirtualDesktops[n] = vm + for _, avd := range azureVirtualDesktops { + if avd.Spec.PlatformRef == platform && slices.Contains(tenant.Spec.DomainRefs, avd.Spec.DomainRef) { + err := applyTenantOverrides(avd, tenant.Name) + if err != nil { + return err + } + + azureVirtualDesktops[n] = avd n++ } } @@ -738,3 +767,95 @@ func getAzureVirtualDesktopPlatform(azureVirtualDesktop *provisioningv1.AzureVir return platform, true } + +type ProvisioningResource interface { + *provisioningv1.AzureDatabase | *provisioningv1.AzureManagedDatabase | *provisioningv1.HelmRelease | *provisioningv1.AzureVirtualMachine | *provisioningv1.AzureVirtualDesktop + + GetProvisioningMeta() *provisioningv1.ProvisioningMeta + GetSpec() any +} + +func applyTenantOverrides[T ProvisioningResource](target T, tenantName string) error { + if target == nil { + return nil + } + + overrides := target.GetProvisioningMeta().TenantOverrides + + if overrides == nil { + return nil + } + + tenantOverridesJson, exists := overrides[tenantName] + if !exists { + return nil + } + + var tenantOverridesMap map[string]any + if err := json.Unmarshal(tenantOverridesJson.Raw, &tenantOverridesMap); err != nil { + return err + } + + targetSpec := target.GetSpec() + + targetSpecJsonBytes, err := json.Marshal(targetSpec) + if err != nil { + return err + } + + var targetSpecMap map[string]any + if err := json.Unmarshal(targetSpecJsonBytes, &targetSpecMap); err != nil { + return err + } + + if err := mergo.Merge(&targetSpecMap, tenantOverridesMap, mergo.WithOverride, mergo.WithTransformers(jsonTransformer{})); err != nil { + return err + } + + targetSpecJsonBytes, err = json.Marshal(targetSpecMap) + if err != nil { + return err + } + + if err := json.Unmarshal(targetSpecJsonBytes, targetSpec); err != nil { + return err + } + + return nil +} + +type jsonTransformer struct { +} + +func (t jsonTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { + if typ == reflect.TypeOf(apiextensionsv1.JSON{}) { + return func(dst, src reflect.Value) error { + if dst.CanSet() { + srcRaw := src.FieldByName("Raw").Bytes() + var srcMap map[string]interface{} + if err := json.Unmarshal(srcRaw, &srcMap); err != nil { + return err + } + + dstRaw := dst.FieldByName("Raw").Bytes() + var dstMap map[string]interface{} + if err := json.Unmarshal(dstRaw, &dstMap); err != nil { + return err + } + + if err := mergo.Merge(&dstMap, srcMap, mergo.WithOverride, mergo.WithTransformers(jsonTransformer{})); err != nil { + return err + } + + dstRaw, err := json.Marshal(dstMap) + if err != nil { + return err + } + + dst.FieldByName("Raw").SetBytes(dstRaw) + } + return nil + } + } + return nil +} diff --git a/internal/controllers/provisioning/provisioning_controller_test.go b/internal/controllers/provisioning/provisioning_controller_test.go index 4355ff2..0f2c03d 100644 --- a/internal/controllers/provisioning/provisioning_controller_test.go +++ b/internal/controllers/provisioning/provisioning_controller_test.go @@ -1,10 +1,15 @@ package provisioning import ( + "encoding/json" "sync" "testing" + "time" + "github.com/fluxcd/helm-controller/api/v2beta1" + "github.com/stretchr/testify/assert" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" provisioners "totalsoft.ro/platform-controllers/internal/controllers/provisioning/provisioners" @@ -270,6 +275,216 @@ func TestProvisioningController_processNextWorkItem(t *testing.T) { }) } +func TestProvisioningController_applyTenantOverrides(t *testing.T) { + + t.Run("apply managedDb tenant overrides", func(t *testing.T) { + tenantName := "tenant1" + overrides := map[string]any{ + "restoreFrom": map[string]any{ + "backupFileName": "afterBackupFileName", + }, + } + + overridesBytes, _ := json.Marshal(overrides) + + db := provisioningv1.AzureManagedDatabase{ + Spec: provisioningv1.AzureManagedDatabaseSpec{ + ProvisioningMeta: provisioningv1.ProvisioningMeta{ + PlatformRef: "platform", + TenantOverrides: map[string]*v1.JSON{ + tenantName: {Raw: overridesBytes}, + }, + }, + RestoreFrom: provisioningv1.AzureManagedDatabaseRestoreSpec{ + BackupFileName: "beforeBackupFileName", + }, + }, + } + + err := applyTenantOverrides(&db, tenantName) + if err != nil { + t.Error(err) + } + + assert.Equal(t, "afterBackupFileName", db.Spec.RestoreFrom.BackupFileName) + }) + + t.Run("override helmRelease version", func(t *testing.T) { + tenantName := "tenant1" + overrides := map[string]any{ + "release": map[string]any{ + "chart": map[string]any{ + "spec": map[string]any{ + "version": "1.1.1", + }, + }, + }, + } + overridesBytes, _ := json.Marshal(overrides) + + hr := provisioningv1.HelmRelease{ + Spec: provisioningv1.HelmReleaseSpec{ + ProvisioningMeta: provisioningv1.ProvisioningMeta{ + TenantOverrides: map[string]*v1.JSON{ + tenantName: {Raw: overridesBytes}, + }, + }, + Release: v2beta1.HelmReleaseSpec{ + Chart: v2beta1.HelmChartTemplate{ + Spec: v2beta1.HelmChartTemplateSpec{ + Version: "0.0.0-0", + }, + }, + }, + }, + } + + err := applyTenantOverrides(&hr, tenantName) + if err != nil { + t.Error(err) + } + + assert.Equal(t, hr.Spec.Release.Chart.Spec.Version, "1.1.1") + }) + + t.Run("override avd params", func(t *testing.T) { + tenantName := "tenant1" + overrides := map[string]any{ + "initScriptArgs": []map[string]any{ + {"name": "arg1NameAfter", "value": "arg1ValueAfter"}, + }, + "users": map[string]any{ + "applicationUsers": []string{ + "user1After", + "user2After", + }, + }, + "vmNumberOfInstances": 2, + } + overridesBytes, _ := json.Marshal(overrides) + + avd := provisioningv1.AzureVirtualDesktop{ + Spec: provisioningv1.AzureVirtualDesktopSpec{ + ProvisioningMeta: provisioningv1.ProvisioningMeta{ + TenantOverrides: map[string]*v1.JSON{ + tenantName: {Raw: overridesBytes}, + }, + }, + InitScriptArguments: []provisioningv1.InitScriptArgs{ + {Name: "arg1NameBefore", Value: "arg1ValueBefore"}, + {Name: "arg2NameBefore", Value: "arg2ValueBefore"}, + }, + Users: provisioningv1.AzureVirtualDesktopUsersSpec{ + ApplicationUsers: []string{"user1Before", "user2Before"}, + }, + VmNumberOfInstances: 1, + }, + } + + err := applyTenantOverrides(&avd, tenantName) + if err != nil { + t.Error(err) + } + + assert.Equal(t, []provisioningv1.InitScriptArgs{{Name: "arg1NameAfter", Value: "arg1ValueAfter"}}, + avd.Spec.InitScriptArguments) + + assert.Equal(t, []string{"user1After", "user2After"}, avd.Spec.Users.ApplicationUsers) + assert.Equal(t, 2, avd.Spec.VmNumberOfInstances) + }) + + t.Run("override contents of JSON field", func(t *testing.T) { + tenantName := "tenant1" + overrides := map[string]any{ + "release": map[string]any{ + "values": map[string]any{ + "env": map[string]any{ + "key1": "envValue1After", + "key3": "envValue3After", + }, + }, + }, + } + overridesBytes, _ := json.Marshal(overrides) + + valuesBefore := map[string]any{ + "env": map[string]any{ + "key1": "envValue1Before", + "key2": "envValue2Before", + }, + } + valuesBeforeBytes, _ := json.Marshal(valuesBefore) + + hr := provisioningv1.HelmRelease{ + Spec: provisioningv1.HelmReleaseSpec{ + ProvisioningMeta: provisioningv1.ProvisioningMeta{ + TenantOverrides: map[string]*v1.JSON{ + tenantName: {Raw: overridesBytes}, + }, + }, + Release: v2beta1.HelmReleaseSpec{ + Values: &v1.JSON{Raw: valuesBeforeBytes}, + }, + }, + } + + err := applyTenantOverrides(&hr, tenantName) + if err != nil { + t.Error(err) + } + + var valuesMap map[string]any + if err := json.Unmarshal(hr.Spec.Release.Values.Raw, &valuesMap); err != nil { + t.Error(err) + } + + key1 := valuesMap["env"].(map[string]any)["key1"].(string) + key2 := valuesMap["env"].(map[string]any)["key2"].(string) + key3 := valuesMap["env"].(map[string]any)["key3"].(string) + + assert.Equal(t, key1, "envValue1After") + assert.Equal(t, key2, "envValue2Before") + assert.Equal(t, key3, "envValue3After") + }) + + t.Run("override with empty value", func(t *testing.T) { + tenantName := "tenant1" + num := 1 + overrides := map[string]any{ + "release": map[string]any{ + "targetNamespace": "", + "maxHistory": nil, + }, + } + overridesBytes, _ := json.Marshal(overrides) + + hr := provisioningv1.HelmRelease{ + Spec: provisioningv1.HelmReleaseSpec{ + ProvisioningMeta: provisioningv1.ProvisioningMeta{ + TenantOverrides: map[string]*v1.JSON{ + tenantName: {Raw: overridesBytes}, + }, + }, + Release: v2beta1.HelmReleaseSpec{ + TargetNamespace: "targetNamespaceBefore", + StorageNamespace: "storageNamespaceBefore", + MaxHistory: &num, + }, + }, + } + + err := applyTenantOverrides(&hr, tenantName) + if err != nil { + t.Error(err) + } + + assert.Equal(t, "", hr.Spec.Release.TargetNamespace) + assert.Equal(t, "storageNamespaceBefore", hr.Spec.Release.StorageNamespace) + assert.Nil(t, hr.Spec.Release.MaxHistory) + }) + +} + func newTenantWithService(name, platform, domain string) *platformv1.Tenant { return &platformv1.Tenant{ TypeMeta: metav1.TypeMeta{APIVersion: provisioningv1.SchemeGroupVersion.String()}, @@ -297,9 +512,11 @@ func newAzureDbWithService(name, platform, domain string) *provisioningv1.AzureD Namespace: metav1.NamespaceDefault, }, Spec: provisioningv1.AzureDatabaseSpec{ - PlatformRef: platform, - DbName: name, - DomainRef: domain, + ProvisioningMeta: provisioningv1.ProvisioningMeta{ + PlatformRef: platform, + DomainRef: domain, + }, + DbName: name, }, } } @@ -316,8 +533,10 @@ func newAzureManagedDb(dbName, platform string) *provisioningv1.AzureManagedData Namespace: metav1.NamespaceDefault, }, Spec: provisioningv1.AzureManagedDatabaseSpec{ - PlatformRef: platform, - DbName: dbName, + ProvisioningMeta: provisioningv1.ProvisioningMeta{ + PlatformRef: platform, + }, + DbName: dbName, }, } } diff --git a/pkg/apis/provisioning/v1alpha1/azureDatabaseTypes.go b/pkg/apis/provisioning/v1alpha1/azureDatabaseTypes.go index 883fe35..685328b 100644 --- a/pkg/apis/provisioning/v1alpha1/azureDatabaseTypes.go +++ b/pkg/apis/provisioning/v1alpha1/azureDatabaseTypes.go @@ -1,6 +1,7 @@ package v1alpha1 import ( + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -18,12 +19,6 @@ type AzureDatabase struct { } type AzureDatabaseSpec struct { - // Target platform (custom resource name). - // +required - PlatformRef string `json:"platformRef"` - // Business Domain that this resource is provision for. - // +required - DomainRef string `json:"domainRef"` // Database name prefix. Will have platform and tenant suffix. DbName string `json:"dbName"` // Azure Sql Server spec. New database will be created on this server @@ -35,7 +30,12 @@ type AzureDatabaseSpec struct { // +optional SourceDatabaseId string `json:"sourceDatabaseId,omitempty"` // +optional - Exports []AzureDatabaseExportsSpec `json:"exports,omitempty"` + Exports []AzureDatabaseExportsSpec `json:"exports,omitempty"` + ProvisioningMeta `json:",inline"` +} + +type TenanantOverridesMeta struct { + TenantOverrides map[string]*apiextensionsv1.JSON `json:"tenantOverrides,omitempty"` } type SqlServerSpec struct { @@ -62,3 +62,11 @@ type AzureDatabaseList struct { Items []AzureDatabase `json:"items"` } + +func (db *AzureDatabase) GetProvisioningMeta() *ProvisioningMeta { + return &db.Spec.ProvisioningMeta +} + +func (db *AzureDatabase) GetSpec() any { + return &db.Spec +} diff --git a/pkg/apis/provisioning/v1alpha1/azureManagedDatabaseTypes.go b/pkg/apis/provisioning/v1alpha1/azureManagedDatabaseTypes.go index 3dccd93..21fe6fd 100644 --- a/pkg/apis/provisioning/v1alpha1/azureManagedDatabaseTypes.go +++ b/pkg/apis/provisioning/v1alpha1/azureManagedDatabaseTypes.go @@ -18,12 +18,6 @@ type AzureManagedDatabase struct { } type AzureManagedDatabaseSpec struct { - // Target platform (custom resource name). - // +required - PlatformRef string `json:"platformRef"` - // Business Domain that this resource is provision for. - // +required - DomainRef string `json:"domainRef"` // Managed database name prefix. Will have platform and tenant suffix. DbName string `json:"dbName"` // Target managed instance spec. @@ -33,7 +27,8 @@ type AzureManagedDatabaseSpec struct { RestoreFrom AzureManagedDatabaseRestoreSpec `json:"restoreFrom,omitempty"` // Export provisioning values spec. // +optional - Exports []AzureManagedDatabaseExportsSpec `json:"exports,omitempty"` + Exports []AzureManagedDatabaseExportsSpec `json:"exports,omitempty"` + ProvisioningMeta `json:",inline"` } type AzureManagedInstanceSpec struct { // Managed instance name. @@ -71,3 +66,11 @@ type AzureManagedDatabaseList struct { Items []AzureManagedDatabase `json:"items"` } + +func (db *AzureManagedDatabase) GetProvisioningMeta() *ProvisioningMeta { + return &db.Spec.ProvisioningMeta +} + +func (db *AzureManagedDatabase) GetSpec() any { + return &db.Spec +} diff --git a/pkg/apis/provisioning/v1alpha1/azureVirtualDesktopTypes.go b/pkg/apis/provisioning/v1alpha1/azureVirtualDesktopTypes.go index c9d5293..8b835ec 100644 --- a/pkg/apis/provisioning/v1alpha1/azureVirtualDesktopTypes.go +++ b/pkg/apis/provisioning/v1alpha1/azureVirtualDesktopTypes.go @@ -16,13 +16,6 @@ type AzureVirtualDesktop struct { } type AzureVirtualDesktopSpec struct { - // Target platform (custom resource name). - PlatformRef string `json:"platformRef"` - - // Business Domain that this resource is provision for. - // +required - DomainRef string `json:"domainRef"` - // Virtual Desktop name prefix. Will have platform and tenant suffix. HostPoolName string `json:"hostPoolName"` @@ -67,6 +60,8 @@ type AzureVirtualDesktopSpec struct { // +optional Exports []AzureVirtualDesktopExportsSpec `json:"exports,omitempty"` + + ProvisioningMeta `json:",inline"` } type AzureVirtualDesktopExportsSpec struct { @@ -109,3 +104,11 @@ type AzureVirtualDesktopList struct { Items []AzureVirtualDesktop `json:"items"` } + +func (db *AzureVirtualDesktop) GetProvisioningMeta() *ProvisioningMeta { + return &db.Spec.ProvisioningMeta +} + +func (db *AzureVirtualDesktop) GetSpec() any { + return &db.Spec +} diff --git a/pkg/apis/provisioning/v1alpha1/azureVirtualMachineTypes.go b/pkg/apis/provisioning/v1alpha1/azureVirtualMachineTypes.go index 0ab4c80..be3a928 100644 --- a/pkg/apis/provisioning/v1alpha1/azureVirtualMachineTypes.go +++ b/pkg/apis/provisioning/v1alpha1/azureVirtualMachineTypes.go @@ -16,12 +16,6 @@ type AzureVirtualMachine struct { } type AzureVirtualMachineSpec struct { - // Target platform (custom resource name). - // +required - PlatformRef string `json:"platformRef"` - // Business Domain that this resource is provision for. - // +required - DomainRef string `json:"domainRef"` // Virtual Machine name prefix. Will have platform and tenant suffix. VmName string `json:"vmName"` @@ -47,6 +41,8 @@ type AzureVirtualMachineSpec struct { // Enable Trusted Launch security EnableTrustedLaunch bool `json:"enableTrustedLaunch"` + ProvisioningMeta `json:",inline"` + // +optional Exports []AzureVirtualMachineExportsSpec `json:"exports,omitempty"` } @@ -73,3 +69,11 @@ type AzureVirtualMachineList struct { Items []AzureVirtualMachine `json:"items"` } + +func (db *AzureVirtualMachine) GetProvisioningMeta() *ProvisioningMeta { + return &db.Spec.ProvisioningMeta +} + +func (db *AzureVirtualMachine) GetSpec() any { + return &db.Spec +} diff --git a/pkg/apis/provisioning/v1alpha1/commonTypes.go b/pkg/apis/provisioning/v1alpha1/commonTypes.go new file mode 100644 index 0000000..71129e3 --- /dev/null +++ b/pkg/apis/provisioning/v1alpha1/commonTypes.go @@ -0,0 +1,35 @@ +package v1alpha1 + +import apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + +type ValueExport struct { + // +optional + ToConfigMap ConfigMapTemplate `json:"toConfigMap,omitempty"` + // +optional + ToVault VaultSecretTemplate `json:"toVault,omitempty"` +} + +type ConfigMapTemplate struct { + KeyTemplate string `json:"keyTemplate"` +} + +type VaultSecretTemplate struct { + KeyTemplate string `json:"keyTemplate"` +} + +type ProvisioningMeta struct { + // Target platform (custom resource name). + // +required + PlatformRef string `json:"platformRef"` + // Business Domain that this resource is provision for. + // +required + DomainRef string `json:"domainRef"` + // Overrides for tenants. Dictionary with tenant name as key, spec override as value. + // The spec override has the same structure as Spec + // +optional + TenantOverrides map[string]*apiextensionsv1.JSON `json:"tenantOverrides,omitempty"` +} + +func (meta *ProvisioningMeta) GetTenantOverrides() map[string]*apiextensionsv1.JSON { + return meta.TenantOverrides +} diff --git a/pkg/apis/provisioning/v1alpha1/exportTypes.go b/pkg/apis/provisioning/v1alpha1/exportTypes.go deleted file mode 100644 index 5e0fde7..0000000 --- a/pkg/apis/provisioning/v1alpha1/exportTypes.go +++ /dev/null @@ -1,16 +0,0 @@ -package v1alpha1 - -type ValueExport struct { - // +optional - ToConfigMap ConfigMapTemplate `json:"toConfigMap,omitempty"` - // +optional - ToVault VaultSecretTemplate `json:"toVault,omitempty"` -} - -type ConfigMapTemplate struct { - KeyTemplate string `json:"keyTemplate"` -} - -type VaultSecretTemplate struct { - KeyTemplate string `json:"keyTemplate"` -} diff --git a/pkg/apis/provisioning/v1alpha1/helmReleaseTypes.go b/pkg/apis/provisioning/v1alpha1/helmReleaseTypes.go index c8d084e..ecc9dcd 100644 --- a/pkg/apis/provisioning/v1alpha1/helmReleaseTypes.go +++ b/pkg/apis/provisioning/v1alpha1/helmReleaseTypes.go @@ -17,16 +17,11 @@ type HelmRelease struct { } type HelmReleaseSpec struct { - // Target platform (custom resource name). - // +required - PlatformRef string `json:"platformRef"` - // Business Domain that this resource is provision for. - // +required - DomainRef string `json:"domainRef"` - // +optional - Exports []HelmReleaseExportsSpec `json:"exports,omitempty"` // helm release spec Release flux.HelmReleaseSpec `json:"release"` + // +optional + Exports []HelmReleaseExportsSpec `json:"exports,omitempty"` + ProvisioningMeta `json:",inline"` } type HelmReleaseExportsSpec struct { @@ -43,3 +38,11 @@ type HelmReleaseList struct { Items []HelmRelease `json:"items"` } + +func (db *HelmRelease) GetProvisioningMeta() *ProvisioningMeta { + return &db.Spec.ProvisioningMeta +} + +func (db *HelmRelease) GetSpec() any { + return &db.Spec +} diff --git a/pkg/apis/provisioning/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/provisioning/v1alpha1/zz_generated.deepcopy.go index dc89c7b..38395d9 100644 --- a/pkg/apis/provisioning/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/provisioning/v1alpha1/zz_generated.deepcopy.go @@ -22,6 +22,7 @@ limitations under the License. package v1alpha1 import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -111,6 +112,7 @@ func (in *AzureDatabaseSpec) DeepCopyInto(out *AzureDatabaseSpec) { *out = make([]AzureDatabaseExportsSpec, len(*in)) copy(*out, *in) } + in.ProvisioningMeta.DeepCopyInto(&out.ProvisioningMeta) return } @@ -228,6 +230,7 @@ func (in *AzureManagedDatabaseSpec) DeepCopyInto(out *AzureManagedDatabaseSpec) *out = make([]AzureManagedDatabaseExportsSpec, len(*in)) copy(*out, *in) } + in.ProvisioningMeta.DeepCopyInto(&out.ProvisioningMeta) return } @@ -388,6 +391,7 @@ func (in *AzureVirtualDesktopSpec) DeepCopyInto(out *AzureVirtualDesktopSpec) { *out = make([]AzureVirtualDesktopExportsSpec, len(*in)) copy(*out, *in) } + in.ProvisioningMeta.DeepCopyInto(&out.ProvisioningMeta) return } @@ -511,6 +515,7 @@ func (in *AzureVirtualMachineList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureVirtualMachineSpec) DeepCopyInto(out *AzureVirtualMachineSpec) { *out = *in + in.ProvisioningMeta.DeepCopyInto(&out.ProvisioningMeta) if in.Exports != nil { in, out := &in.Exports, &out.Exports *out = make([]AzureVirtualMachineExportsSpec, len(*in)) @@ -625,12 +630,13 @@ func (in *HelmReleaseList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HelmReleaseSpec) DeepCopyInto(out *HelmReleaseSpec) { *out = *in + in.Release.DeepCopyInto(&out.Release) if in.Exports != nil { in, out := &in.Exports, &out.Exports *out = make([]HelmReleaseExportsSpec, len(*in)) copy(*out, *in) } - in.Release.DeepCopyInto(&out.Release) + in.ProvisioningMeta.DeepCopyInto(&out.ProvisioningMeta) return } @@ -660,6 +666,37 @@ func (in *InitScriptArgs) DeepCopy() *InitScriptArgs { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProvisioningMeta) DeepCopyInto(out *ProvisioningMeta) { + *out = *in + if in.TenantOverrides != nil { + in, out := &in.TenantOverrides, &out.TenantOverrides + *out = make(map[string]*v1.JSON, len(*in)) + for key, val := range *in { + var outVal *v1.JSON + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(v1.JSON) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProvisioningMeta. +func (in *ProvisioningMeta) DeepCopy() *ProvisioningMeta { + if in == nil { + return nil + } + out := new(ProvisioningMeta) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SqlServerSpec) DeepCopyInto(out *SqlServerSpec) { *out = *in @@ -676,6 +713,37 @@ func (in *SqlServerSpec) DeepCopy() *SqlServerSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenanantOverridesMeta) DeepCopyInto(out *TenanantOverridesMeta) { + *out = *in + if in.TenantOverrides != nil { + in, out := &in.TenantOverrides, &out.TenantOverrides + *out = make(map[string]*v1.JSON, len(*in)) + for key, val := range *in { + var outVal *v1.JSON + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(v1.JSON) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenanantOverridesMeta. +func (in *TenanantOverridesMeta) DeepCopy() *TenanantOverridesMeta { + if in == nil { + return nil + } + out := new(TenanantOverridesMeta) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ValueExport) DeepCopyInto(out *ValueExport) { *out = *in diff --git a/pkg/generated/applyconfiguration/provisioning/v1alpha1/azuredatabasespec.go b/pkg/generated/applyconfiguration/provisioning/v1alpha1/azuredatabasespec.go index 70daf45..4ae3b3c 100644 --- a/pkg/generated/applyconfiguration/provisioning/v1alpha1/azuredatabasespec.go +++ b/pkg/generated/applyconfiguration/provisioning/v1alpha1/azuredatabasespec.go @@ -18,16 +18,19 @@ limitations under the License. package v1alpha1 +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + // AzureDatabaseSpecApplyConfiguration represents an declarative configuration of the AzureDatabaseSpec type for use // with apply. type AzureDatabaseSpecApplyConfiguration struct { - PlatformRef *string `json:"platformRef,omitempty"` - DomainRef *string `json:"domainRef,omitempty"` - DbName *string `json:"dbName,omitempty"` - SqlServer *SqlServerSpecApplyConfiguration `json:"sqlServer,omitempty"` - Sku *string `json:"sku,omitempty"` - SourceDatabaseId *string `json:"sourceDatabaseId,omitempty"` - Exports []AzureDatabaseExportsSpecApplyConfiguration `json:"exports,omitempty"` + DbName *string `json:"dbName,omitempty"` + SqlServer *SqlServerSpecApplyConfiguration `json:"sqlServer,omitempty"` + Sku *string `json:"sku,omitempty"` + SourceDatabaseId *string `json:"sourceDatabaseId,omitempty"` + Exports []AzureDatabaseExportsSpecApplyConfiguration `json:"exports,omitempty"` + ProvisioningMetaApplyConfiguration `json:",inline"` } // AzureDatabaseSpecApplyConfiguration constructs an declarative configuration of the AzureDatabaseSpec type for use with @@ -36,22 +39,6 @@ func AzureDatabaseSpec() *AzureDatabaseSpecApplyConfiguration { return &AzureDatabaseSpecApplyConfiguration{} } -// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PlatformRef field is set to the value of the last call. -func (b *AzureDatabaseSpecApplyConfiguration) WithPlatformRef(value string) *AzureDatabaseSpecApplyConfiguration { - b.PlatformRef = &value - return b -} - -// WithDomainRef sets the DomainRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DomainRef field is set to the value of the last call. -func (b *AzureDatabaseSpecApplyConfiguration) WithDomainRef(value string) *AzureDatabaseSpecApplyConfiguration { - b.DomainRef = &value - return b -} - // WithDbName sets the DbName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DbName field is set to the value of the last call. @@ -96,3 +83,33 @@ func (b *AzureDatabaseSpecApplyConfiguration) WithExports(values ...*AzureDataba } return b } + +// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PlatformRef field is set to the value of the last call. +func (b *AzureDatabaseSpecApplyConfiguration) WithPlatformRef(value string) *AzureDatabaseSpecApplyConfiguration { + b.PlatformRef = &value + return b +} + +// WithDomainRef sets the DomainRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DomainRef field is set to the value of the last call. +func (b *AzureDatabaseSpecApplyConfiguration) WithDomainRef(value string) *AzureDatabaseSpecApplyConfiguration { + b.DomainRef = &value + return b +} + +// WithTenantOverrides puts the entries into the TenantOverrides field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the TenantOverrides field, +// overwriting an existing map entries in TenantOverrides field with the same key. +func (b *AzureDatabaseSpecApplyConfiguration) WithTenantOverrides(entries map[string]*v1.JSON) *AzureDatabaseSpecApplyConfiguration { + if b.TenantOverrides == nil && len(entries) > 0 { + b.TenantOverrides = make(map[string]*v1.JSON, len(entries)) + } + for k, v := range entries { + b.TenantOverrides[k] = v + } + return b +} diff --git a/pkg/generated/applyconfiguration/provisioning/v1alpha1/azuremanageddatabasespec.go b/pkg/generated/applyconfiguration/provisioning/v1alpha1/azuremanageddatabasespec.go index cbcaeb3..8be8b87 100644 --- a/pkg/generated/applyconfiguration/provisioning/v1alpha1/azuremanageddatabasespec.go +++ b/pkg/generated/applyconfiguration/provisioning/v1alpha1/azuremanageddatabasespec.go @@ -18,15 +18,18 @@ limitations under the License. package v1alpha1 +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + // AzureManagedDatabaseSpecApplyConfiguration represents an declarative configuration of the AzureManagedDatabaseSpec type for use // with apply. type AzureManagedDatabaseSpecApplyConfiguration struct { - PlatformRef *string `json:"platformRef,omitempty"` - DomainRef *string `json:"domainRef,omitempty"` - DbName *string `json:"dbName,omitempty"` - ManagedInstance *AzureManagedInstanceSpecApplyConfiguration `json:"managedInstance,omitempty"` - RestoreFrom *AzureManagedDatabaseRestoreSpecApplyConfiguration `json:"restoreFrom,omitempty"` - Exports []AzureManagedDatabaseExportsSpecApplyConfiguration `json:"exports,omitempty"` + DbName *string `json:"dbName,omitempty"` + ManagedInstance *AzureManagedInstanceSpecApplyConfiguration `json:"managedInstance,omitempty"` + RestoreFrom *AzureManagedDatabaseRestoreSpecApplyConfiguration `json:"restoreFrom,omitempty"` + Exports []AzureManagedDatabaseExportsSpecApplyConfiguration `json:"exports,omitempty"` + ProvisioningMetaApplyConfiguration `json:",inline"` } // AzureManagedDatabaseSpecApplyConfiguration constructs an declarative configuration of the AzureManagedDatabaseSpec type for use with @@ -35,22 +38,6 @@ func AzureManagedDatabaseSpec() *AzureManagedDatabaseSpecApplyConfiguration { return &AzureManagedDatabaseSpecApplyConfiguration{} } -// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PlatformRef field is set to the value of the last call. -func (b *AzureManagedDatabaseSpecApplyConfiguration) WithPlatformRef(value string) *AzureManagedDatabaseSpecApplyConfiguration { - b.PlatformRef = &value - return b -} - -// WithDomainRef sets the DomainRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DomainRef field is set to the value of the last call. -func (b *AzureManagedDatabaseSpecApplyConfiguration) WithDomainRef(value string) *AzureManagedDatabaseSpecApplyConfiguration { - b.DomainRef = &value - return b -} - // WithDbName sets the DbName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DbName field is set to the value of the last call. @@ -87,3 +74,33 @@ func (b *AzureManagedDatabaseSpecApplyConfiguration) WithExports(values ...*Azur } return b } + +// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PlatformRef field is set to the value of the last call. +func (b *AzureManagedDatabaseSpecApplyConfiguration) WithPlatformRef(value string) *AzureManagedDatabaseSpecApplyConfiguration { + b.PlatformRef = &value + return b +} + +// WithDomainRef sets the DomainRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DomainRef field is set to the value of the last call. +func (b *AzureManagedDatabaseSpecApplyConfiguration) WithDomainRef(value string) *AzureManagedDatabaseSpecApplyConfiguration { + b.DomainRef = &value + return b +} + +// WithTenantOverrides puts the entries into the TenantOverrides field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the TenantOverrides field, +// overwriting an existing map entries in TenantOverrides field with the same key. +func (b *AzureManagedDatabaseSpecApplyConfiguration) WithTenantOverrides(entries map[string]*v1.JSON) *AzureManagedDatabaseSpecApplyConfiguration { + if b.TenantOverrides == nil && len(entries) > 0 { + b.TenantOverrides = make(map[string]*v1.JSON, len(entries)) + } + for k, v := range entries { + b.TenantOverrides[k] = v + } + return b +} diff --git a/pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualdesktopspec.go b/pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualdesktopspec.go index 4e003fb..3968cd3 100644 --- a/pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualdesktopspec.go +++ b/pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualdesktopspec.go @@ -18,25 +18,28 @@ limitations under the License. package v1alpha1 +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + // AzureVirtualDesktopSpecApplyConfiguration represents an declarative configuration of the AzureVirtualDesktopSpec type for use // with apply. type AzureVirtualDesktopSpecApplyConfiguration struct { - PlatformRef *string `json:"platformRef,omitempty"` - DomainRef *string `json:"domainRef,omitempty"` - HostPoolName *string `json:"hostPoolName,omitempty"` - VmNamePrefix *string `json:"vmNamePrefix,omitempty"` - VmSize *string `json:"vmSize,omitempty"` - VmNumberOfInstances *int `json:"vmNumberOfInstances,omitempty"` - OSDiskType *string `json:"osDiskType,omitempty"` - SourceImageId *string `json:"sourceImageId,omitempty"` - SubnetId *string `json:"subnetId,omitempty"` - EnableTrustedLaunch *bool `json:"enableTrustedLaunch,omitempty"` - InitScript *string `json:"initScript,omitempty"` - InitScriptArguments []InitScriptArgsApplyConfiguration `json:"initScriptArgs,omitempty"` - WorkspaceFriendlyName *string `json:"workspaceFriendlyName,omitempty"` - Applications []AzureVirtualDesktopApplicationApplyConfiguration `json:"applications,omitempty"` - Users *AzureVirtualDesktopUsersSpecApplyConfiguration `json:"users,omitempty"` - Exports []AzureVirtualDesktopExportsSpecApplyConfiguration `json:"exports,omitempty"` + HostPoolName *string `json:"hostPoolName,omitempty"` + VmNamePrefix *string `json:"vmNamePrefix,omitempty"` + VmSize *string `json:"vmSize,omitempty"` + VmNumberOfInstances *int `json:"vmNumberOfInstances,omitempty"` + OSDiskType *string `json:"osDiskType,omitempty"` + SourceImageId *string `json:"sourceImageId,omitempty"` + SubnetId *string `json:"subnetId,omitempty"` + EnableTrustedLaunch *bool `json:"enableTrustedLaunch,omitempty"` + InitScript *string `json:"initScript,omitempty"` + InitScriptArguments []InitScriptArgsApplyConfiguration `json:"initScriptArgs,omitempty"` + WorkspaceFriendlyName *string `json:"workspaceFriendlyName,omitempty"` + Applications []AzureVirtualDesktopApplicationApplyConfiguration `json:"applications,omitempty"` + Users *AzureVirtualDesktopUsersSpecApplyConfiguration `json:"users,omitempty"` + Exports []AzureVirtualDesktopExportsSpecApplyConfiguration `json:"exports,omitempty"` + ProvisioningMetaApplyConfiguration `json:",inline"` } // AzureVirtualDesktopSpecApplyConfiguration constructs an declarative configuration of the AzureVirtualDesktopSpec type for use with @@ -45,22 +48,6 @@ func AzureVirtualDesktopSpec() *AzureVirtualDesktopSpecApplyConfiguration { return &AzureVirtualDesktopSpecApplyConfiguration{} } -// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PlatformRef field is set to the value of the last call. -func (b *AzureVirtualDesktopSpecApplyConfiguration) WithPlatformRef(value string) *AzureVirtualDesktopSpecApplyConfiguration { - b.PlatformRef = &value - return b -} - -// WithDomainRef sets the DomainRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DomainRef field is set to the value of the last call. -func (b *AzureVirtualDesktopSpecApplyConfiguration) WithDomainRef(value string) *AzureVirtualDesktopSpecApplyConfiguration { - b.DomainRef = &value - return b -} - // WithHostPoolName sets the HostPoolName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the HostPoolName field is set to the value of the last call. @@ -187,3 +174,33 @@ func (b *AzureVirtualDesktopSpecApplyConfiguration) WithExports(values ...*Azure } return b } + +// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PlatformRef field is set to the value of the last call. +func (b *AzureVirtualDesktopSpecApplyConfiguration) WithPlatformRef(value string) *AzureVirtualDesktopSpecApplyConfiguration { + b.PlatformRef = &value + return b +} + +// WithDomainRef sets the DomainRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DomainRef field is set to the value of the last call. +func (b *AzureVirtualDesktopSpecApplyConfiguration) WithDomainRef(value string) *AzureVirtualDesktopSpecApplyConfiguration { + b.DomainRef = &value + return b +} + +// WithTenantOverrides puts the entries into the TenantOverrides field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the TenantOverrides field, +// overwriting an existing map entries in TenantOverrides field with the same key. +func (b *AzureVirtualDesktopSpecApplyConfiguration) WithTenantOverrides(entries map[string]*v1.JSON) *AzureVirtualDesktopSpecApplyConfiguration { + if b.TenantOverrides == nil && len(entries) > 0 { + b.TenantOverrides = make(map[string]*v1.JSON, len(entries)) + } + for k, v := range entries { + b.TenantOverrides[k] = v + } + return b +} diff --git a/pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualmachinespec.go b/pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualmachinespec.go index a84ce34..d57c6d5 100644 --- a/pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualmachinespec.go +++ b/pkg/generated/applyconfiguration/provisioning/v1alpha1/azurevirtualmachinespec.go @@ -18,19 +18,22 @@ limitations under the License. package v1alpha1 +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + // AzureVirtualMachineSpecApplyConfiguration represents an declarative configuration of the AzureVirtualMachineSpec type for use // with apply. type AzureVirtualMachineSpecApplyConfiguration struct { - PlatformRef *string `json:"platformRef,omitempty"` - DomainRef *string `json:"domainRef,omitempty"` - VmName *string `json:"vmName,omitempty"` - VmSize *string `json:"vmSize,omitempty"` - OSDiskType *string `json:"osDiskType,omitempty"` - SourceImageId *string `json:"sourceImageId,omitempty"` - SubnetId *string `json:"subnetId,omitempty"` - RdpSourceAddressPrefix *string `json:"rdpSourceAddressPrefix,omitempty"` - EnableTrustedLaunch *bool `json:"enableTrustedLaunch,omitempty"` - Exports []AzureVirtualMachineExportsSpecApplyConfiguration `json:"exports,omitempty"` + VmName *string `json:"vmName,omitempty"` + VmSize *string `json:"vmSize,omitempty"` + OSDiskType *string `json:"osDiskType,omitempty"` + SourceImageId *string `json:"sourceImageId,omitempty"` + SubnetId *string `json:"subnetId,omitempty"` + RdpSourceAddressPrefix *string `json:"rdpSourceAddressPrefix,omitempty"` + EnableTrustedLaunch *bool `json:"enableTrustedLaunch,omitempty"` + ProvisioningMetaApplyConfiguration `json:",inline"` + Exports []AzureVirtualMachineExportsSpecApplyConfiguration `json:"exports,omitempty"` } // AzureVirtualMachineSpecApplyConfiguration constructs an declarative configuration of the AzureVirtualMachineSpec type for use with @@ -39,22 +42,6 @@ func AzureVirtualMachineSpec() *AzureVirtualMachineSpecApplyConfiguration { return &AzureVirtualMachineSpecApplyConfiguration{} } -// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PlatformRef field is set to the value of the last call. -func (b *AzureVirtualMachineSpecApplyConfiguration) WithPlatformRef(value string) *AzureVirtualMachineSpecApplyConfiguration { - b.PlatformRef = &value - return b -} - -// WithDomainRef sets the DomainRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DomainRef field is set to the value of the last call. -func (b *AzureVirtualMachineSpecApplyConfiguration) WithDomainRef(value string) *AzureVirtualMachineSpecApplyConfiguration { - b.DomainRef = &value - return b -} - // WithVmName sets the VmName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the VmName field is set to the value of the last call. @@ -111,6 +98,36 @@ func (b *AzureVirtualMachineSpecApplyConfiguration) WithEnableTrustedLaunch(valu return b } +// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PlatformRef field is set to the value of the last call. +func (b *AzureVirtualMachineSpecApplyConfiguration) WithPlatformRef(value string) *AzureVirtualMachineSpecApplyConfiguration { + b.PlatformRef = &value + return b +} + +// WithDomainRef sets the DomainRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DomainRef field is set to the value of the last call. +func (b *AzureVirtualMachineSpecApplyConfiguration) WithDomainRef(value string) *AzureVirtualMachineSpecApplyConfiguration { + b.DomainRef = &value + return b +} + +// WithTenantOverrides puts the entries into the TenantOverrides field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the TenantOverrides field, +// overwriting an existing map entries in TenantOverrides field with the same key. +func (b *AzureVirtualMachineSpecApplyConfiguration) WithTenantOverrides(entries map[string]*v1.JSON) *AzureVirtualMachineSpecApplyConfiguration { + if b.TenantOverrides == nil && len(entries) > 0 { + b.TenantOverrides = make(map[string]*v1.JSON, len(entries)) + } + for k, v := range entries { + b.TenantOverrides[k] = v + } + return b +} + // WithExports adds the given value to the Exports field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Exports field. diff --git a/pkg/generated/applyconfiguration/provisioning/v1alpha1/helmreleasespec.go b/pkg/generated/applyconfiguration/provisioning/v1alpha1/helmreleasespec.go index 02dd2cc..f477795 100644 --- a/pkg/generated/applyconfiguration/provisioning/v1alpha1/helmreleasespec.go +++ b/pkg/generated/applyconfiguration/provisioning/v1alpha1/helmreleasespec.go @@ -20,15 +20,15 @@ package v1alpha1 import ( v2beta1 "github.com/fluxcd/helm-controller/api/v2beta1" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" ) // HelmReleaseSpecApplyConfiguration represents an declarative configuration of the HelmReleaseSpec type for use // with apply. type HelmReleaseSpecApplyConfiguration struct { - PlatformRef *string `json:"platformRef,omitempty"` - DomainRef *string `json:"domainRef,omitempty"` - Exports []HelmReleaseExportsSpecApplyConfiguration `json:"exports,omitempty"` - Release *v2beta1.HelmReleaseSpec `json:"release,omitempty"` + Release *v2beta1.HelmReleaseSpec `json:"release,omitempty"` + Exports []HelmReleaseExportsSpecApplyConfiguration `json:"exports,omitempty"` + ProvisioningMetaApplyConfiguration `json:",inline"` } // HelmReleaseSpecApplyConfiguration constructs an declarative configuration of the HelmReleaseSpec type for use with @@ -37,19 +37,11 @@ func HelmReleaseSpec() *HelmReleaseSpecApplyConfiguration { return &HelmReleaseSpecApplyConfiguration{} } -// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PlatformRef field is set to the value of the last call. -func (b *HelmReleaseSpecApplyConfiguration) WithPlatformRef(value string) *HelmReleaseSpecApplyConfiguration { - b.PlatformRef = &value - return b -} - -// WithDomainRef sets the DomainRef field in the declarative configuration to the given value +// WithRelease sets the Release field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DomainRef field is set to the value of the last call. -func (b *HelmReleaseSpecApplyConfiguration) WithDomainRef(value string) *HelmReleaseSpecApplyConfiguration { - b.DomainRef = &value +// If called multiple times, the Release field is set to the value of the last call. +func (b *HelmReleaseSpecApplyConfiguration) WithRelease(value v2beta1.HelmReleaseSpec) *HelmReleaseSpecApplyConfiguration { + b.Release = &value return b } @@ -66,10 +58,32 @@ func (b *HelmReleaseSpecApplyConfiguration) WithExports(values ...*HelmReleaseEx return b } -// WithRelease sets the Release field in the declarative configuration to the given value +// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Release field is set to the value of the last call. -func (b *HelmReleaseSpecApplyConfiguration) WithRelease(value v2beta1.HelmReleaseSpec) *HelmReleaseSpecApplyConfiguration { - b.Release = &value +// If called multiple times, the PlatformRef field is set to the value of the last call. +func (b *HelmReleaseSpecApplyConfiguration) WithPlatformRef(value string) *HelmReleaseSpecApplyConfiguration { + b.PlatformRef = &value + return b +} + +// WithDomainRef sets the DomainRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DomainRef field is set to the value of the last call. +func (b *HelmReleaseSpecApplyConfiguration) WithDomainRef(value string) *HelmReleaseSpecApplyConfiguration { + b.DomainRef = &value + return b +} + +// WithTenantOverrides puts the entries into the TenantOverrides field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the TenantOverrides field, +// overwriting an existing map entries in TenantOverrides field with the same key. +func (b *HelmReleaseSpecApplyConfiguration) WithTenantOverrides(entries map[string]*v1.JSON) *HelmReleaseSpecApplyConfiguration { + if b.TenantOverrides == nil && len(entries) > 0 { + b.TenantOverrides = make(map[string]*v1.JSON, len(entries)) + } + for k, v := range entries { + b.TenantOverrides[k] = v + } return b } diff --git a/pkg/generated/applyconfiguration/provisioning/v1alpha1/provisioningmeta.go b/pkg/generated/applyconfiguration/provisioning/v1alpha1/provisioningmeta.go new file mode 100644 index 0000000..13706a0 --- /dev/null +++ b/pkg/generated/applyconfiguration/provisioning/v1alpha1/provisioningmeta.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// ProvisioningMetaApplyConfiguration represents an declarative configuration of the ProvisioningMeta type for use +// with apply. +type ProvisioningMetaApplyConfiguration struct { + PlatformRef *string `json:"platformRef,omitempty"` + DomainRef *string `json:"domainRef,omitempty"` + TenantOverrides map[string]*v1.JSON `json:"tenantOverrides,omitempty"` +} + +// ProvisioningMetaApplyConfiguration constructs an declarative configuration of the ProvisioningMeta type for use with +// apply. +func ProvisioningMeta() *ProvisioningMetaApplyConfiguration { + return &ProvisioningMetaApplyConfiguration{} +} + +// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PlatformRef field is set to the value of the last call. +func (b *ProvisioningMetaApplyConfiguration) WithPlatformRef(value string) *ProvisioningMetaApplyConfiguration { + b.PlatformRef = &value + return b +} + +// WithDomainRef sets the DomainRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DomainRef field is set to the value of the last call. +func (b *ProvisioningMetaApplyConfiguration) WithDomainRef(value string) *ProvisioningMetaApplyConfiguration { + b.DomainRef = &value + return b +} + +// WithTenantOverrides puts the entries into the TenantOverrides field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the TenantOverrides field, +// overwriting an existing map entries in TenantOverrides field with the same key. +func (b *ProvisioningMetaApplyConfiguration) WithTenantOverrides(entries map[string]*v1.JSON) *ProvisioningMetaApplyConfiguration { + if b.TenantOverrides == nil && len(entries) > 0 { + b.TenantOverrides = make(map[string]*v1.JSON, len(entries)) + } + for k, v := range entries { + b.TenantOverrides[k] = v + } + return b +} diff --git a/pkg/generated/applyconfiguration/provisioning/v1alpha1/provisioningspecmeta.go b/pkg/generated/applyconfiguration/provisioning/v1alpha1/provisioningspecmeta.go new file mode 100644 index 0000000..8e5f37f --- /dev/null +++ b/pkg/generated/applyconfiguration/provisioning/v1alpha1/provisioningspecmeta.go @@ -0,0 +1,81 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// ProvisioningSpecMetaApplyConfiguration represents an declarative configuration of the ProvisioningSpecMeta type for use +// with apply. +type ProvisioningSpecMetaApplyConfiguration struct { + PlatformRef *string `json:"platformRef,omitempty"` + DomainRef *string `json:"domainRef,omitempty"` + Exports []AzureManagedDatabaseExportsSpecApplyConfiguration `json:"exports,omitempty"` + TenantOverrides map[string]*v1.JSON `json:"tenantOverrides,omitempty"` +} + +// ProvisioningSpecMetaApplyConfiguration constructs an declarative configuration of the ProvisioningSpecMeta type for use with +// apply. +func ProvisioningSpecMeta() *ProvisioningSpecMetaApplyConfiguration { + return &ProvisioningSpecMetaApplyConfiguration{} +} + +// WithPlatformRef sets the PlatformRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PlatformRef field is set to the value of the last call. +func (b *ProvisioningSpecMetaApplyConfiguration) WithPlatformRef(value string) *ProvisioningSpecMetaApplyConfiguration { + b.PlatformRef = &value + return b +} + +// WithDomainRef sets the DomainRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DomainRef field is set to the value of the last call. +func (b *ProvisioningSpecMetaApplyConfiguration) WithDomainRef(value string) *ProvisioningSpecMetaApplyConfiguration { + b.DomainRef = &value + return b +} + +// WithExports adds the given value to the Exports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Exports field. +func (b *ProvisioningSpecMetaApplyConfiguration) WithExports(values ...*AzureManagedDatabaseExportsSpecApplyConfiguration) *ProvisioningSpecMetaApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithExports") + } + b.Exports = append(b.Exports, *values[i]) + } + return b +} + +// WithTenantOverrides puts the entries into the TenantOverrides field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the TenantOverrides field, +// overwriting an existing map entries in TenantOverrides field with the same key. +func (b *ProvisioningSpecMetaApplyConfiguration) WithTenantOverrides(entries map[string]*v1.JSON) *ProvisioningSpecMetaApplyConfiguration { + if b.TenantOverrides == nil && len(entries) > 0 { + b.TenantOverrides = make(map[string]*v1.JSON, len(entries)) + } + for k, v := range entries { + b.TenantOverrides[k] = v + } + return b +} diff --git a/pkg/generated/applyconfiguration/utils.go b/pkg/generated/applyconfiguration/utils.go index 8663c87..8f37690 100644 --- a/pkg/generated/applyconfiguration/utils.go +++ b/pkg/generated/applyconfiguration/utils.go @@ -107,6 +107,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationprovisioningv1alpha1.HelmReleaseSpecApplyConfiguration{} case provisioningv1alpha1.SchemeGroupVersion.WithKind("InitScriptArgs"): return &applyconfigurationprovisioningv1alpha1.InitScriptArgsApplyConfiguration{} + case provisioningv1alpha1.SchemeGroupVersion.WithKind("ProvisioningMeta"): + return &applyconfigurationprovisioningv1alpha1.ProvisioningMetaApplyConfiguration{} case provisioningv1alpha1.SchemeGroupVersion.WithKind("SqlServerSpec"): return &applyconfigurationprovisioningv1alpha1.SqlServerSpecApplyConfiguration{} case provisioningv1alpha1.SchemeGroupVersion.WithKind("ValueExport"):