diff --git a/cmd/func-util/main.go b/cmd/func-util/main.go index fdaa31a132..e644a6294c 100644 --- a/cmd/func-util/main.go +++ b/cmd/func-util/main.go @@ -26,6 +26,8 @@ import ( "knative.dev/func/pkg/tar" ) +const middlewareFileName = "middleware-version" + func main() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -93,13 +95,18 @@ func scaffold(ctx context.Context) error { middlewareVersion, err := scaffolding.MiddlewareVersion(f.Root, f.Runtime, f.Invoke, embeddedRepo.FS()) if err != nil { - return fmt.Errorf("cannot get middleware version: %w", err) + _, _ = fmt.Fprintf(os.Stderr, "warning: cannot get middleware version: %v\n", err) + middlewareVersion = "" } if err := os.WriteFile("/tekton/results/middlewareVersion", []byte(middlewareVersion), 0644); err != nil { return fmt.Errorf("cannot write middleware version as a result: %w", err) } + if err := os.WriteFile(middlewareFileName, []byte(middlewareVersion), 0644); err != nil { + return fmt.Errorf("cannot write middleware version as a file: %w", err) + } + if f.Runtime != "go" && f.Runtime != "python" { // Scaffolding is for now supported/needed only for Go/Python. return nil @@ -142,6 +149,7 @@ func s2iCmd(ctx context.Context) error { } func deploy(ctx context.Context) error { + const imageDigestFileName = "image-digest" var err error deployer := knative.NewDeployer( knative.WithDeployerVerbose(true), @@ -161,8 +169,14 @@ func deploy(ctx context.Context) error { if err != nil { return fmt.Errorf("cannot load function: %w", err) } + + var digestPart string + if d, err := os.ReadFile(imageDigestFileName); err == nil { + digestPart = "@" + string(d) + } + if len(os.Args) > 2 { - f.Deploy.Image = os.Args[2] + f.Deploy.Image = os.Args[2] + digestPart } if f.Deploy.Image == "" { f.Deploy.Image = f.Image diff --git a/cmd/func-util/s2i_generate.go b/cmd/func-util/s2i_generate.go index 23c276c8c8..3db6bb3830 100644 --- a/cmd/func-util/s2i_generate.go +++ b/cmd/func-util/s2i_generate.go @@ -46,6 +46,15 @@ func newS2IGenerateCmd() *cobra.Command { genCmd := &cobra.Command{ RunE: func(cmd *cobra.Command, args []string) error { config.envVars = args + + if config.middlewareVersion == "" { + bs, err := os.ReadFile(middlewareFileName) + if err != nil { + return fmt.Errorf("cannot read middleware file: %w", err) + } + config.middlewareVersion = string(bs) + } + return runS2IGenerate(cmd.Context(), config) }, } diff --git a/hack/cluster.sh b/hack/cluster.sh index 7d190a3553..1953659045 100755 --- a/hack/cluster.sh +++ b/hack/cluster.sh @@ -500,18 +500,6 @@ tekton() { $KUBECTL create clusterrolebinding "${namespace}:knative-serving-namespaced-admin" --clusterrole=knative-serving-namespaced-admin --serviceaccount="${namespace}:default" - # TEMPORARY WORKAROUND: Disable affinity assistant to prevent pod scheduling issues - # This is a workaround for issues where affinity assistant pod names don't match - # what's expected by task pods, causing them to fail scheduling. - # Related issues: - # - https://github.com/tektoncd/pipeline/issues/6740 - # - https://github.com/tektoncd/pipeline/issues/7503 - # TODO: Remove this workaround once the underlying Tekton issue is resolved - echo "${blue}- Disabling affinity assistant (temporary workaround)${reset}" - $KUBECTL patch configmap feature-flags -n tekton-pipelines \ - -p '{"data":{"disable-affinity-assistant":"true", "coschedule":"disabled"}}' \ - --type=merge - echo "${green}✅ Tekton${reset}" } diff --git a/pkg/pipelines/tekton/gitlab_int_test.go b/pkg/pipelines/tekton/gitlab_int_test.go index 3978967147..074bedbe7b 100644 --- a/pkg/pipelines/tekton/gitlab_int_test.go +++ b/pkg/pipelines/tekton/gitlab_int_test.go @@ -32,6 +32,7 @@ import ( pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1" v1 "k8s.io/api/core/v1" + rbacV1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/uuid" "knative.dev/pkg/apis" @@ -112,7 +113,7 @@ func TestInt_Gitlab(t *testing.T) { t.Fatal(err) } - err = os.WriteFile(filepath.Join(projDir, "Procfile"), []byte("web: non-existent-app\n"), 0644) + err = os.WriteFile(filepath.Join(projDir, "main.go"), []byte(mainGo), 0644) if err != nil { t.Fatal(err) } @@ -173,13 +174,32 @@ func TestInt_Gitlab(t *testing.T) { case <-buildDoneCh: t.Log("build done on time") case <-time.After(time.Minute * 10): - t.Error("build has not been done in time (15 minute timeout)") + t.Error("build has not been done in time (10 minute timeout)") case <-ctx.Done(): t.Error("cancelled") } } +const mainGo = `package main + +import "net/http" + +func main() { + s := http.Server{ + Handler: http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + writer.WriteHeader(200) + _, _ = writer.Write([]byte("OK")) + }), + Addr: ":8080", + } + err := s.ListenAndServe() + if err != nil { + panic(err) + } +} +` + func parseEnv(t *testing.T) (gitlabHostname string, gitlabRootPassword string, pacCtrHostname string, err error) { if enabled, _ := strconv.ParseBool(os.Getenv("FUNC_INT_GITLAB_ENABLED")); !enabled { t.Skip("GitLab tests are disabled") @@ -615,9 +635,39 @@ func usingNamespace(t *testing.T) string { t.Fatal(err) } t.Cleanup(func() { - deleteOpts := metav1.DeleteOptions{} + pp := metav1.DeletePropagationForeground + deleteOpts := metav1.DeleteOptions{ + PropagationPolicy: &pp, + } _ = k8sClient.CoreV1().Namespaces().Delete(context.Background(), name, deleteOpts) }) + + crbName := name + ":knative-serving-namespaced-admin" + crb := &rbacV1.ClusterRoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: crbName, + }, + Subjects: []rbacV1.Subject{ + { + Kind: "ServiceAccount", + Name: "default", + Namespace: name, + }, + }, + RoleRef: rbacV1.RoleRef{ + Name: "knative-serving-namespaced-admin", + Kind: "ClusterRole", + APIGroup: "rbac.authorization.k8s.io", + }, + } + _, err = k8sClient.RbacV1().ClusterRoleBindings().Create(context.Background(), crb, metav1.CreateOptions{}) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { + _ = k8sClient.RbacV1().ClusterRoleBindings().Delete(context.Background(), crbName, metav1.DeleteOptions{}) + }) + return name } diff --git a/pkg/pipelines/tekton/tasks.go b/pkg/pipelines/tekton/tasks.go index 9da22c8b55..2761ad8d7f 100644 --- a/pkg/pipelines/tekton/tasks.go +++ b/pkg/pipelines/tekton/tasks.go @@ -25,7 +25,7 @@ func init() { } func getBuildpackTask() string { - return `apiVersion: tekton.dev/v1 + return fmt.Sprintf(`apiVersion: tekton.dev/v1 kind: Task metadata: name: func-buildpacks @@ -56,6 +56,10 @@ spec: optional: true params: + - name: GIT_REPOSITORY + description: "" + - name: GIT_REVISION + description: "" - name: APP_IMAGE description: The name of where to store the app image. - name: REGISTRY @@ -90,16 +94,36 @@ spec: description: The name of the platform directory. default: empty-dir - results: - - name: IMAGE_DIGEST - description: The digest of the built "APP_IMAGE". - stepTemplate: env: - name: CNB_PLATFORM_API value: "0.10" steps: + + - name: fetch-src + ref: + resolver: http + params: + - name: url + value: https://raw.githubusercontent.com/tektoncd/catalog/c9818f3d/stepaction/git-clone/0.2/git-clone.yaml + when: + - input: "$(params.GIT_REPOSITORY)" + operator: notin + values: [""] + params: + - name: "output-path" + value: "$(workspaces.source.path)" + - name: "url" + value: "$(params.GIT_REPOSITORY)" + - name: "revision" + value: "$(params.GIT_REVISION)" + + - name: func-scaffold + image: %s + workingDir: $(workspaces.source.path) + command: ["scaffold", $(params.SOURCE_SUBPATH)] + - name: prepare image: docker.io/library/bash:5.1 args: @@ -211,13 +235,13 @@ spec: script: | #!/usr/bin/env bash set -e - cat /layers/report.toml | grep "digest" | cut -d'"' -f2 | cut -d'"' -f2 | tr -d '\n' | tee $(results.IMAGE_DIGEST.path) + cat /layers/report.toml | grep "digest" | cut -d'"' -f2 | cut -d'"' -f2 | tr -d '\n' | tee $(workspaces.source.path)/image-digest ############################################ ##### Added part for Knative Functions ##### ############################################ - digest=$(cat $(results.IMAGE_DIGEST.path)) + digest=$(cat $(workspaces.source.path)/image-digest) func_file="$(workspaces.source.path)/func.yaml" if [ "$(params.SOURCE_SUBPATH)" != "" ]; then @@ -249,12 +273,17 @@ spec: - name: empty-dir mountPath: /emptyDir + - name: func-deploy + image: "%s" + workingDir: $(workspaces.source.path) + command: ["deploy", $(params.SOURCE_SUBPATH), "$(params.APP_IMAGE)"] + volumes: - name: empty-dir emptyDir: {} - name: layers-dir emptyDir: {} -` +`, ScaffoldImage, DeployerImage) } func getS2ITask() string { @@ -280,6 +309,10 @@ spec: building and running the source code. params: + - name: GIT_REPOSITORY + description: "" + - name: GIT_REVISION + description: "" - name: BUILDER_IMAGE description: The location of the s2i builder image. - name: IMAGE @@ -303,9 +336,6 @@ spec: - name: S2I_IMAGE_SCRIPTS_URL description: The URL containing the default assemble and run scripts for the builder image. default: "image:///usr/libexec/s2i" - - name: MIDDLEWARE_VERSION - description: Used middleware version - default: "" workspaces: - name: source - name: cache @@ -319,10 +349,32 @@ spec: for Buildah to access the container registry. The file should be placed at the root of the Workspace with name config.json. optional: true - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. + steps: + + - name: fetch-src + ref: + resolver: http + params: + - name: url + value: https://raw.githubusercontent.com/tektoncd/catalog/c9818f3d/stepaction/git-clone/0.2/git-clone.yaml + when: + - input: "$(params.GIT_REPOSITORY)" + operator: notin + values: [""] + params: + - name: "output-path" + value: "$(workspaces.source.path)" + - name: "url" + value: "$(params.GIT_REPOSITORY)" + - name: "revision" + value: "$(params.GIT_REVISION)" + + - name: func-scaffold + image: %s + workingDir: $(workspaces.source.path) + command: ["scaffold", $(params.PATH_CONTEXT)] + - name: generate image: %s workingDir: $(workspaces.source.path) @@ -340,14 +392,13 @@ spec: - $(params.S2I_IMAGE_SCRIPTS_URL) - "--log-level" - $(params.LOGLEVEL) - - "--middleware-version" - - $(params.MIDDLEWARE_VERSION) - $(params.ENV_VARS[*]) volumeMounts: - mountPath: /gen-source name: gen-source - mountPath: /env-vars name: env-vars + - name: build image: quay.io/buildah/stable:v1.31.0 workingDir: /gen-source @@ -377,7 +428,7 @@ spec: $(params.IMAGE) docker://$(params.IMAGE) # Output the image digest - cat $(workspaces.source.path)/image-digest | tee /tekton/results/IMAGE_DIGEST + cat $(workspaces.source.path)/image-digest volumeMounts: - name: varlibcontainers mountPath: /var/lib/containers @@ -386,6 +437,12 @@ spec: securityContext: capabilities: add: ["SETFCAP"] + + - name: func-deploy + image: "%s" + workingDir: $(workspaces.source.path) + command: ["deploy", $(params.PATH_CONTEXT), "$(params.IMAGE)"] + volumes: - emptyDir: {} name: varlibcontainers @@ -393,73 +450,12 @@ spec: name: gen-source - emptyDir: {} name: env-vars -`, S2IImage) -} - -func getDeployTask() string { - return fmt.Sprintf(`apiVersion: tekton.dev/v1 -kind: Task -metadata: - name: func-deploy - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/categories: CLI - tekton.dev/tags: cli - tekton.dev/platforms: "linux/amd64" -spec: - description: >- - This Task performs a deploy operation using the Knative "func"" CLI - params: - - name: path - description: Path to the function project - default: "" - - name: image - description: Container image to be deployed - default: "" - workspaces: - - name: source - description: The workspace containing the function project - steps: - - name: func-deploy - image: "%s" - command: ["deploy", "$(params.path)", "$(params.image)"] -`, DeployerImage) -} - -func getScaffoldTask() string { - return fmt.Sprintf(`apiVersion: tekton.dev/v1 -kind: Task -metadata: - name: func-scaffold - labels: - app.kubernetes.io/version: "0.1" - annotations: - tekton.dev/pipelines.minVersion: "0.12.1" - tekton.dev/categories: CLI - tekton.dev/tags: cli - tekton.dev/platforms: "linux/amd64" -spec: - params: - - name: path - description: Path to the function project - default: "" - results: - - name: middlewareVersion - workspaces: - - name: source - description: The workspace containing the function project - steps: - - name: func-scaffold - image: %s - command: ["scaffold", "$(params.path)"] -`, ScaffoldImage) +`, ScaffoldImage, S2IImage, DeployerImage) } // GetClusterTasks returns multi-document yaml containing tekton tasks used by func. func GetClusterTasks() string { - tasks := getBuildpackTask() + "\n---\n" + getS2ITask() + "\n---\n" + getDeployTask() + "\n---\n" + getScaffoldTask() + tasks := getBuildpackTask() + "\n---\n" + getS2ITask() tasks = strings.ReplaceAll(tasks, "kind: Task", "kind: ClusterTask") tasks = strings.ReplaceAll(tasks, "apiVersion: tekton.dev/v1", "apiVersion: tekton.dev/v1beta1") return tasks diff --git a/pkg/pipelines/tekton/templates.go b/pkg/pipelines/tekton/templates.go index cd2499f8b3..b008eca177 100644 --- a/pkg/pipelines/tekton/templates.go +++ b/pkg/pipelines/tekton/templates.go @@ -22,53 +22,9 @@ const ( // Local resources properties resourcesDirectory = ".tekton" pipelineFileName = "pipeline.yaml" - pipelineRunFilenane = "pipeline-run.yaml" pipelineFileNamePAC = "pipeline-pac.yaml" pipelineRunFilenamePAC = "pipeline-run-pac.yaml" - // Tasks references for PAC PipelineRun that are defined in the annotations - taskGitCloneRef = "git-clone" - - // Following part holds a reference to Git Clone Task to be used in Pipeline template, - // the usage depends whether we use direct code upload or Git reference for a standard (non PAC) on-cluster build - taskGitClonePACTaskRef = `- name: fetch-sources - params: - - name: url - value: $(params.gitRepository) - - name: revision - value: $(params.gitRevision) - - name: gitInitImage - value: ghcr.io/tektoncd/github.com/tektoncd/pipeline/cmd/git-init:v0.21.0 - taskRef: - kind: Task - name: git-clone - workspaces: - - name: output - workspace: source-workspace` - // TODO fix Tekton Hub reference - taskGitCloneTaskRef = `- name: fetch-sources - params: - - name: url - value: $(params.gitRepository) - - name: revision - value: $(params.gitRevision) - - name: gitInitImage - value: ghcr.io/tektoncd/github.com/tektoncd/pipeline/cmd/git-init:v0.21.0 - taskRef: - resolver: hub - params: - - name: kind - value: task - - name: name - value: git-clone - - name: version - value: "0.4" - workspaces: - - name: output - workspace: source-workspace` - runAfterFetchSourcesRef = `runAfter: - - fetch-sources` - // S2I related properties defaultS2iImageScriptsUrl = "image:///usr/libexec/s2i" quarkusS2iImageScriptsUrl = "image:///usr/local/s2i" @@ -121,14 +77,8 @@ type templateData struct { Revision string // Task references - GitCloneTaskRef string FuncBuildpacksTaskRef string FuncS2iTaskRef string - FuncDeployTaskRef string - FuncScaffoldTaskRef string - - // Reference for build task - whether it should run after fetch-sources task or not - RunAfterFetchSources string PipelineYamlURL string @@ -143,12 +93,10 @@ type templateData struct { // it creates the resource in the project directory func createPipelineTemplatePAC(f fn.Function, labels map[string]string) error { data := templateData{ - FunctionName: f.Name, - Annotations: f.Deploy.Annotations, - Labels: labels, - PipelineName: getPipelineName(f), - RunAfterFetchSources: runAfterFetchSourcesRef, - GitCloneTaskRef: taskGitClonePACTaskRef, + FunctionName: f.Name, + Annotations: f.Deploy.Annotations, + Labels: labels, + PipelineName: getPipelineName(f), } for _, val := range []struct { @@ -157,8 +105,6 @@ func createPipelineTemplatePAC(f fn.Function, labels map[string]string) error { }{ {getBuildpackTask(), &data.FuncBuildpacksTaskRef}, {getS2ITask(), &data.FuncS2iTaskRef}, - {getDeployTask(), &data.FuncDeployTaskRef}, - {getScaffoldTask(), &data.FuncScaffoldTaskRef}, } { ts, err := getTaskSpec(val.ref) if err != nil { @@ -237,8 +183,6 @@ func createPipelineRunTemplatePAC(f fn.Function, labels map[string]string) error PipelinesTargetBranch: pipelinesTargetBranch, - GitCloneTaskRef: taskGitCloneRef, - PipelineYamlURL: fmt.Sprintf("%s/%s", resourcesDirectory, pipelineFileNamePAC), S2iImageScriptsUrl: s2iImageScriptsUrl, @@ -344,20 +288,12 @@ func getTaskSpec(taskYaml string) (string, error) { func createAndApplyPipelineTemplate(f fn.Function, namespace string, labels map[string]string) error { // If Git is set up create fetch task and reference it from build task, // otherwise sources have been already uploaded to workspace PVC. - gitCloneTaskRef := "" - runAfterFetchSources := "" - if f.Build.Git.URL != "" { - runAfterFetchSources = runAfterFetchSourcesRef - gitCloneTaskRef = taskGitCloneTaskRef - } data := templateData{ - FunctionName: f.Name, - Annotations: f.Deploy.Annotations, - Labels: labels, - PipelineName: getPipelineName(f), - RunAfterFetchSources: runAfterFetchSources, - GitCloneTaskRef: gitCloneTaskRef, + FunctionName: f.Name, + Annotations: f.Deploy.Annotations, + Labels: labels, + PipelineName: getPipelineName(f), } for _, val := range []struct { @@ -366,8 +302,6 @@ func createAndApplyPipelineTemplate(f fn.Function, namespace string, labels map[ }{ {getBuildpackTask(), &data.FuncBuildpacksTaskRef}, {getS2ITask(), &data.FuncS2iTaskRef}, - {getDeployTask(), &data.FuncDeployTaskRef}, - {getScaffoldTask(), &data.FuncScaffoldTaskRef}, } { ts, err := getTaskSpec(val.ref) if err != nil { diff --git a/pkg/pipelines/tekton/templates_pack.go b/pkg/pipelines/tekton/templates_pack.go index e9ab0e3953..30ac671d11 100644 --- a/pkg/pipelines/tekton/templates_pack.go +++ b/pkg/pipelines/tekton/templates_pack.go @@ -3,7 +3,7 @@ package tekton const ( // packPipelineTemplate contains the Buildpacks template used for both Tekton standard and PAC Pipeline packPipelineTemplate = ` -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Pipeline metadata: labels: @@ -41,18 +41,12 @@ spec: name: buildEnvs type: array tasks: - {{.GitCloneTaskRef}} - - name: scaffold - params: - - name: path - value: $(workspaces.source.path)/$(params.contextDir) - workspaces: - - name: source - workspace: source-workspace - {{.RunAfterFetchSources}} - {{.FuncScaffoldTaskRef}} - name: build params: + - name: GIT_REPOSITORY + value: $(params.gitRepository) + - name: GIT_REVISION + value: $(params.gitRevision) - name: APP_IMAGE value: $(params.imageName) - name: REGISTRY @@ -64,8 +58,6 @@ spec: - name: ENV_VARS value: - '$(params.buildEnvs[*])' - runAfter: - - scaffold {{.FuncBuildpacksTaskRef}} workspaces: - name: source @@ -74,18 +66,6 @@ spec: workspace: cache-workspace - name: dockerconfig workspace: dockerconfig-workspace - - name: deploy - params: - - name: path - value: $(workspaces.source.path)/$(params.contextDir) - - name: image - value: $(params.imageName)@$(tasks.build.results.IMAGE_DIGEST) - runAfter: - - build - {{.FuncDeployTaskRef}} - workspaces: - - name: source - workspace: source-workspace workspaces: - description: Directory where function source is located. name: source-workspace @@ -98,7 +78,7 @@ spec: // packRunTemplate contains the Buildpacks template used for Tekton standard PipelineRun packRunTemplate = ` -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: PipelineRun metadata: labels: @@ -148,7 +128,7 @@ spec: ` // packRunTemplatePAC contains the Buildpacks template used for the Tekton PAC PipelineRun packRunTemplatePAC = ` -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: PipelineRun metadata: labels: @@ -164,9 +144,6 @@ metadata: # The branch or tag we are targeting (ie: main, refs/tags/*) pipelinesascode.tekton.dev/on-target-branch: "[{{.PipelinesTargetBranch}}]" - # Fetch the git-clone task from hub - pipelinesascode.tekton.dev/task: {{.GitCloneTaskRef}} - # How many runs we want to keep attached to this event pipelinesascode.tekton.dev/max-keep-runs: "5" diff --git a/pkg/pipelines/tekton/templates_s2i.go b/pkg/pipelines/tekton/templates_s2i.go index e938e9677b..9441a9c5c6 100644 --- a/pkg/pipelines/tekton/templates_s2i.go +++ b/pkg/pipelines/tekton/templates_s2i.go @@ -3,7 +3,7 @@ package tekton const ( // s2iPipelineTemplate contains the S2I template used for both Tekton standard and PAC Pipeline s2iPipelineTemplate = ` -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Pipeline metadata: labels: @@ -48,23 +48,13 @@ spec: name: tlsVerify type: string default: 'true' - - description: Used middleware version - name: middlewareVersion - type: string - default: '' tasks: - {{.GitCloneTaskRef}} - - name: scaffold - params: - - name: path - value: $(workspaces.source.path)/$(params.contextDir) - workspaces: - - name: source - workspace: source-workspace - {{.RunAfterFetchSources}} - {{.FuncScaffoldTaskRef}} - name: build params: + - name: GIT_REPOSITORY + value: $(params.gitRepository) + - name: GIT_REVISION + value: $(params.gitRevision) - name: IMAGE value: $(params.imageName) - name: REGISTRY @@ -80,10 +70,6 @@ spec: value: $(params.s2iImageScriptsUrl) - name: TLSVERIFY value: $(params.tlsVerify) - - name: MIDDLEWARE_VERSION - value: $(tasks.scaffold.results.middlewareVersion) - runAfter: - - scaffold {{.FuncS2iTaskRef}} workspaces: - name: source @@ -92,18 +78,6 @@ spec: workspace: cache-workspace - name: dockerconfig workspace: dockerconfig-workspace - - name: deploy - params: - - name: path - value: $(workspaces.source.path)/$(params.contextDir) - - name: image - value: $(params.imageName)@$(tasks.build.results.IMAGE_DIGEST) - runAfter: - - build - {{.FuncDeployTaskRef}} - workspaces: - - name: source - workspace: source-workspace workspaces: - description: Directory where function source is located. name: source-workspace @@ -115,7 +89,7 @@ spec: ` // s2iRunTemplate contains the S2I template used for Tekton standard PipelineRun s2iRunTemplate = ` -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: PipelineRun metadata: labels: @@ -169,7 +143,7 @@ spec: ` // s2iRunTemplatePAC contains the S2I template used for Tekton PAC PipelineRun s2iRunTemplatePAC = ` -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: PipelineRun metadata: labels: @@ -185,9 +159,6 @@ metadata: # The branch or tag we are targeting (ie: main, refs/tags/*) pipelinesascode.tekton.dev/on-target-branch: "[{{.PipelinesTargetBranch}}]" - # Fetch the git-clone task from hub - pipelinesascode.tekton.dev/task: {{.GitCloneTaskRef}} - # Fetch the pipelie definition from the .tekton directory pipelinesascode.tekton.dev/pipeline: {{.PipelineYamlURL}}