Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Misc] Added primary subdomain to runtime file generation prompts #43

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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