diff --git a/helm/charts/crossplane-provider-sap-btp-account/Chart.yaml b/helm/charts/crossplane-provider-sap-btp-account/Chart.yaml index cb1177c..2fefded 100644 --- a/helm/charts/crossplane-provider-sap-btp-account/Chart.yaml +++ b/helm/charts/crossplane-provider-sap-btp-account/Chart.yaml @@ -16,7 +16,7 @@ icon: "https://avatars.githubusercontent.com/u/45158470?s=48&v=4" # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.12 +version: 0.0.13 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/helm/charts/crossplane-provider-sap-btp-account/README.md b/helm/charts/crossplane-provider-sap-btp-account/README.md index 0262d8b..9ff88d3 100644 --- a/helm/charts/crossplane-provider-sap-btp-account/README.md +++ b/helm/charts/crossplane-provider-sap-btp-account/README.md @@ -2,7 +2,7 @@ # crossplane-provider-sap-btp-account -![Version: 0.0.12](https://img.shields.io/badge/Version-0.0.12-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.2](https://img.shields.io/badge/AppVersion-1.1.2-informational?style=flat-square) +![Version: 0.0.13](https://img.shields.io/badge/Version-0.0.13-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.2](https://img.shields.io/badge/AppVersion-1.1.2-informational?style=flat-square) A Helm chart to template crossplane manifests to manage SAP BTP resources. @@ -18,7 +18,7 @@ A Helm chart to template crossplane manifests to manage SAP BTP resources. | Key | Type | Default | Description | |-----|------|---------|-------------| | accounts | list | {} | accounts contains information and configuration about a specifig [BTP Global Account](https://help.sap.com/docs/btp/sap-business-technology-platform/getting-global-account). :exclamation::exclamation: Managing BTP Global Accounts is NOT possible at the moment :exclamation::exclamation: | -| accounts[0] | object | `{"btpSapCrossplaneProviderConfigRefName":"","subAccounts":[{"entitlements":[{"amount":0,"name":"","permitNumericQuota":false,"serviceName":"","servicePlanName":""}],"forProvider":{"betaEnabled":null,"description":"","displayName":"","region":"eu01","subaccountAdmins":["your.name@sap.com"],"subdomain":"dev-eu01","usedForProduction":"NOT_USED_FOR_PRODUCTION"},"metadata":{"annotations":{"CloudManagement":{"crossplane.io/external-name":"..."},"ServiceManager":{"crossplane.io/external-name":"..."}}},"name":"","services":{"cloudManagement":false,"serviceManager":false},"subscriptions":[{"appName":"","name":"","parameters":{},"planName":"","writeConnectionSecretToRef":{"name":"","namespace":"ns1"}}]}]}` | btpSapCrossplaneProviderConfigRefName defines crossplane provider configuration reference name (identifier) of a [BTP Global Account](https://help.sap.com/docs/btp/sap-business-technology-platform/getting-global-account)! | +| accounts[0] | object | `{"btpSapCrossplaneProviderConfigRefName":"","subAccounts":[{"entitlements":[{"amount":0,"name":"","permitNumericQuota":false,"serviceName":"","servicePlanName":""}],"forProvider":{"betaEnabled":null,"description":"","displayName":"","region":"eu01","subaccountAdmins":["your.name@sap.com"],"subdomain":"dev-eu01","usedForProduction":"NOT_USED_FOR_PRODUCTION"},"metadata":{"annotations":{"CloudManagement":{"crossplane.io/external-name":"..."},"ServiceManager":{"crossplane.io/external-name":"..."}}},"name":"","services":{"cloudManagement":false,"cloudManagementConfiguration":{"writeConnectionSecretToRef":{}},"serviceManager":false,"serviceManagerConfiguration":{"writeConnectionSecretToRef":{}}},"subscriptions":[{"appName":"","name":"","parameters":{},"planName":"","writeConnectionSecretToRef":{"name":"","namespace":"ns1"}}]}]}` | btpSapCrossplaneProviderConfigRefName defines crossplane provider configuration reference name (identifier) of a [BTP Global Account](https://help.sap.com/docs/btp/sap-business-technology-platform/getting-global-account)! | | accounts[0].subAccounts | list | {} | subAccounts contains information and configuration about [BTP Sub-Accounts](https://help.sap.com/docs/btp/sap-business-technology-platform/account-model#loio8d6e3a0fa4ab43e4a421d3ed08128afa). | | accounts[0].subAccounts[0].entitlements | list | {} | entitlements defines [BTP Entitlements](https://help.sap.com/docs/btp/sap-business-technology-platform/entitlements-and-quotas) for this [BTP Sub-Account](https://help.sap.com/docs/btp/sap-business-technology-platform/account-model#loio8d6e3a0fa4ab43e4a421d3ed08128afa). Learn more about managing BTP Entitlement with crossplane [here](https://doc.crds.dev/github.com/SAP/crossplane-provider-btp/account.btp.sap.crossplane.io/Entitlement/v1alpha1@v1.1.2). | | accounts[0].subAccounts[0].entitlements[0].amount | int | `0` | Used when permitNumericQuota=true. Only set amount for multitenant applications and services that do not permit a numeric quota assignment! | diff --git a/helm/charts/crossplane-provider-sap-btp-account/templates/mcp/btp-subscriptions/cloud-management.yaml b/helm/charts/crossplane-provider-sap-btp-account/templates/mcp/btp-subscriptions/cloud-management.yaml index 4ce3761..846591f 100644 --- a/helm/charts/crossplane-provider-sap-btp-account/templates/mcp/btp-subscriptions/cloud-management.yaml +++ b/helm/charts/crossplane-provider-sap-btp-account/templates/mcp/btp-subscriptions/cloud-management.yaml @@ -25,9 +25,13 @@ spec: name: {{required "A valid value is required! (.Values.accounts[].subAccounts[].name)" $item.name | lower }} subaccountRef: name: {{required "A valid value is required! (.Values.accounts[].subAccounts[].name)" $item.name | lower }} + {{- if and $item.services.cloudManagementConfiguration $item.services.cloudManagementConfiguration.writeConnectionSecretToRef }} + writeConnectionSecretToRef: {{- $item.services.cloudManagementConfiguration.writeConnectionSecretToRef | toYaml | nindent 4 }} + {{- else }} writeConnectionSecretToRef: name: cis-{{required "A valid value is required! (.Values.accounts[].btpSapCrossplaneProviderConfigRefName)" $account.btpSapCrossplaneProviderConfigRefName | lower }}-{{required "A valid value is required! (.Values.accounts[].subAccounts[].name)" $item.name | lower }} - namespace: default + namespace: default + {{- end}} {{- end }} {{- end }} {{- end }} diff --git a/helm/charts/crossplane-provider-sap-btp-account/templates/mcp/btp-subscriptions/servicemanager.yaml b/helm/charts/crossplane-provider-sap-btp-account/templates/mcp/btp-subscriptions/servicemanager.yaml index fe34a23..5267fc9 100644 --- a/helm/charts/crossplane-provider-sap-btp-account/templates/mcp/btp-subscriptions/servicemanager.yaml +++ b/helm/charts/crossplane-provider-sap-btp-account/templates/mcp/btp-subscriptions/servicemanager.yaml @@ -14,11 +14,13 @@ metadata: openmcp.cloud/blueprint-building-block-version: "{{ $.Chart.Version }}" {{- template "ServiceManager.annotations" $item }} spec: + {{- if and $item.services.serviceManagerConfiguration $item.services.serviceManagerConfiguration.writeConnectionSecretToRef }} + writeConnectionSecretToRef: {{- $item.services.serviceManagerConfiguration.writeConnectionSecretToRef | toYaml | nindent 4 }} + {{- else }} writeConnectionSecretToRef: - # !!! TODO: Make this configurable !!! - name: btp-service-manager-{{required "A valid value is required! (.Values.accounts[].btpSapCrossplaneProviderConfigRefName)" $account.btpSapCrossplaneProviderConfigRefName}}-{{required "A valid value is required! (.Values.accounts[].subAccounts[].name)" $item.name | lower }} - # !!! TODO: Make this configurable !!! + name: btp-service-manager-{{ required "A valid value is required! (.Values.accounts[].btpSapCrossplaneProviderConfigRefName)" $account.btpSapCrossplaneProviderConfigRefName }}-{{ required "A valid value is required! (.Values.accounts[].subAccounts[].name)" $item.name | lower }} namespace: default + {{- end }} forProvider: subaccountRef: name: {{required "A valid value is required! (.Values.accounts[].subAccounts[].name)" $item.name | lower }} diff --git a/helm/charts/crossplane-provider-sap-btp-account/values.ci.yaml b/helm/charts/crossplane-provider-sap-btp-account/values.ci.yaml index 9c7a3df..f1ba809 100644 --- a/helm/charts/crossplane-provider-sap-btp-account/values.ci.yaml +++ b/helm/charts/crossplane-provider-sap-btp-account/values.ci.yaml @@ -109,7 +109,15 @@ accounts: - your.name@sap.com services: serviceManager: true + serviceManagerConfiguration: + writeConnectionSecretToRef: + name: btp-service-manager-test + namespace: test-namespace cloudManagement: true + cloudManagementConfiguration: + writeConnectionSecretToRef: + name: cis-test + namespace: test-namespace entitlements: - name: "entitlement-1" serviceName: "service-name" diff --git a/helm/charts/crossplane-provider-sap-btp-account/values.yaml b/helm/charts/crossplane-provider-sap-btp-account/values.yaml index 2d4a975..a8d27ed 100644 --- a/helm/charts/crossplane-provider-sap-btp-account/values.yaml +++ b/helm/charts/crossplane-provider-sap-btp-account/values.yaml @@ -65,8 +65,12 @@ accounts: # Please make sure the P/I/D users, used in the Secrets referenced in the `ProviderConfig` are part of your Subaccount's `subaccountAdmins``. # Note: updating subaccountAdmins on an existing Subaccount is not yet supported by the provider. We are aware of this issue. serviceManager: false + serviceManagerConfiguration: + writeConnectionSecretToRef: {} # -- Enable/Disable (true/false) BTP Cloud Management Service. cloudManagement: false + cloudManagementConfiguration: + writeConnectionSecretToRef: {} # -- entitlements defines [BTP Entitlements](https://help.sap.com/docs/btp/sap-business-technology-platform/entitlements-and-quotas) for this [BTP Sub-Account](https://help.sap.com/docs/btp/sap-business-technology-platform/account-model#loio8d6e3a0fa4ab43e4a421d3ed08128afa). # Learn more about managing BTP Entitlement with crossplane [here](https://doc.crds.dev/github.com/SAP/crossplane-provider-btp/account.btp.sap.crossplane.io/Entitlement/v1alpha1@v1.1.2). # @default -- {}