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

app-serving: add missing param 'project_id' #349

Merged
merged 1 commit into from
Apr 15, 2024
Merged
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
13 changes: 10 additions & 3 deletions app_serving/abort-java-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ spec:
value: ""
- name: organization_id
value: "ose4j7p39"
- name: strategy
value: "blue-green"
- name: project_id
value: ""
# tks_info service URL
- name: tks_api_url
value: "http://tks-api.tks.svc:9110"
Expand All @@ -37,6 +37,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -57,6 +59,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -78,6 +82,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -96,6 +102,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand Down Expand Up @@ -131,7 +139,6 @@ spec:
ABORT_LOG='/mnt/out/abort_output.log'
app_name={{workflow.parameters.app_name}}
ns={{workflow.parameters.namespace}}
strategy={{workflow.parameters.strategy}}

# Prepare kubeconfig
echo "Preparing kubeconfig for target cluster..." | tee -a $ABORT_LOG
Expand Down
10 changes: 9 additions & 1 deletion app_serving/delete-java-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ spec:
- name: asa_task_id
value: ""
- name: organization_id
value: "ose4j7p39"
value: ""
- name: project_id
value: ""
- name: tks_api_url
value: "http://tks-api.tks.svc:9110"

Expand All @@ -34,6 +36,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -54,6 +58,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -72,6 +78,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand Down
10 changes: 10 additions & 0 deletions app_serving/promote-java-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ spec:
value: ""
- name: organization_id
value: "ose4j7p39"
- name: project_id
value: ""
- name: strategy
value: "blue-green"
# tks_info service URL
Expand All @@ -37,6 +39,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -57,6 +61,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -78,6 +84,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -96,6 +104,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand Down
10 changes: 10 additions & 0 deletions app_serving/rollback-java-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ spec:
parameters:
- name: organization_id
value: "ose4j7p39"
- name: project_id
value: ""
- name: target_cluster_id
value: "C011b88fa"
- name: app_name
Expand Down Expand Up @@ -37,6 +39,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -57,6 +61,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -75,6 +81,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -93,6 +101,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand Down
22 changes: 20 additions & 2 deletions app_serving/serve-java-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ spec:
- name: app_type
value: "springboot"
- name: target_cluster_id
value: "cmibsrdnq"
value: ""
- name: organization_id
value: "ose4j7p39"
value: ""
- name: project_id
value: ""
- name: app_name
value: "spring-petclinic"
- name: namespace
Expand Down Expand Up @@ -106,6 +108,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -123,6 +127,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -140,6 +146,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -162,6 +170,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -182,6 +192,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -199,6 +211,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -219,6 +233,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand All @@ -238,6 +254,8 @@ spec:
parameters:
- name: organization_id
value: "{{workflow.parameters.organization_id}}"
- name: project_id
value: "{{workflow.parameters.project_id}}"
- name: asa_id
value: "{{workflow.parameters.asa_id}}"
- name: asa_task_id
Expand Down
7 changes: 3 additions & 4 deletions tks_info/update-asa-endpoint-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
inputs:
parameters:
- name: organization_id
- name: project_id
- name: asa_id
- name: asa_task_id
- name: endpoint
Expand All @@ -50,6 +51,7 @@ spec:

TKS_API_URL = '{{workflow.parameters.tks_api_url}}'
ORG_ID = '{{inputs.parameters.organization_id}}'
PROJECT_ID = '{{inputs.parameters.project_id}}'
APP_ID = '{{inputs.parameters.asa_id}}'
TASK_ID = '{{inputs.parameters.asa_task_id}}'
ENDPOINT_URL = '{{inputs.parameters.endpoint}}'
Expand All @@ -74,16 +76,13 @@ spec:
logStr='response text: {}\n'.format(res.text)
with open(UPDATE_LOG, "a") as f:
f.write(wfRefStr)
f.write(logStr)
f.write(loginErrStr)
print(logStr)
sys.exit(loginErrStr)
res_json = res.json()
return res_json['user']['token']


TOKEN = getToken()
uri = '/api/1.0/organizations/%s/app-serve-apps/%s/endpoint' % (ORG_ID, APP_ID)
uri = '/api/1.0/organizations/%s/projects/%s/app-serve-apps/%s/endpoint' % (ORG_ID, PROJECT_ID, APP_ID)
data = {
'taskId': TASK_ID,
'endpointUrl': ENDPOINT_URL,
Expand Down
6 changes: 4 additions & 2 deletions tks_info/update-asa-status-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
inputs:
parameters:
- name: organization_id
- name: project_id
- name: asa_id
- name: asa_task_id
- name: status
Expand All @@ -38,6 +39,7 @@ spec:

TKS_API_URL = '{{workflow.parameters.tks_api_url}}'
ORG_ID = '{{inputs.parameters.organization_id}}'
PROJECT_ID = '{{inputs.parameters.project_id}}'
APP_ID = '{{inputs.parameters.asa_id}}'
TASK_ID = '{{inputs.parameters.asa_task_id}}'
STATUS = '{{inputs.parameters.status}}'
Expand All @@ -59,7 +61,7 @@ spec:


TOKEN = getToken()
uri = '/api/1.0/organizations/%s/app-serve-apps/%s/status' % (ORG_ID, APP_ID)
uri = '/api/1.0/organizations/%s/projects/%s/app-serve-apps/%s/status' % (ORG_ID, PROJECT_ID, APP_ID)
data = {
'taskId': TASK_ID,
'status': STATUS,
Expand All @@ -69,7 +71,7 @@ spec:
headers={"Authorization": "Bearer " + TOKEN},
json=data)
if res.status_code != 200:
print('text: {}\n'.format(res.text))
print('Response: {}\n'.format(res.text))
sys.exit('Failed to update status')

res_json = res.json()
Expand Down