From 4a2c0f8a274139ac6dd9c343dbedeb73f8792e38 Mon Sep 17 00:00:00 2001 From: doddatpivotal Date: Thu, 5 May 2022 10:26:54 -0400 Subject: [PATCH 1/5] Adds additional options for common replacements --- Tiltfile | 1 + accelerator.yaml | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Tiltfile b/Tiltfile index c5f2b55f..dd9c2725 100644 --- a/Tiltfile +++ b/Tiltfile @@ -20,3 +20,4 @@ k8s_custom_deploy( k8s_resource('tanzu-java-web-app', port_forwards=["8080:8080"], extra_pod_selectors=[{'serving.knative.dev/service': 'tanzu-java-web-app'}]) +allow_k8s_contexts('kind-cluster') diff --git a/accelerator.yaml b/accelerator.yaml index 77b4bb4f..f58fc810 100644 --- a/accelerator.yaml +++ b/accelerator.yaml @@ -14,6 +14,21 @@ accelerator: label: Prefix for the container image repository defaultValue: dev.local required: true + - name: iterateClusterContext + inputType: text + label: Allowed Kubernetes context for iterative development + defaultValue: kind-cluster + required: true + - name: developerNamespace + inputType: text + label: Developer namespace on Kubernetes cluster + defaultValue: default + required: true + - name: codeRepositoryUrl + inputType: text + label: Eventual git repository origin + defaultValue: https://github.com/sample-accelerators/tanzu-java-web-app + required: true engine: merge: @@ -29,6 +44,18 @@ engine: substitutions: - text: your-registry.io/project with: "#repositoryPrefix" + - type: ReplaceText + substitutions: + - text: kind-cluster + with: "#iterateClusterContext" + - type: ReplaceText + substitutions: + - text: "'default'" + with: "'#developerNamespace'" + - type: ReplaceText + substitutions: + - text: https://github.com/sample-accelerators/tanzu-java-web-app + with: "#codeRepositoryUrl" - include: [ "README.md" ] chain: - type: ReplaceText From eea0eee25fb70c8439a2ad7254cb0edc6a2bed72 Mon Sep 17 00:00:00 2001 From: doddatpivotal Date: Thu, 5 May 2022 10:37:00 -0400 Subject: [PATCH 2/5] Resolves escaping error --- accelerator.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accelerator.yaml b/accelerator.yaml index f58fc810..a753f1cb 100644 --- a/accelerator.yaml +++ b/accelerator.yaml @@ -51,10 +51,10 @@ engine: - type: ReplaceText substitutions: - text: "'default'" - with: "'#developerNamespace'" + with: "'\'' + #developerNamespace '\''" - type: ReplaceText substitutions: - - text: https://github.com/sample-accelerators/tanzu-java-web-app + - text: https://github.com/sample-accelerators/#artifactId with: "#codeRepositoryUrl" - include: [ "README.md" ] chain: From 4d43cf616932c26e0020e32b3dc1855e7b20d2dc Mon Sep 17 00:00:00 2001 From: doddatpivotal Date: Thu, 5 May 2022 10:41:16 -0400 Subject: [PATCH 3/5] Continued troubleshooting --- accelerator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accelerator.yaml b/accelerator.yaml index a753f1cb..0f835396 100644 --- a/accelerator.yaml +++ b/accelerator.yaml @@ -51,7 +51,7 @@ engine: - type: ReplaceText substitutions: - text: "'default'" - with: "'\'' + #developerNamespace '\''" + with: "'''' + #developerNamespace + ''''" - type: ReplaceText substitutions: - text: https://github.com/sample-accelerators/#artifactId From d963410b53c9c59f049a760f37ac6721356432fd Mon Sep 17 00:00:00 2001 From: doddatpivotal Date: Thu, 5 May 2022 10:43:28 -0400 Subject: [PATCH 4/5] Attempts to resolve git reference in workload --- accelerator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accelerator.yaml b/accelerator.yaml index 0f835396..cd242f64 100644 --- a/accelerator.yaml +++ b/accelerator.yaml @@ -54,7 +54,7 @@ engine: with: "'''' + #developerNamespace + ''''" - type: ReplaceText substitutions: - - text: https://github.com/sample-accelerators/#artifactId + - text: "'https://github.com/sample-accelerators/' + #artifactId" with: "#codeRepositoryUrl" - include: [ "README.md" ] chain: From e150a2889302cd09bb5037771f7df17cb2c7450d Mon Sep 17 00:00:00 2001 From: doddatpivotal Date: Thu, 5 May 2022 10:45:30 -0400 Subject: [PATCH 5/5] Attepts to resolve git repo url again --- accelerator.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accelerator.yaml b/accelerator.yaml index cd242f64..12f7ee78 100644 --- a/accelerator.yaml +++ b/accelerator.yaml @@ -36,6 +36,10 @@ engine: exclude: [ "config/*.yaml", "Tiltfile", "README.md", "catalog/*.yaml", ".github/workflows/**" ] - include: [ "config/*.yaml", "Tiltfile" ] chain: + - type: ReplaceText + substitutions: + - text: https://github.com/sample-accelerators/tanzu-java-web-app + with: "#codeRepositoryUrl" - type: ReplaceText substitutions: - text: tanzu-java-web-app @@ -52,10 +56,6 @@ engine: substitutions: - text: "'default'" with: "'''' + #developerNamespace + ''''" - - type: ReplaceText - substitutions: - - text: "'https://github.com/sample-accelerators/' + #artifactId" - with: "#codeRepositoryUrl" - include: [ "README.md" ] chain: - type: ReplaceText