From 5751ac995e6bb7863097d4fe44b273e1493413f3 Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Fri, 6 Oct 2023 16:36:53 +0200 Subject: [PATCH] unify sub-path param name between s2i and pack Signed-off-by: Matej Vasek --- .../resources/tekton/task/func-s2i/0.1/func-s2i.yaml | 8 ++++---- pkg/pipelines/tekton/task_defs.go | 8 ++++---- pkg/pipelines/tekton/templates_s2i.go | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/pipelines/resources/tekton/task/func-s2i/0.1/func-s2i.yaml b/pkg/pipelines/resources/tekton/task/func-s2i/0.1/func-s2i.yaml index cbf92216e6..9a2f7a3b92 100644 --- a/pkg/pipelines/resources/tekton/task/func-s2i/0.1/func-s2i.yaml +++ b/pkg/pipelines/resources/tekton/task/func-s2i/0.1/func-s2i.yaml @@ -26,7 +26,7 @@ spec: description: Reference of the image S2I will produce. - name: REGISTRY description: The registry associated with the function image. - - name: PATH_CONTEXT + - name: SOURCE_SUBPATH description: The location of the path to run s2i from. default: . - name: TLSVERIFY @@ -78,14 +78,14 @@ spec: cat /env-vars/env-file echo "------------------------------" - /usr/local/bin/s2i --loglevel=$(params.LOGLEVEL) build $(params.PATH_CONTEXT) $(params.BUILDER_IMAGE) \ + /usr/local/bin/s2i --loglevel=$(params.LOGLEVEL) build $(params.SOURCE_SUBPATH) $(params.BUILDER_IMAGE) \ --image-scripts-url $(params.S2I_IMAGE_SCRIPTS_URL) \ --as-dockerfile /gen-source/Dockerfile.gen --environment-file /env-vars/env-file echo "Preparing func.yaml for later deployment" func_file="$(workspaces.source.path)/func.yaml" - if [ "$(params.PATH_CONTEXT)" != "" ]; then - func_file="$(workspaces.source.path)/$(params.PATH_CONTEXT)/func.yaml" + if [ "$(params.SOURCE_SUBPATH)" != "" ]; then + func_file="$(workspaces.source.path)/$(params.SOURCE_SUBPATH)/func.yaml" fi sed -i "s|^registry:.*$|registry: $(params.REGISTRY)|" "$func_file" echo "Function image registry: $(params.REGISTRY)" diff --git a/pkg/pipelines/tekton/task_defs.go b/pkg/pipelines/tekton/task_defs.go index 98a680dd57..3aae85e9ef 100644 --- a/pkg/pipelines/tekton/task_defs.go +++ b/pkg/pipelines/tekton/task_defs.go @@ -360,7 +360,7 @@ var S2ITask = v1beta1.Task{ Description: "The registry associated with the function image.", }, v1beta1.ParamSpec{ - Name: "PATH_CONTEXT", + Name: "SOURCE_SUBPATH", Description: "The location of the path to run s2i from.", Default: &v1beta1.ParamValue{ Type: "string", @@ -435,14 +435,14 @@ echo "------------------------------" cat /env-vars/env-file echo "------------------------------" -/usr/local/bin/s2i --loglevel=$(params.LOGLEVEL) build $(params.PATH_CONTEXT) $(params.BUILDER_IMAGE) \ +/usr/local/bin/s2i --loglevel=$(params.LOGLEVEL) build $(params.SOURCE_SUBPATH) $(params.BUILDER_IMAGE) \ --image-scripts-url $(params.S2I_IMAGE_SCRIPTS_URL) \ --as-dockerfile /gen-source/Dockerfile.gen --environment-file /env-vars/env-file echo "Preparing func.yaml for later deployment" func_file="$(workspaces.source.path)/func.yaml" -if [ "$(params.PATH_CONTEXT)" != "" ]; then - func_file="$(workspaces.source.path)/$(params.PATH_CONTEXT)/func.yaml" +if [ "$(params.SOURCE_SUBPATH)" != "" ]; then + func_file="$(workspaces.source.path)/$(params.SOURCE_SUBPATH)/func.yaml" fi sed -i "s|^registry:.*$|registry: $(params.REGISTRY)|" "$func_file" echo "Function image registry: $(params.REGISTRY)" diff --git a/pkg/pipelines/tekton/templates_s2i.go b/pkg/pipelines/tekton/templates_s2i.go index 08329ea2dc..94baa1db8c 100644 --- a/pkg/pipelines/tekton/templates_s2i.go +++ b/pkg/pipelines/tekton/templates_s2i.go @@ -93,7 +93,7 @@ func GetS2IPipeline(f fn.Function) (*v1beta1.Pipeline, error) { }, }, v1beta1.Param{ - Name: "PATH_CONTEXT", + Name: "SOURCE_SUBPATH", Value: v1beta1.ParamValue{ Type: "string", StringVal: "$(params.contextDir)", @@ -440,7 +440,7 @@ spec: value: $(params.imageName) - name: REGISTRY value: $(params.registry) - - name: PATH_CONTEXT + - name: SOURCE_SUBPATH value: $(params.contextDir) - name: BUILDER_IMAGE value: $(params.builderImage)