From 387faf433390545c08abcc4b503f7ec7cec385c6 Mon Sep 17 00:00:00 2001 From: Seungkyu Ahn Date: Fri, 18 Jun 2021 15:31:26 +0900 Subject: [PATCH] Add argo namespace to workflowtemplate Fix create argo proj --- templates/argo-cd/createapp-wftpl.yaml | 3 +++ templates/argo-cd/prepare-argocd-wftpl.yaml | 28 ++++++++++----------- templates/decapod-apps/service-mesh-wf.yaml | 2 +- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/templates/argo-cd/createapp-wftpl.yaml b/templates/argo-cd/createapp-wftpl.yaml index 9a34642..a27c1f7 100644 --- a/templates/argo-cd/createapp-wftpl.yaml +++ b/templates/argo-cd/createapp-wftpl.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 kind: WorkflowTemplate metadata: name: create-application + namespace: argo spec: arguments: parameters: @@ -11,6 +12,8 @@ spec: value: "lma" - name: repository_url value: "https://github.com/openinfradev/decapod-manifests" + - name: revision + value: main templates: - name: createApp inputs: diff --git a/templates/argo-cd/prepare-argocd-wftpl.yaml b/templates/argo-cd/prepare-argocd-wftpl.yaml index f2bed88..a732080 100644 --- a/templates/argo-cd/prepare-argocd-wftpl.yaml +++ b/templates/argo-cd/prepare-argocd-wftpl.yaml @@ -2,6 +2,7 @@ apiVersion: argoproj.io/v1alpha1 kind: WorkflowTemplate metadata: name: prepare-argocd + namespace: argo spec: entrypoint: preparation arguments: @@ -51,24 +52,23 @@ spec: - /bin/bash - '-c' - | - ./argocd login $ARGO_SERVER --insecure --username $ARGO_USERNAME + ./argocd login $ARGO_SERVER --insecure --username $ARGO_USERNAME \ --password $ARGO_PASSWORD + ./argocd proj get lma + if [[ $? != 0 ]]; then + ./argocd proj create lma --dest "*,*" --src "*" --allow-cluster-resource "*/*" + fi - ./argocd proj create lma --upsert - ./argocd proj allow-cluster-resource lma '*' '*' - ./argocd proj add-destination lma '*' '*' - ./argocd proj add-source lma '*' + ./argocd proj get servicemesh + if [[ $? != 0 ]]; then + ./argocd proj create servicemesh --dest "*,*" --src "*" --allow-cluster-resource "*/*" + fi - ./argocd proj create service-mesh --upsert - ./argocd proj allow-cluster-resource service-mesh '*' '*' - ./argocd proj add-destination service-mesh '*' '*' - ./argocd proj add-source service-mesh '*' - - ./argocd proj create openstack --upsert - ./argocd proj allow-cluster-resource openstack '*' '*' - ./argocd proj add-destination openstack '*' '*' - ./argocd proj add-source openstack '*' + ./argocd proj get openstack + if [[ $? != 0 ]]; then + ./argocd proj create openstack --dest "*,*" --src "*" --allow-cluster-resource "*/*" + fi env: - name: ARGO_SERVER value: '{{workflow.parameters.argo_server}}' diff --git a/templates/decapod-apps/service-mesh-wf.yaml b/templates/decapod-apps/service-mesh-wf.yaml index de343fb..4b3fb62 100644 --- a/templates/decapod-apps/service-mesh-wf.yaml +++ b/templates/decapod-apps/service-mesh-wf.yaml @@ -10,7 +10,7 @@ spec: - name: site_name value: "hanu-reference" - name: app_name - value: "service-mesh" + value: "servicemesh" - name: repository_url value: "https://github.com/openinfradev/decapod-manifests" templates: