Skip to content

Commit

Permalink
Added primary subdomain to runtime prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhprasad-sap committed Oct 31, 2024
1 parent 5a2dd34 commit 2f86e31
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
10 changes: 7 additions & 3 deletions bin/cap-op-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,15 @@ async function generateRuntimeValues(option, inputYamlPath) {
['Enter your global account ID: ', '', true],
['Enter your provider subdomain: ', '', true],
['Enter your provider tenant ID: ', '', true],
['Enter your HANA database instance ID: ', '', false],
['Enter your image pull secrets: ', '', false]
['Enter primary subdomain of you application url (Optional): ', '', false],
['Enter your HANA database instance ID (Optional): ', '', false],
['Enter your image pull secrets (Optional): ', '', false]
]

const answerKeys = [
'appName', 'capOperatorSubdomain', 'clusterDomain',
'globalAccountId', 'providerSubdomain', 'tenantId',
'hanaInstanceId', 'imagePullSecret'
'primarySubdomain','hanaInstanceId', 'imagePullSecret'
]

const answer = await ask(...questions)
Expand All @@ -182,6 +183,9 @@ async function generateRuntimeValues(option, inputYamlPath) {
if (!answerStruct['imagePullSecret'])
delete runtimeValuesYaml['imagePullSecrets']

if (answerStruct['primarySubdomain'])
runtimeValuesYaml['app']['domains']['primary'] = answerStruct['primarySubdomain'] + '.' + answerStruct['clusterDomain']

if (isConfigurableTempChart && answerStruct['hanaInstanceId'])
runtimeValuesYaml['hanaInstanceId'] = answerStruct['hanaInstanceId']

Expand Down
10 changes: 6 additions & 4 deletions test/cap-op-plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ EXAMPLES
rlQuestion.onCall(3).callsArgWith(1, 'dc94db56-asda-adssa-dada-123456789012')
rlQuestion.onCall(4).callsArgWith(1, 'bem-aad-sadad-123456789012')
rlQuestion.onCall(5).callsArgWith(1, 'dasdsd-1234-1234-1234-123456789012')
rlQuestion.onCall(6).callsArgWith(1, 'sdasd-4c4d-4d4d-4d4d-123456789012')
rlQuestion.onCall(7).callsArgWith(1, 'regcred')
rlQuestion.onCall(6).callsArgWith(1, 'primary-sub-domain')
rlQuestion.onCall(7).callsArgWith(1, 'sdasd-4c4d-4d4d-4d4d-123456789012')
rlQuestion.onCall(8).callsArgWith(1, 'regcred')

cds.root = bookshop
await capOperatorPlugin('generate-runtime-values')
Expand Down Expand Up @@ -129,8 +130,9 @@ EXAMPLES
rlQuestion.onCall(3).callsArgWith(1, 'dc94db56-asda-adssa-dada-123456789012')
rlQuestion.onCall(4).callsArgWith(1, 'bem-aad-sadad-123456789012')
rlQuestion.onCall(5).callsArgWith(1, 'dasdsd-1234-1234-1234-123456789012')
rlQuestion.onCall(6).callsArgWith(1, 'sdasd-4c4d-4d4d-4d4d-123456789012')
rlQuestion.onCall(7).callsArgWith(1, 'regcred')
rlQuestion.onCall(6).callsArgWith(1, '')
rlQuestion.onCall(7).callsArgWith(1, 'sdasd-4c4d-4d4d-4d4d-123456789012')
rlQuestion.onCall(8).callsArgWith(1, 'regcred')

cds.root = bookshop
await capOperatorPlugin('generate-runtime-values')
Expand Down
2 changes: 1 addition & 1 deletion test/files/expectedChart/runtime-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ serviceInstances:
- https://*bkshop.c-abc.kyma.ondemand.com/**
app:
domains:
primary: bkshop.c-abc.kyma.ondemand.com
primary: primary-sub-domain.c-abc.kyma.ondemand.com
secondary: []
istioIngressGatewayLabels:
istio: ingressgateway
Expand Down
1 change: 1 addition & 0 deletions test/files/input_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ clusterDomain: c-abc.kyma.ondemand.com
globalAccountId: dc94db56-asda-adssa-dada-123456789012
providerSubdomain: bem-aad-sadad-123456789012
tenantId: dasdsd-1234-1234-1234-123456789012
primarySubdomain: primary-sub-domain
imagePullSecret: regcred
hanaInstanceId: sdasd-4c4d-4d4d-4d4d-123456789012

0 comments on commit 2f86e31

Please sign in to comment.