Skip to content

Commit 9d5db0f

Browse files
author
Rico Gu
authored
chore: add writeConnectionSecretToRef configuration for service manager and cloud management (#50)
1 parent 3d8f200 commit 9d5db0f

File tree

6 files changed

+25
-7
lines changed

6 files changed

+25
-7
lines changed

helm/charts/crossplane-provider-sap-btp-account/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ icon: "https://avatars.githubusercontent.com/u/45158470?s=48&v=4"
1616
# This is the chart version. This version number should be incremented each time you make changes
1717
# to the chart and its templates, including the app version.
1818
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19-
version: 0.0.12
19+
version: 0.0.13
2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.

helm/charts/crossplane-provider-sap-btp-account/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# crossplane-provider-sap-btp-account
44

5-
![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)
5+
![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)
66

77
A Helm chart to template crossplane manifests to manage SAP BTP resources.
88

@@ -18,7 +18,7 @@ A Helm chart to template crossplane manifests to manage SAP BTP resources.
1818
| Key | Type | Default | Description |
1919
|-----|------|---------|-------------|
2020
| 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: |
21-
| accounts[0] | object | `{"btpSapCrossplaneProviderConfigRefName":"","subAccounts":[{"entitlements":[{"amount":0,"name":"","permitNumericQuota":false,"serviceName":"","servicePlanName":""}],"forProvider":{"betaEnabled":null,"description":"","displayName":"","region":"eu01","subaccountAdmins":["[email protected]"],"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)! |
21+
| accounts[0] | object | `{"btpSapCrossplaneProviderConfigRefName":"","subAccounts":[{"entitlements":[{"amount":0,"name":"","permitNumericQuota":false,"serviceName":"","servicePlanName":""}],"forProvider":{"betaEnabled":null,"description":"","displayName":"","region":"eu01","subaccountAdmins":["[email protected]"],"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)! |
2222
| 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). |
2323
| 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/[email protected]). |
2424
| 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! |

helm/charts/crossplane-provider-sap-btp-account/templates/mcp/btp-subscriptions/cloud-management.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ spec:
2525
name: {{required "A valid value is required! (.Values.accounts[].subAccounts[].name)" $item.name | lower }}
2626
subaccountRef:
2727
name: {{required "A valid value is required! (.Values.accounts[].subAccounts[].name)" $item.name | lower }}
28+
{{- if and $item.services.cloudManagementConfiguration $item.services.cloudManagementConfiguration.writeConnectionSecretToRef }}
29+
writeConnectionSecretToRef: {{- $item.services.cloudManagementConfiguration.writeConnectionSecretToRef | toYaml | nindent 4 }}
30+
{{- else }}
2831
writeConnectionSecretToRef:
2932
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 }}
30-
namespace: default
33+
namespace: default
34+
{{- end}}
3135
{{- end }}
3236
{{- end }}
3337
{{- end }}

helm/charts/crossplane-provider-sap-btp-account/templates/mcp/btp-subscriptions/servicemanager.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ metadata:
1414
openmcp.cloud/blueprint-building-block-version: "{{ $.Chart.Version }}"
1515
{{- template "ServiceManager.annotations" $item }}
1616
spec:
17+
{{- if and $item.services.serviceManagerConfiguration $item.services.serviceManagerConfiguration.writeConnectionSecretToRef }}
18+
writeConnectionSecretToRef: {{- $item.services.serviceManagerConfiguration.writeConnectionSecretToRef | toYaml | nindent 4 }}
19+
{{- else }}
1720
writeConnectionSecretToRef:
18-
# !!! TODO: Make this configurable !!!
19-
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 }}
20-
# !!! TODO: Make this configurable !!!
21+
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 }}
2122
namespace: default
23+
{{- end }}
2224
forProvider:
2325
subaccountRef:
2426
name: {{required "A valid value is required! (.Values.accounts[].subAccounts[].name)" $item.name | lower }}

helm/charts/crossplane-provider-sap-btp-account/values.ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,15 @@ accounts:
109109
110110
services:
111111
serviceManager: true
112+
serviceManagerConfiguration:
113+
writeConnectionSecretToRef:
114+
name: btp-service-manager-test
115+
namespace: test-namespace
112116
cloudManagement: true
117+
cloudManagementConfiguration:
118+
writeConnectionSecretToRef:
119+
name: cis-test
120+
namespace: test-namespace
113121
entitlements:
114122
- name: "entitlement-1"
115123
serviceName: "service-name"

helm/charts/crossplane-provider-sap-btp-account/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ accounts:
6565
# Please make sure the P/I/D users, used in the Secrets referenced in the `ProviderConfig` are part of your Subaccount's `subaccountAdmins``.
6666
# Note: updating subaccountAdmins on an existing Subaccount is not yet supported by the provider. We are aware of this issue.
6767
serviceManager: false
68+
serviceManagerConfiguration:
69+
writeConnectionSecretToRef: {}
6870
# -- Enable/Disable (true/false) BTP Cloud Management Service.
6971
cloudManagement: false
72+
cloudManagementConfiguration:
73+
writeConnectionSecretToRef: {}
7074
# -- 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).
7175
# 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/[email protected]).
7276
# @default -- {}

0 commit comments

Comments
 (0)