From f8316499d0c6b61e356e374a3bd5fb7e29962739 Mon Sep 17 00:00:00 2001 From: Gerd Oberlechner Date: Thu, 28 Nov 2024 00:10:12 +0100 Subject: [PATCH] cleanup remove the PreprocessFileForEV2SystemVars, PreprocessFileForEV2ScopeBinding helper functions they are of little use now that we have the PrecompilePipelineForEV2 functions Signed-off-by: Gerd Oberlechner --- tooling/demo/ScopeBinding.json | 351 ------------------ tooling/demo/ServiceConfig copy.json | 108 ------ tooling/demo/ServiceConfig.json | 108 ------ tooling/templatize/pkg/ev2/utils.go | 24 -- tooling/templatize/pkg/ev2/utils_test.go | 19 - ...reprocessFileForEV2ScopeBinding.bicepparam | 10 - ...re_TestPreprocessFileForEV2SystemVars.yaml | 24 -- .../zz_fixture_TestPreprocessFilebicepparam | 10 - 8 files changed, 654 deletions(-) delete mode 100644 tooling/demo/ScopeBinding.json delete mode 100644 tooling/demo/ServiceConfig copy.json delete mode 100644 tooling/demo/ServiceConfig.json delete mode 100644 tooling/templatize/testdata/zz_fixture_TestPreprocessFileForEV2ScopeBinding.bicepparam delete mode 100644 tooling/templatize/testdata/zz_fixture_TestPreprocessFileForEV2SystemVars.yaml delete mode 100644 tooling/templatize/testdata/zz_fixture_TestPreprocessFilebicepparam diff --git a/tooling/demo/ScopeBinding.json b/tooling/demo/ScopeBinding.json deleted file mode 100644 index 5fa2a5f39..000000000 --- a/tooling/demo/ScopeBinding.json +++ /dev/null @@ -1,351 +0,0 @@ -{ - "$schema": "https://ev2schema.azure.net/schemas/2020-01-01/scopeBindings.json", - "contentVersion": "1.0.0.0", - "scopeBindings": [ - { - "scopeTagName": "test", - "bindings": [ - { - "find": "__CXKEYVAULTSOFTDELETE__", - "replaceWith": "$config(cxKeyVaultSoftDelete)" - }, - { - "find": "__GRAFANAADMINGROUPPRINCIPALID__", - "replaceWith": "$config(grafanaAdminGroupPrincipalId)" - }, - { - "find": "__CLUSTERSERVICEIMAGETAG__", - "replaceWith": "$config(clusterServiceImageTag)" - }, - { - "find": "__CXKEYVAULTNAME__", - "replaceWith": "$config(cxKeyVaultName)" - }, - { - "find": "__MAESTROEVENTGRIDMAXCLIENTSESSIONSPERAUTHNAME__", - "replaceWith": "$config(maestroEventGridMaxClientSessionsPerAuthName)" - }, - { - "find": "__REGIONALDNSSUBDOMAIN__", - "replaceWith": "$config(regionalDNSSubdomain)" - }, - { - "find": "__MSIKEYVAULTPRIVATE__", - "replaceWith": "$config(msiKeyVaultPrivate)" - }, - { - "find": "__EXTERNALDNSIMAGETAG__", - "replaceWith": "$config(externalDNSImageTag)" - }, - { - "find": "__AKSNAME__", - "replaceWith": "$config(aksName)" - }, - { - "find": "__FIRSTPARTYAPPCLIENTID__", - "replaceWith": "$config(firstPartyAppClientId)" - }, - { - "find": "__BASEDNSZONERG__", - "replaceWith": "$config(baseDnsZoneRG)" - }, - { - "find": "__SERVICECOMPONENTACRRESOURCEGROUPS__", - "replaceWith": "$config(serviceComponentAcrResourceGroups)" - }, - { - "find": "__MGMTUSERAGENTPOOLMAXCOUNT__", - "replaceWith": "$config(mgmtUserAgentPoolMaxCount)" - }, - { - "find": "__SVCETCDKVSOFTDELETE__", - "replaceWith": "$config(svcEtcdKVSoftDelete)" - }, - { - "find": "__SERVICECLUSTERRG__", - "replaceWith": "$config(serviceClusterRG)" - }, - { - "find": "__MAESTROEVENTGRIDNAME__", - "replaceWith": "$config(maestroEventgridName)" - }, - { - "find": "__HYPERSHIFTOPERATORIMAGETAG__", - "replaceWith": "$config(hypershiftOperatorImageTag)" - }, - { - "find": "__MAESTROCONSUMERNAME__", - "replaceWith": "$config(maestroConsumerName)" - }, - { - "find": "__ARODEVOPSMSIID__", - "replaceWith": "$config(aroDevopsMsiId)" - }, - { - "find": "__GRAFANANAME__", - "replaceWith": "$config(grafanaName)" - }, - { - "find": "__MAESTROPOSTGRESSERVERVERSION__", - "replaceWith": "$config(maestroPostgresServerVersion)" - }, - { - "find": "__FRONTENDCOSMOSDBDISABLELOCALAUTH__", - "replaceWith": "$config(frontendCosmosDBDisableLocalAuth)" - }, - { - "find": "__SVCACRNAME__", - "replaceWith": "$config(svcAcrName)" - }, - { - "find": "__MAESTROPOSTGRESDEPLOY__", - "replaceWith": "$config(maestroPostgresDeploy)" - }, - { - "find": "__MGMTSYSTEMAGENTPOOLVMSIZE__", - "replaceWith": "$config(mgmtSystemAgentPoolVmSize)" - }, - { - "find": "__MAESTROIMAGETAG__", - "replaceWith": "$config(maestroImageTag)" - }, - { - "find": "__IMAGESYNCRG__", - "replaceWith": "$config(imageSyncRG)" - }, - { - "find": "__MANAGEMENTCLUSTERRG__", - "replaceWith": "$config(managementClusterRG)" - }, - { - "find": "__MGMTUSERAGENTPOOLOSDISKSIZEGB__", - "replaceWith": "$config(mgmtUserAgentPoolOsDiskSizeGB)" - }, - { - "find": "__MGMTETCDKVNAME__", - "replaceWith": "$config(mgmtEtcdKVName)" - }, - { - "find": "__CLUSTERSERVICEPOSTGRESPRIVATE__", - "replaceWith": "$config(clusterServicePostgresPrivate)" - }, - { - "find": "__SERVICEKEYVAULTREGION__", - "replaceWith": "$config(serviceKeyVaultRegion)" - }, - { - "find": "__SERVICEKEYVAULTSOFTDELETE__", - "replaceWith": "$config(serviceKeyVaultSoftDelete)" - }, - { - "find": "__MONITORINGMSINAME__", - "replaceWith": "$config(monitoringMsiName)" - }, - { - "find": "__IMAGESYNCIMAGETAG__", - "replaceWith": "$config(imageSyncImageTag)" - }, - { - "find": "__FRONTENDCOSMOSDBNAME__", - "replaceWith": "$config(frontendCosmosDBName)" - }, - { - "find": "__VNETADDRESSPREFIX__", - "replaceWith": "$config(vnetAddressPrefix)" - }, - { - "find": "__REGIONRG__", - "replaceWith": "$config(regionRG)" - }, - { - "find": "__MSIKEYVAULTSOFTDELETE__", - "replaceWith": "$config(msiKeyVaultSoftDelete)" - }, - { - "find": "__KUBERNETESVERSION__", - "replaceWith": "$config(kubernetesVersion)" - }, - { - "find": "__SERVICEKEYVAULTNAME__", - "replaceWith": "$config(serviceKeyVaultName)" - }, - { - "find": "__MAESTROCERTDOMAIN__", - "replaceWith": "$config(maestroCertDomain)" - }, - { - "find": "__MGMTUSERAGENTPOOLAZCOUNT__", - "replaceWith": "$config(mgmtUserAgentPoolAzCount)" - }, - { - "find": "__MGMTKEYVAULTPRIVATE__", - "replaceWith": "$config(mgmtKeyVaultPrivate)" - }, - { - "find": "__SERVICEKEYVAULTRG__", - "replaceWith": "$config(serviceKeyVaultRG)" - }, - { - "find": "__MONITORINGWORKSPACENAME__", - "replaceWith": "$config(monitoringWorkspaceName)" - }, - { - "find": "__MAESTROKEYVAULTNAME__", - "replaceWith": "$config(maestroKeyVaultName)" - }, - { - "find": "__MAESTROPOSTGRESPRIVATE__", - "replaceWith": "$config(maestroPostgresPrivate)" - }, - { - "find": "__SERVICEKEYVAULTPRIVATE__", - "replaceWith": "$config(serviceKeyVaultPrivate)" - }, - { - "find": "__MGMTKEYVAULTNAME__", - "replaceWith": "$config(mgmtKeyVaultName)" - }, - { - "find": "__MGMTSYSTEMAGENTPOOLMINCOUNT__", - "replaceWith": "$config(mgmtSystemAgentPoolMinCount)" - }, - { - "find": "__CLUSTERSERVICEPOSTGRESNAME__", - "replaceWith": "$config(clusterServicePostgresName)" - }, - { - "find": "__GLOBALRG__", - "replaceWith": "$config(globalRG)" - }, - { - "find": "__IMAGESYNCENVIRONMENTNAME__", - "replaceWith": "$config(imageSyncEnvironmentName)" - }, - { - "find": "__CLUSTERSERVICEACRRG__", - "replaceWith": "$config(clusterServiceAcrRG)" - }, - { - "find": "__OCMIRRORIMAGETAG__", - "replaceWith": "$config(ocMirrorImageTag)" - }, - { - "find": "__IMAGESYNCREPOSITORIES__", - "replaceWith": "$config(imageSyncRepositories)" - }, - { - "find": "__OCPACRNAME__", - "replaceWith": "$config(ocpAcrName)" - }, - { - "find": "__CXKEYVAULTPRIVATE__", - "replaceWith": "$config(cxKeyVaultPrivate)" - }, - { - "find": "__REGION__", - "replaceWith": "$config(region)" - }, - { - "find": "__FRONTENDCOSMOSDBDEPLOY__", - "replaceWith": "$config(frontendCosmosDBDeploy)" - }, - { - "find": "__CLUSTERSERVICEPOSTGRESDEPLOY__", - "replaceWith": "$config(clusterServicePostgresDeploy)" - }, - { - "find": "__MAESTRORESTRICTISTIOINGRESS__", - "replaceWith": "$config(maestroRestrictIstioIngress)" - }, - { - "find": "__MGMTSYSTEMAGENTPOOLOSDISKSIZEGB__", - "replaceWith": "$config(mgmtSystemAgentPoolOsDiskSizeGB)" - }, - { - "find": "__IMAGESYNCACRRG__", - "replaceWith": "$config(imageSyncAcrRG)" - }, - { - "find": "__MGMTKEYVAULTSOFTDELETE__", - "replaceWith": "$config(mgmtKeyVaultSoftDelete)" - }, - { - "find": "__SVCETCDKVNAME__", - "replaceWith": "$config(svcEtcdKVName)" - }, - { - "find": "__MGMTUSERAGENTPOOLMINCOUNT__", - "replaceWith": "$config(mgmtUserAgentPoolMinCount)" - }, - { - "find": "__BASEDNSZONENAME__", - "replaceWith": "$config(baseDnsZoneName)" - }, - { - "find": "__ISTIOVERSION__", - "replaceWith": "$config(istioVersion)" - }, - { - "find": "__CLUSTERSERVICEIMAGEREPO__", - "replaceWith": "$config(clusterServiceImageRepo)" - }, - { - "find": "__MSIKEYVAULTNAME__", - "replaceWith": "$config(msiKeyVaultName)" - }, - { - "find": "__ACRNAME__", - "replaceWith": "$config(acrName)" - }, - { - "find": "__OCMIRRORIMAGEREPO__", - "replaceWith": "$config(ocMirrorImageRepo)" - }, - { - "find": "__IMAGESYNCIMAGEREPO__", - "replaceWith": "$config(imageSyncImageRepo)" - }, - { - "find": "__MGMTSYSTEMAGENTPOOLMAXCOUNT__", - "replaceWith": "$config(mgmtSystemAgentPoolMaxCount)" - }, - { - "find": "__SUBNETPREFIX__", - "replaceWith": "$config(subnetPrefix)" - }, - { - "find": "__MAESTROIMAGEBASE__", - "replaceWith": "$config(maestroImageBase)" - }, - { - "find": "__PARENT_CHILD__", - "replaceWith": "$config(parent.child)" - }, - { - "find": "__MGMTETCDKVSOFTDELETE__", - "replaceWith": "$config(mgmtEtcdKVSoftDelete)" - }, - { - "find": "__OIDCSTORAGEACCOUNTNAME__", - "replaceWith": "$config(oidcStorageAccountName)" - }, - { - "find": "__MAESTROPOSTGRESNAME__", - "replaceWith": "$config(maestroPostgresName)" - }, - { - "find": "__MAESTROPOSTGRESSERVERSTORAGESIZEGB__", - "replaceWith": "$config(maestroPostgresServerStorageSizeGB)" - }, - { - "find": "__PODSUBNETPREFIX__", - "replaceWith": "$config(podSubnetPrefix)" - }, - { - "find": "__MGMTUSERAGENTPOOLVMSIZE__", - "replaceWith": "$config(mgmtUserAgentPoolVmSize)" - } - ] - } - ] - } diff --git a/tooling/demo/ServiceConfig copy.json b/tooling/demo/ServiceConfig copy.json deleted file mode 100644 index 03fbd850a..000000000 --- a/tooling/demo/ServiceConfig copy.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "Settings": { - "acrName": "arohcpdev", - "aksName": "aro-hcp-aks", - "aroDevopsMsiId": "/subscriptions/1d3378d3-5a3f-4712-85a1-2485495dfc4b/resourceGroups/global/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aro-hcp-devops", - "baseDnsZoneName": "hcp.osadev.cloud", - "baseDnsZoneRG": "global", - "clusterServiceAcrRG": "global", - "clusterServiceImageRepo": "app-sre/uhc-clusters-service", - "clusterServiceImageTag": "a23276d", - "clusterServicePostgresDeploy": "true", - "clusterServicePostgresName": "cs-$config(regionShortName)", - "clusterServicePostgresPrivate": "false", - "cxKeyVaultName": "aro-hcp-cx-$config(regionShortName)-$stamp()", - "cxKeyVaultPrivate": "false", - "cxKeyVaultSoftDelete": "false", - "externalDNSImageTag": "v0.14.2", - "firstPartyAppClientId": "57e54810-3138-4f38-bd3b-29cb33f4c358", - "frontendCosmosDBDeploy": "true", - "frontendCosmosDBDisableLocalAuth": "true", - "frontendCosmosDBName": "aro-hcp-rp-$config(regionShortName)", - "globalRG": "global", - "grafanaAdminGroupPrincipalId": "6b6d3adf-8476-4727-9812-20ffdef2b85c", - "grafanaName": "aro-hcp-grafana-$config(regionShortName)", - "hypershiftOperatorImageTag": "99a256f", - "imageSyncAcrRG": "global", - "imageSyncEnvironmentName": "aro-hcp-image-sync", - "imageSyncImageRepo": "image-sync/component-sync", - "imageSyncImageTag": "latest", - "imageSyncRG": "hcp-underlay-westus3-imagesync-dev", - "imageSyncRepositories": "registry.k8s.io/external-dns/external-dns,quay.io/acm-d/rhtap-hypershift-operator,quay.io/app-sre/uhc-clusters-service,quay.io/package-operator/package-operator-package", - "istioVersion": "['asm-1-22']", - "kubernetesVersion": "1.30.5", - "maestroCertDomain": "selfsigned.maestro.keyvault.azure.com", - "maestroConsumerName": "hcp-underlay-$config(regionShortName)-mgmt-$stamp()", - "maestroEventGridMaxClientSessionsPerAuthName": "4", - "maestroEventgridName": "maestro-$config(regionShortName)", - "maestroImageBase": "quay.io/redhat-user-workloads/maestro-rhtap-tenant/maestro/maestro", - "maestroImageTag": "ea066c250a002f0cc458711945165591bc9f6d3f", - "maestroKeyVaultName": "maestro-$config(regionShortName)", - "maestroPostgresDeploy": "false", - "maestroPostgresName": "maestro-$config(regionShortName)", - "maestroPostgresPrivate": "false", - "maestroPostgresServerStorageSizeGB": "32", - "maestroPostgresServerVersion": "15", - "maestroRestrictIstioIngress": "true", - "managementClusterRG": "hcp-underlay-$config(regionShortName)-mgmt-$stamp()", - "mgmtEtcdKVName": "aro-hcp-etcd-$config(regionShortName)-$stamp()", - "mgmtEtcdKVSoftDelete": "false", - "mgmtKeyVaultName": "aro-hcp-mgmt-$config(regionShortName)-$stamp()", - "mgmtKeyVaultPrivate": "false", - "mgmtKeyVaultSoftDelete": "false", - "mgmtSystemAgentPoolMaxCount": "4", - "mgmtSystemAgentPoolMinCount": "1", - "mgmtSystemAgentPoolOsDiskSizeGB": "32", - "mgmtSystemAgentPoolVmSize": "Standard_D2s_v3", - "mgmtUserAgentPoolAzCount": "3", - "mgmtUserAgentPoolMaxCount": "12", - "mgmtUserAgentPoolMinCount": "2", - "mgmtUserAgentPoolOsDiskSizeGB": "100", - "mgmtUserAgentPoolVmSize": "Standard_D4s_v3", - "monitoringMsiName": "aro-hcp-metrics-msi-$config(regionShortName)", - "monitoringWorkspaceName": "aro-hcp-monitor-$config(regionShortName)", - "msiKeyVaultName": "aro-hcp-msi-$config(regionShortName)-$stamp()", - "msiKeyVaultPrivate": "false", - "msiKeyVaultSoftDelete": "false", - "ocMirrorImageRepo": "image-sync/oc-mirror", - "ocMirrorImageTag": "7abc8af", - "ocpAcrName": "arohcpocpdev", - "oidcStorageAccountName": "arohcpoidc$config(regionShortName)", - "parent": { - "child": "bla" - }, - "podSubnetPrefix": "10.128.64.0/18", - "region": "$location()", - "regionRG": "hcp-underlay-$config(regionShortName)", - "regionalDNSSubdomain": "$location()", - "serviceClusterRG": "hcp-underlay-$config(regionShortName)-svc", - "serviceComponentAcrResourceGroups": "global", - "serviceKeyVaultName": "aro-hcp-dev-svc-kv", - "serviceKeyVaultPrivate": "false", - "serviceKeyVaultRG": "global", - "serviceKeyVaultRegion": "westus3", - "serviceKeyVaultSoftDelete": "true", - "subnetPrefix": "10.128.8.0/21", - "svcAcrName": "arohcpsvcdev", - "svcEtcdKVName": "aro-hcp-etcd-$config(regionShortName)", - "svcEtcdKVSoftDelete": "false", - "vnetAddressPrefix": "10.128.0.0/14" - }, - "Geographies": [ - { - "Name": "United States", - "Settings": {}, - "Regions": [ - { - "Name": "westus3", - "Settings": { - "parent": { - "child": "bla" - }, - "mgmtUserAgentPoolMinCount": "5" - } - } - ] - } - ] - } diff --git a/tooling/demo/ServiceConfig.json b/tooling/demo/ServiceConfig.json deleted file mode 100644 index 03fbd850a..000000000 --- a/tooling/demo/ServiceConfig.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "Settings": { - "acrName": "arohcpdev", - "aksName": "aro-hcp-aks", - "aroDevopsMsiId": "/subscriptions/1d3378d3-5a3f-4712-85a1-2485495dfc4b/resourceGroups/global/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aro-hcp-devops", - "baseDnsZoneName": "hcp.osadev.cloud", - "baseDnsZoneRG": "global", - "clusterServiceAcrRG": "global", - "clusterServiceImageRepo": "app-sre/uhc-clusters-service", - "clusterServiceImageTag": "a23276d", - "clusterServicePostgresDeploy": "true", - "clusterServicePostgresName": "cs-$config(regionShortName)", - "clusterServicePostgresPrivate": "false", - "cxKeyVaultName": "aro-hcp-cx-$config(regionShortName)-$stamp()", - "cxKeyVaultPrivate": "false", - "cxKeyVaultSoftDelete": "false", - "externalDNSImageTag": "v0.14.2", - "firstPartyAppClientId": "57e54810-3138-4f38-bd3b-29cb33f4c358", - "frontendCosmosDBDeploy": "true", - "frontendCosmosDBDisableLocalAuth": "true", - "frontendCosmosDBName": "aro-hcp-rp-$config(regionShortName)", - "globalRG": "global", - "grafanaAdminGroupPrincipalId": "6b6d3adf-8476-4727-9812-20ffdef2b85c", - "grafanaName": "aro-hcp-grafana-$config(regionShortName)", - "hypershiftOperatorImageTag": "99a256f", - "imageSyncAcrRG": "global", - "imageSyncEnvironmentName": "aro-hcp-image-sync", - "imageSyncImageRepo": "image-sync/component-sync", - "imageSyncImageTag": "latest", - "imageSyncRG": "hcp-underlay-westus3-imagesync-dev", - "imageSyncRepositories": "registry.k8s.io/external-dns/external-dns,quay.io/acm-d/rhtap-hypershift-operator,quay.io/app-sre/uhc-clusters-service,quay.io/package-operator/package-operator-package", - "istioVersion": "['asm-1-22']", - "kubernetesVersion": "1.30.5", - "maestroCertDomain": "selfsigned.maestro.keyvault.azure.com", - "maestroConsumerName": "hcp-underlay-$config(regionShortName)-mgmt-$stamp()", - "maestroEventGridMaxClientSessionsPerAuthName": "4", - "maestroEventgridName": "maestro-$config(regionShortName)", - "maestroImageBase": "quay.io/redhat-user-workloads/maestro-rhtap-tenant/maestro/maestro", - "maestroImageTag": "ea066c250a002f0cc458711945165591bc9f6d3f", - "maestroKeyVaultName": "maestro-$config(regionShortName)", - "maestroPostgresDeploy": "false", - "maestroPostgresName": "maestro-$config(regionShortName)", - "maestroPostgresPrivate": "false", - "maestroPostgresServerStorageSizeGB": "32", - "maestroPostgresServerVersion": "15", - "maestroRestrictIstioIngress": "true", - "managementClusterRG": "hcp-underlay-$config(regionShortName)-mgmt-$stamp()", - "mgmtEtcdKVName": "aro-hcp-etcd-$config(regionShortName)-$stamp()", - "mgmtEtcdKVSoftDelete": "false", - "mgmtKeyVaultName": "aro-hcp-mgmt-$config(regionShortName)-$stamp()", - "mgmtKeyVaultPrivate": "false", - "mgmtKeyVaultSoftDelete": "false", - "mgmtSystemAgentPoolMaxCount": "4", - "mgmtSystemAgentPoolMinCount": "1", - "mgmtSystemAgentPoolOsDiskSizeGB": "32", - "mgmtSystemAgentPoolVmSize": "Standard_D2s_v3", - "mgmtUserAgentPoolAzCount": "3", - "mgmtUserAgentPoolMaxCount": "12", - "mgmtUserAgentPoolMinCount": "2", - "mgmtUserAgentPoolOsDiskSizeGB": "100", - "mgmtUserAgentPoolVmSize": "Standard_D4s_v3", - "monitoringMsiName": "aro-hcp-metrics-msi-$config(regionShortName)", - "monitoringWorkspaceName": "aro-hcp-monitor-$config(regionShortName)", - "msiKeyVaultName": "aro-hcp-msi-$config(regionShortName)-$stamp()", - "msiKeyVaultPrivate": "false", - "msiKeyVaultSoftDelete": "false", - "ocMirrorImageRepo": "image-sync/oc-mirror", - "ocMirrorImageTag": "7abc8af", - "ocpAcrName": "arohcpocpdev", - "oidcStorageAccountName": "arohcpoidc$config(regionShortName)", - "parent": { - "child": "bla" - }, - "podSubnetPrefix": "10.128.64.0/18", - "region": "$location()", - "regionRG": "hcp-underlay-$config(regionShortName)", - "regionalDNSSubdomain": "$location()", - "serviceClusterRG": "hcp-underlay-$config(regionShortName)-svc", - "serviceComponentAcrResourceGroups": "global", - "serviceKeyVaultName": "aro-hcp-dev-svc-kv", - "serviceKeyVaultPrivate": "false", - "serviceKeyVaultRG": "global", - "serviceKeyVaultRegion": "westus3", - "serviceKeyVaultSoftDelete": "true", - "subnetPrefix": "10.128.8.0/21", - "svcAcrName": "arohcpsvcdev", - "svcEtcdKVName": "aro-hcp-etcd-$config(regionShortName)", - "svcEtcdKVSoftDelete": "false", - "vnetAddressPrefix": "10.128.0.0/14" - }, - "Geographies": [ - { - "Name": "United States", - "Settings": {}, - "Regions": [ - { - "Name": "westus3", - "Settings": { - "parent": { - "child": "bla" - }, - "mgmtUserAgentPoolMinCount": "5" - } - } - ] - } - ] - } diff --git a/tooling/templatize/pkg/ev2/utils.go b/tooling/templatize/pkg/ev2/utils.go index d9231d4e9..5b4e74c7b 100644 --- a/tooling/templatize/pkg/ev2/utils.go +++ b/tooling/templatize/pkg/ev2/utils.go @@ -60,27 +60,3 @@ func ScopeBindingVariables(configProvider config.ConfigProvider, cloud, deployEn } return variables, nil } - -// PreprocessFileForEV2SystemVars processes an arbitrary gotemplate file and replaces all config.yaml references -// while maintaining EV2 conformant system variables. -// This function is useful to process a pipeline.yaml file so that it contains EV2 system variables. -func PreprocessFileForEV2SystemVars(configProvider config.ConfigProvider, cloud, deployEnv string, templateFile string) ([]byte, error) { - vars, err := configProvider.GetVariables(cloud, deployEnv, "", NewEv2ConfigReplacements()) - if err != nil { - return nil, err - } - return config.PreprocessFile(templateFile, vars) -} - -// PreprocessFileForEV2ScopeBinding processes an arbitrary gotemplate file and replaces all config.yaml references -// with __VAR__ scope binding find/replace references. -// This function is useful to process bicepparam files so that they can be used within EV2 together -// with scopebinding. -func PreprocessFileForEV2ScopeBinding(configProvider config.ConfigProvider, cloud, deployEnv string, templateFile string) ([]byte, error) { - vars, err := configProvider.GetVariables(cloud, deployEnv, "", NewEv2ConfigReplacements()) - if err != nil { - return nil, err - } - _, scopeBindedVars := EV2Mapping(vars, NewDunderPlaceholders(), []string{}) - return config.PreprocessFile(templateFile, scopeBindedVars) -} diff --git a/tooling/templatize/pkg/ev2/utils_test.go b/tooling/templatize/pkg/ev2/utils_test.go index f174877f8..4eecc4bd4 100644 --- a/tooling/templatize/pkg/ev2/utils_test.go +++ b/tooling/templatize/pkg/ev2/utils_test.go @@ -5,7 +5,6 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/Azure/ARO-HCP/tooling/templatize/internal/testutil" "github.com/Azure/ARO-HCP/tooling/templatize/pkg/config" ) @@ -35,21 +34,3 @@ func TestScopeBindingVariables(t *testing.T) { t.Errorf("got incorrect vars: %v", diff) } } - -func TestPreprocessFileForEV2SystemVars(t *testing.T) { - configProvider := config.NewConfigProvider("../../testdata/config.yaml") - content, err := PreprocessFileForEV2SystemVars(configProvider, "public", "int", "../../testdata/pipeline.yaml") - if err != nil { - t.Fatalf("PreprocessFileForEV2SystemVars failed: %v", err) - } - testutil.CompareWithFixture(t, content, testutil.WithExtension(".yaml")) -} - -func TestPreprocessFileForEV2ScopeBinding(t *testing.T) { - configProvider := config.NewConfigProvider("../../testdata/config.yaml") - content, err := PreprocessFileForEV2ScopeBinding(configProvider, "public", "int", "../../testdata/test.bicepparam") - if err != nil { - t.Fatalf("PreprocessFileForEV2ScopeBinding failed: %v", err) - } - testutil.CompareWithFixture(t, content, testutil.WithExtension(".bicepparam")) -} diff --git a/tooling/templatize/testdata/zz_fixture_TestPreprocessFileForEV2ScopeBinding.bicepparam b/tooling/templatize/testdata/zz_fixture_TestPreprocessFileForEV2ScopeBinding.bicepparam deleted file mode 100644 index 932498049..000000000 --- a/tooling/templatize/testdata/zz_fixture_TestPreprocessFileForEV2ScopeBinding.bicepparam +++ /dev/null @@ -1,10 +0,0 @@ -// copy from dev-infrastructure/configurations/region.bicepparam -using '../templates/region.bicep' - -// dns -param baseDNSZoneName = 'hcp.osadev.cloud' -param baseDNSZoneResourceGroup = 'global' - -// CS -param csImage = '__clusterService_imageTag__' -param regionRG = '__regionRG__' diff --git a/tooling/templatize/testdata/zz_fixture_TestPreprocessFileForEV2SystemVars.yaml b/tooling/templatize/testdata/zz_fixture_TestPreprocessFileForEV2SystemVars.yaml deleted file mode 100644 index b243c236c..000000000 --- a/tooling/templatize/testdata/zz_fixture_TestPreprocessFileForEV2SystemVars.yaml +++ /dev/null @@ -1,24 +0,0 @@ -serviceGroup: Microsoft.Azure.ARO.Test -rolloutName: Test Rollout -resourceGroups: -- name: hcp-underlay-$(regionShortName) - subscription: hcp-$location() - aksCluster: aro-hcp-aks - steps: - - name: deploy - action: Shell - command: ["make", "deploy"] - env: - - name: MAESTRO_IMAGE - configRef: maestro_image - - name: dry-run - action: Shell - command: ["make", "deploy"] - dryRun: - envVars: - - name: DRY_RUN - value: "A very dry one" - - name: svc - action: ARM - template: templates/svc-cluster.bicep - parameters: test.bicepparam diff --git a/tooling/templatize/testdata/zz_fixture_TestPreprocessFilebicepparam b/tooling/templatize/testdata/zz_fixture_TestPreprocessFilebicepparam deleted file mode 100644 index 4d6e5f22b..000000000 --- a/tooling/templatize/testdata/zz_fixture_TestPreprocessFilebicepparam +++ /dev/null @@ -1,10 +0,0 @@ -// copy from dev-infrastructure/configurations/region.bicepparam -using '../templates/region.bicep' - -// dns -param baseDNSZoneName = 'hcp.osadev.cloud' -param baseDNSZoneResourceGroup = 'global' - -// CS -param csImage = 'cs-image' -param regionRG = 'bahamas'