Skip to content

Commit

Permalink
unify sub-path param name between s2i and pack
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vasek <[email protected]>
  • Loading branch information
matejvasek committed Oct 19, 2023
1 parent 38e41cf commit 5751ac9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)"
Expand Down
8 changes: 4 additions & 4 deletions pkg/pipelines/tekton/task_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)"
Expand Down
4 changes: 2 additions & 2 deletions pkg/pipelines/tekton/templates_s2i.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5751ac9

Please sign in to comment.