Skip to content

Commit

Permalink
chore: make tkn taks urls setable via linker flags (#2277)
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vašek <mvasek@redhat.com>
  • Loading branch information
matejvasek committed Apr 23, 2024
1 parent acae72d commit 1aed6e0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions pkg/pipelines/tekton/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,24 @@ var (

taskBasePath = "https://raw.githubusercontent.com/" +
FuncRepoRef + "/" + FuncRepoBranchRef + "/pkg/pipelines/resources/tekton/task/"
BuildpackTaskURL = taskBasePath + "func-buildpacks/0.2/func-buildpacks.yaml"
S2ITaskURL = taskBasePath + "func-s2i/0.1/func-s2i.yaml"
DeployTaskURL = taskBasePath + "func-deploy/0.1/func-deploy.yaml"
BuildpackTaskURL string
S2ITaskURL string
DeployTaskURL string
)

// sets the values only if they have not been set via the linker "-X" flag
func init() {
if BuildpackTaskURL == "" {
BuildpackTaskURL = taskBasePath + "func-buildpacks/0.2/func-buildpacks.yaml"
}
if S2ITaskURL == "" {
S2ITaskURL = taskBasePath + "func-s2i/0.1/func-s2i.yaml"
}
if DeployTaskURL == "" {
DeployTaskURL = taskBasePath + "func-deploy/0.1/func-deploy.yaml"
}
}

type templateData struct {
FunctionName string
Annotations map[string]string
Expand Down

0 comments on commit 1aed6e0

Please sign in to comment.