From 03211a939085bfe1b443cf2a956634e40567c465 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Tue, 30 Aug 2022 21:46:29 +0200 Subject: [PATCH 01/10] [Modules] Updated KubernetesConfiguration/FluxConfigurations to new dependency approach --- ...rnetesconfiguration.fluxconfigurations.yml | 3 +- .../.test/default/dependencies.bicep | 50 +++++++++++ .../.test/default/deploy.test.bicep | 70 ++++++++++++++++ .../.test/min.parameters.json | 32 -------- .../.test/min/dependencies.bicep | 50 +++++++++++ .../.test/min/deploy.test.bicep | 60 ++++++++++++++ .../fluxConfigurations/.test/parameters.json | 44 ---------- .../fluxConfigurations/readme.md | 82 ++++++++----------- utilities/tools/Set-ModuleReadMe.ps1 | 6 +- 9 files changed, 270 insertions(+), 127 deletions(-) create mode 100644 modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/dependencies.bicep create mode 100644 modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/deploy.test.bicep delete mode 100644 modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min.parameters.json create mode 100644 modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/dependencies.bicep create mode 100644 modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep delete mode 100644 modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/parameters.json diff --git a/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml b/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml index a4f242ea2b..663fa61d5a 100644 --- a/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml +++ b/.github/workflows/ms.kubernetesconfiguration.fluxconfigurations.yml @@ -106,8 +106,7 @@ jobs: - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' uses: ./.github/actions/templates/validateModuleDeployment with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - parameterFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' + templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' location: '${{ env.location }}' resourceGroupName: '${{ env.resourceGroupName }}' subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/dependencies.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/dependencies.bicep new file mode 100644 index 0000000000..45eb2a246f --- /dev/null +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/dependencies.bicep @@ -0,0 +1,50 @@ +@description('Optional. The location to deploy resources to.') +param location string = resourceGroup().location + +@description('Required. The name of the AKS cluster to create.') +param clusterName string + +@description('Required. The name of the AKS cluster extension to create.') +param clusterExtensionName string + +@description('Required. The name of the AKS cluster nodes resource group to create.') +param clusterNodeResourceGroupName string + +resource cluster 'Microsoft.ContainerService/managedClusters@2022-06-01' = { + name: clusterName + location: location + identity: { + type: 'SystemAssigned' + } + properties: { + dnsPrefix: clusterName + nodeResourceGroup: clusterNodeResourceGroupName + agentPoolProfiles: [ + { + name: 'agentpool' + // osDiskSizeGB: osDiskSizeGB + count: 1 + vmSize: 'Standard_DS2_v2' + osType: 'Linux' + mode: 'System' + } + ] + } +} + +resource extension 'Microsoft.KubernetesConfiguration/extensions@2022-03-01' = { + scope: cluster + name: clusterExtensionName + properties: { + extensionType: 'microsoft.flux' + releaseTrain: 'Stable' + scope: { + cluster: { + releaseNamespace: 'flux-system' + } + } + } +} + +@description('The name of the created AKS cluster.') +output clusterName string = cluster.name diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/deploy.test.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/deploy.test.bicep new file mode 100644 index 0000000000..ba309b2291 --- /dev/null +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/deploy.test.bicep @@ -0,0 +1,70 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.kubernetesconfiguration.fluxconfigurations-${serviceShort}-rg' + +@description('Optional. The location to deploy resources to') +param location string = deployment().location + +@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +param serviceShort string = 'kcfcdef' + +// =========== // +// Deployments // +// =========== // + +// General resources +// ================= +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: resourceGroupName + location: location +} + +module resourceGroupResources 'dependencies.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name, location)}-paramNested' + params: { + clusterName: 'dep-carml-aks-${serviceShort}' + clusterExtensionName: '<>${serviceShort}001' + clusterNodeResourceGroupName: 'nodes-${resourceGroupName}' + } +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + clusterName: resourceGroupResources.outputs.clusterName + namespace: 'flux-system' + scope: 'cluster' + sourceKind: 'GitRepository' + gitRepository: { + repositoryRef: { + branch: 'main' + } + sshKnownHosts: '' + syncIntervalInSeconds: 300 + timeoutInSeconds: 180 + url: 'https://github.com/mspnp/aks-baseline' + } + kustomizations: { + unified: { + dependsOn: [] + force: false + path: './cluster-manifests' + prune: true + syncIntervalInSeconds: 300 + timeoutInSeconds: 300 + } + } + } +} diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min.parameters.json b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min.parameters.json deleted file mode 100644 index 201ac22b6b..0000000000 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min.parameters.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "flux2" - }, - "scope": { - "value": "cluster" - }, - "clusterName": { - "value": "<>-az-aks-kubenet-001" - }, - "namespace": { - "value": "flux-system" - }, - "sourceKind": { - "value": "GitRepository" - }, - "gitRepository": { - "value": { - "url": "https://github.com/mspnp/aks-baseline", - "timeoutInSeconds": 180, - "syncIntervalInSeconds": 300, - "repositoryRef": { - "branch": "main" - }, - "sshKnownHosts": "" - } - } - } -} diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/dependencies.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/dependencies.bicep new file mode 100644 index 0000000000..45eb2a246f --- /dev/null +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/dependencies.bicep @@ -0,0 +1,50 @@ +@description('Optional. The location to deploy resources to.') +param location string = resourceGroup().location + +@description('Required. The name of the AKS cluster to create.') +param clusterName string + +@description('Required. The name of the AKS cluster extension to create.') +param clusterExtensionName string + +@description('Required. The name of the AKS cluster nodes resource group to create.') +param clusterNodeResourceGroupName string + +resource cluster 'Microsoft.ContainerService/managedClusters@2022-06-01' = { + name: clusterName + location: location + identity: { + type: 'SystemAssigned' + } + properties: { + dnsPrefix: clusterName + nodeResourceGroup: clusterNodeResourceGroupName + agentPoolProfiles: [ + { + name: 'agentpool' + // osDiskSizeGB: osDiskSizeGB + count: 1 + vmSize: 'Standard_DS2_v2' + osType: 'Linux' + mode: 'System' + } + ] + } +} + +resource extension 'Microsoft.KubernetesConfiguration/extensions@2022-03-01' = { + scope: cluster + name: clusterExtensionName + properties: { + extensionType: 'microsoft.flux' + releaseTrain: 'Stable' + scope: { + cluster: { + releaseNamespace: 'flux-system' + } + } + } +} + +@description('The name of the created AKS cluster.') +output clusterName string = cluster.name diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep new file mode 100644 index 0000000000..873fc6e0c8 --- /dev/null +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep @@ -0,0 +1,60 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.kubernetesconfiguration.fluxconfigurations-${serviceShort}-rg' + +@description('Optional. The location to deploy resources to') +param location string = deployment().location + +@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +param serviceShort string = 'kcfcmin' + +// =========== // +// Deployments // +// =========== // + +// General resources +// ================= +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: resourceGroupName + location: location +} + +module resourceGroupResources 'dependencies.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name, location)}-paramNested' + params: { + clusterName: 'dep-carml-aks-${serviceShort}' + clusterExtensionName: '<>${serviceShort}001' + clusterNodeResourceGroupName: 'nodes-${resourceGroupName}' + } +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + clusterName: resourceGroupResources.outputs.clusterName + namespace: 'flux-system' + scope: 'cluster' + sourceKind: 'GitRepository' + gitRepository: { + repositoryRef: { + branch: 'main' + } + sshKnownHosts: '' + syncIntervalInSeconds: 300 + timeoutInSeconds: 180 + url: 'https://github.com/mspnp/aks-baseline' + } + } +} diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/parameters.json b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/parameters.json deleted file mode 100644 index e6f563f7f8..0000000000 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/parameters.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "flux2" - }, - "scope": { - "value": "cluster" - }, - "clusterName": { - "value": "<>-az-aks-kubenet-001" - }, - "namespace": { - "value": "flux-system" - }, - "sourceKind": { - "value": "GitRepository" - }, - "gitRepository": { - "value": { - "url": "https://github.com/mspnp/aks-baseline", - "timeoutInSeconds": 180, - "syncIntervalInSeconds": 300, - "repositoryRef": { - "branch": "main" - }, - "sshKnownHosts": "" - } - }, - "kustomizations": { - "value": { - "unified": { - "path": "./cluster-manifests", - "dependsOn": [], - "timeoutInSeconds": 300, - "syncIntervalInSeconds": 300, - "prune": true, - "force": false - } - } - } - } -} diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md index e26f0c6f9a..297e8349cc 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md @@ -76,21 +76,20 @@ The following module usage examples are retrieved from the content of the files >**Note**: The name of each example is based on the name of the file from which it is taken. >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -

Example 1: Min

+

Example 1: Default

via Bicep module ```bicep -module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfigurations/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-fluxConfigurations' +module Fluxconfigurations './Microsoft.Kubernetesconfiguration/Fluxconfigurations/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-kcfcdef' params: { // Required parameters - clusterName: '<>-az-aks-kubenet-001' - name: 'flux2' + clusterName: '' + name: '<>kcfcdef001' namespace: 'flux-system' - scope: 'cluster' sourceKind: 'GitRepository' // Non-required parameters gitRepository: { @@ -102,6 +101,16 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration timeoutInSeconds: 180 url: 'https://github.com/mspnp/aks-baseline' } + kustomizations: { + unified: { + dependsOn: [] + force: false + path: './cluster-manifests' + prune: true + syncIntervalInSeconds: 300 + timeoutInSeconds: 300 + } + } } } ``` @@ -120,17 +129,14 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration "parameters": { // Required parameters "clusterName": { - "value": "<>-az-aks-kubenet-001" + "value": "" }, "name": { - "value": "flux2" + "value": "<>kcfcdef001" }, "namespace": { "value": "flux-system" }, - "scope": { - "value": "cluster" - }, "sourceKind": { "value": "GitRepository" }, @@ -145,6 +151,18 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration "timeoutInSeconds": 180, "url": "https://github.com/mspnp/aks-baseline" } + }, + "kustomizations": { + "value": { + "unified": { + "dependsOn": [], + "force": false, + "path": "./cluster-manifests", + "prune": true, + "syncIntervalInSeconds": 300, + "timeoutInSeconds": 300 + } + } } } } @@ -153,23 +171,21 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration

-

Example 2: Parameters

+

Example 2: Min

via Bicep module ```bicep -module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfigurations/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-fluxConfigurations' +module Fluxconfigurations './Microsoft.Kubernetesconfiguration/Fluxconfigurations/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-kcfcmin' params: { // Required parameters - clusterName: '<>-az-aks-kubenet-001' - name: 'flux2' + clusterName: '' + name: '<>kcfcmin001' namespace: 'flux-system' - scope: 'cluster' sourceKind: 'GitRepository' - // Non-required parameters gitRepository: { repositoryRef: { branch: 'main' @@ -179,16 +195,6 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration timeoutInSeconds: 180 url: 'https://github.com/mspnp/aks-baseline' } - kustomizations: { - unified: { - dependsOn: [] - force: false - path: './cluster-manifests' - prune: true - syncIntervalInSeconds: 300 - timeoutInSeconds: 300 - } - } } } ``` @@ -207,21 +213,17 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration "parameters": { // Required parameters "clusterName": { - "value": "<>-az-aks-kubenet-001" + "value": "" }, "name": { - "value": "flux2" + "value": "<>kcfcmin001" }, "namespace": { "value": "flux-system" }, - "scope": { - "value": "cluster" - }, "sourceKind": { "value": "GitRepository" }, - // Non-required parameters "gitRepository": { "value": { "repositoryRef": { @@ -232,18 +234,6 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration "timeoutInSeconds": 180, "url": "https://github.com/mspnp/aks-baseline" } - }, - "kustomizations": { - "value": { - "unified": { - "dependsOn": [], - "force": false, - "path": "./cluster-manifests", - "prune": true, - "syncIntervalInSeconds": 300, - "timeoutInSeconds": 300 - } - } } } } diff --git a/utilities/tools/Set-ModuleReadMe.ps1 b/utilities/tools/Set-ModuleReadMe.ps1 index a1074fed21..6b922d65e8 100644 --- a/utilities/tools/Set-ModuleReadMe.ps1 +++ b/utilities/tools/Set-ModuleReadMe.ps1 @@ -883,9 +883,10 @@ function Set-DeploymentExamplesSection { '' ) + $TextInfo = (Get-Culture -Name 'en-US').TextInfo $moduleRoot = Split-Path $TemplateFilePath -Parent - $resourceTypeIdentifier = $moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/') - $resourceType = $resourceTypeIdentifier.Split('/')[1] + $resourceTypeIdentifier = $TextInfo.ToTitleCase($moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/')) + $resourceType = $TextInfo.ToTitleCase($resourceTypeIdentifier.Split('/')[1]) $testFilePaths = Get-ModuleTestFileList -ModulePath $moduleRoot | ForEach-Object { Join-Path $moduleRoot $_ } $RequiredParametersList = $TemplateFileContent.parameters.Keys | Where-Object { $TemplateFileContent.parameters[$_].Keys -notcontains 'defaultValue' } | Sort-Object @@ -906,7 +907,6 @@ function Set-DeploymentExamplesSection { } else { $exampleTitle = ((Split-Path $testFilePath -LeafBase) -replace '\.', ' ') -replace ' parameters', '' } - $TextInfo = (Get-Culture -Name 'en-US').TextInfo $exampleTitle = $TextInfo.ToTitleCase($exampleTitle) $SectionContent += @( '

Example {0}: {1}

' -f $pathIndex, $exampleTitle From a3d7944b77f6d086abddcbca6d0d3ea28cafc80a Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 1 Sep 2022 11:35:07 +0200 Subject: [PATCH 02/10] Update to latest --- .../fluxConfigurations/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md index 48f4d13c20..101e8b1932 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md @@ -83,8 +83,8 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfigurations/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-FluxConfigurations' +module FluxConfigurations './Microsoft.KubernetesConfiguration/FluxConfigurations/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-kcfcdef' params: { // Required parameters clusterName: '' @@ -178,8 +178,8 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration via Bicep module ```bicep -module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfigurations/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-FluxConfigurations' +module FluxConfigurations './Microsoft.KubernetesConfiguration/FluxConfigurations/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-kcfcmin' params: { // Required parameters clusterName: '' From c8887204d529b569a24723b91d295cdea76dabfe Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sat, 3 Sep 2022 12:28:13 +0200 Subject: [PATCH 03/10] Update to latest --- .../fluxConfigurations/.test/default/dependencies.bicep | 1 - .../fluxConfigurations/.test/min/dependencies.bicep | 1 - 2 files changed, 2 deletions(-) diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/dependencies.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/dependencies.bicep index 45eb2a246f..d35586edf5 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/dependencies.bicep +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/dependencies.bicep @@ -22,7 +22,6 @@ resource cluster 'Microsoft.ContainerService/managedClusters@2022-06-01' = { agentPoolProfiles: [ { name: 'agentpool' - // osDiskSizeGB: osDiskSizeGB count: 1 vmSize: 'Standard_DS2_v2' osType: 'Linux' diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/dependencies.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/dependencies.bicep index 45eb2a246f..d35586edf5 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/dependencies.bicep +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/dependencies.bicep @@ -22,7 +22,6 @@ resource cluster 'Microsoft.ContainerService/managedClusters@2022-06-01' = { agentPoolProfiles: [ { name: 'agentpool' - // osDiskSizeGB: osDiskSizeGB count: 1 vmSize: 'Standard_DS2_v2' osType: 'Linux' From 7bd6c821e65b2f4bfbd561fe47df749fbc29701e Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 8 Sep 2022 19:07:18 +0200 Subject: [PATCH 04/10] Updated folder default to common. --- .../.test/{default => common}/dependencies.bicep | 0 .../.test/{default => common}/deploy.test.bicep | 0 .../fluxConfigurations/readme.md | 6 +++--- 3 files changed, 3 insertions(+), 3 deletions(-) rename modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/{default => common}/dependencies.bicep (100%) rename modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/{default => common}/deploy.test.bicep (100%) diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/dependencies.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/dependencies.bicep similarity index 100% rename from modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/dependencies.bicep rename to modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/dependencies.bicep diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/deploy.test.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep similarity index 100% rename from modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/default/deploy.test.bicep rename to modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md index 101e8b1932..79e6334e25 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md @@ -76,14 +76,14 @@ The following module usage examples are retrieved from the content of the files >**Note**: The name of each example is based on the name of the file from which it is taken. >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -

Example 1: Default

+

Example 1: Common

via Bicep module ```bicep -module FluxConfigurations './Microsoft.KubernetesConfiguration/FluxConfigurations/deploy.bicep' = { +module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfigurations/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-kcfcdef' params: { // Required parameters @@ -178,7 +178,7 @@ module FluxConfigurations './Microsoft.KubernetesConfiguration/FluxConfiguration via Bicep module ```bicep -module FluxConfigurations './Microsoft.KubernetesConfiguration/FluxConfigurations/deploy.bicep' = { +module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfigurations/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-kcfcmin' params: { // Required parameters From ebee56b6cb6775d09d19b8c2a50d36841374c62a Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 12:50:58 +0200 Subject: [PATCH 05/10] Update to latest --- .../fluxConfigurations/.test/common/deploy.test.bicep | 4 ++-- .../fluxConfigurations/.test/min/deploy.test.bicep | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep index ba309b2291..9a011e3a15 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep @@ -10,8 +10,8 @@ param resourceGroupName string = 'ms.kubernetesconfiguration.fluxconfigurations- @description('Optional. The location to deploy resources to') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') -param serviceShort string = 'kcfcdef' +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +param serviceShort string = 'kcfccom' // =========== // // Deployments // diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep index 873fc6e0c8..08924b1243 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.kubernetesconfiguration.fluxconfigurations- @description('Optional. The location to deploy resources to') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') param serviceShort string = 'kcfcmin' // =========== // From 425e0f62bb8b0c71fb04be1b4d883692875df8e2 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:03:56 +0200 Subject: [PATCH 06/10] Update to latest --- .../fluxConfigurations/.test/common/deploy.test.bicep | 6 +++--- .../fluxConfigurations/.test/min/deploy.test.bicep | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep index 9a011e3a15..f1cda3e753 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep @@ -3,14 +3,14 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes') +@description('Optional. The name of the resource group to deploy for a testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.kubernetesconfiguration.fluxconfigurations-${serviceShort}-rg' -@description('Optional. The location to deploy resources to') +@description('Optional. The location to deploy resources to.') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') param serviceShort string = 'kcfccom' // =========== // diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep index 08924b1243..d7dd72f687 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep @@ -3,14 +3,14 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes') +@description('Optional. The name of the resource group to deploy for a testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.kubernetesconfiguration.fluxconfigurations-${serviceShort}-rg' -@description('Optional. The location to deploy resources to') +@description('Optional. The location to deploy resources to.') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') param serviceShort string = 'kcfcmin' // =========== // From b4d9359674ca52fad879b2b9fc90b074a889fcbc Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:45:46 +0200 Subject: [PATCH 07/10] Update to latest --- .../fluxConfigurations/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md index 6ab8e6491b..105bdf0a16 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/readme.md @@ -85,11 +85,11 @@ The following module usage examples are retrieved from the content of the files ```bicep module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfigurations/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-kcfcdef' + name: '${uniqueString(deployment().name)}-test-kcfccom' params: { // Required parameters clusterName: '' - name: '<>kcfcdef001' + name: '<>kcfccom001' namespace: 'flux-system' sourceKind: 'GitRepository' // Non-required parameters @@ -133,7 +133,7 @@ module fluxConfigurations './Microsoft.KubernetesConfiguration/fluxConfiguration "value": "" }, "name": { - "value": "<>kcfcdef001" + "value": "<>kcfccom001" }, "namespace": { "value": "flux-system" From 52fc785e621a9710ebcde85a31019ba000ed0b35 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 20:05:18 +0200 Subject: [PATCH 08/10] Update modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep --- .../fluxConfigurations/.test/common/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep index f1cda3e753..4355a51707 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes.') +@description('Optional. The name of the resource group to deploy for testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.kubernetesconfiguration.fluxconfigurations-${serviceShort}-rg' From 66f7e8c61360d17273bb7dfe65d43753dd95a12e Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 20:05:32 +0200 Subject: [PATCH 09/10] Update modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep --- .../fluxConfigurations/.test/min/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep index d7dd72f687..aedf8e447c 100644 --- a/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep +++ b/modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes.') +@description('Optional. The name of the resource group to deploy for testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.kubernetesconfiguration.fluxconfigurations-${serviceShort}-rg' From c5b6e7729e13a1705b2293917c4875dda63da333 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Mon, 19 Sep 2022 21:20:58 +0200 Subject: [PATCH 10/10] Update to latest --- utilities/tools/Set-ModuleReadMe.ps1 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/utilities/tools/Set-ModuleReadMe.ps1 b/utilities/tools/Set-ModuleReadMe.ps1 index 6469605289..25923c3d62 100644 --- a/utilities/tools/Set-ModuleReadMe.ps1 +++ b/utilities/tools/Set-ModuleReadMe.ps1 @@ -896,13 +896,6 @@ function Set-DeploymentExamplesSection { '' ) -<<<<<<< HEAD - $TextInfo = (Get-Culture -Name 'en-US').TextInfo - $moduleRoot = Split-Path $TemplateFilePath -Parent - $fullIdentifier = $moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/') - -======= ->>>>>>> main # Get resource type and make first letter upper case. Requires manual handling as ToTitleCase lowercases everything but the first letter $providerNamespace = ($fullModuleIdentifier.Split('/')[0] -split '\.' | ForEach-Object { $_.Substring(0, 1).ToUpper() + $_.Substring(1) }) -join '.' $resourceType = $fullModuleIdentifier.Split('/')[1]