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

move app_prefix to workflow param #65

Merged
merged 2 commits into from
Jan 3, 2022
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: 5 additions & 8 deletions templates/argo-cd/createapp-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ spec:
value: "https://github.com/openinfradev/decapod-manifests"
- name: revision
value: "main"
- name: app_prefix
value: ""
templates:
- name: createApp
inputs:
parameters:
- name: app_group
# TODO: if input default doesn't work, then try "template default"
# https://argoproj.github.io/argo-workflows/template-defaults/
- name: app_prefix
#value: "{{ workflow.parameters.site_name }}"
- name: path
- name: target_cluster # set to site_name by default
- name: namespace
Expand All @@ -45,9 +43,9 @@ spec:
# TODO: another option is to set default app_prefix to 'site_name' and always apply that prefix.
ARGOCD_APP_NAME=$PATH
ARGOCD_APP_LABEL=$APP_GROUP
if [[ -n "{{inputs.parameters.app_prefix}}" ]]; then
ARGOCD_APP_NAME="{{inputs.parameters.app_prefix}}-$PATH"
ARGOCD_APP_LABEL="{{inputs.parameters.app_prefix}}-$APP_GROUP"
if [[ -n "{{workflow.parameters.app_prefix}}" ]]; then
ARGOCD_APP_NAME="{{workflow.parameters.app_prefix}}-$PATH"
ARGOCD_APP_LABEL="{{workflow.parameters.app_prefix}}-$APP_GROUP"
fi

ktkfree marked this conversation as resolved.
Show resolved Hide resolved
# check if the argocd app already exists.
Expand Down Expand Up @@ -87,7 +85,6 @@ spec:
arguments:
parameters:
- {name: app_group, value: "{{item.app_group}}"}
- {name: app_prefix, value: "{{item.app_prefix}}"}
- {name: path, value: "{{item.path}}"}
- {name: namespace, value: "{{item.namespace}}"}
- {name: target_cluster, value: "{{item.target_cluster}}"}
Expand Down
2 changes: 2 additions & 0 deletions templates/decapod-apps/lma-uniformed-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ spec:
value: "https://github.com/openinfradev/decapod-manifests"
- name: revision
value: main
- name: app_prefix
value: ""
templates:
- name: prepare
inputs: {}
Expand Down