From 20213fe778829307849e83c0486bd75b168ebf65 Mon Sep 17 00:00:00 2001 From: gauron99 Date: Thu, 3 Sep 2026 15:21:22 +0200 Subject: [PATCH] chore: remove the tkn-tasks subcommand func tkn-tasks printed the embedded Tekton tasks as v1beta1 ClusterTasks for hand installation, added in #2396 for the OpenShift web console's static function plugin. That plugin is not carried by the code shipping in 1.24, ClusterTask is a deprecated API, and nothing in the repository or its docs references the command, which was hidden. The tasks stay embedded and inlined into the Pipelines the CLI creates. --- cmd/root.go | 1 - cmd/tkn_tasks.go | 27 --------------------------- pkg/pipelines/tekton/tasks.go | 9 --------- 3 files changed, 37 deletions(-) delete mode 100644 cmd/tkn_tasks.go diff --git a/cmd/root.go b/cmd/root.go index ec1e2e680f..b246d73b26 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -122,7 +122,6 @@ Learn more about Knative at: https://knative.dev`, cfg.Name), Commands: []*cobra.Command{ NewCompletionCmd(), NewVersionCmd(cfg.Version), - NewTektonClusterTasksCmd(), NewMCPCmd(newClient), }, }, diff --git a/cmd/tkn_tasks.go b/cmd/tkn_tasks.go deleted file mode 100644 index 57b7dd793f..0000000000 --- a/cmd/tkn_tasks.go +++ /dev/null @@ -1,27 +0,0 @@ -package cmd - -import ( - "fmt" - - "github.com/spf13/cobra" - - "knative.dev/func/pkg/pipelines/tekton" -) - -func NewTektonClusterTasksCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "tkn-tasks", - Short: "List tekton cluster tasks as multi-document yaml", - Long: `This command prints tekton tekton task embed in the func binary. -Some advanced functionality like OpenShift's Web Console build my require installation of these tasks. -Installation: func tkn-tasks | kubectl apply -f - -`, - Hidden: true, - RunE: func(cmd *cobra.Command, args []string) error { - _, err := fmt.Fprintln(cmd.OutOrStdout(), tekton.GetClusterTasks()) - return err - }, - } - - return cmd -} diff --git a/pkg/pipelines/tekton/tasks.go b/pkg/pipelines/tekton/tasks.go index 04faf8456d..0c962c3980 100644 --- a/pkg/pipelines/tekton/tasks.go +++ b/pkg/pipelines/tekton/tasks.go @@ -3,7 +3,6 @@ package tekton import ( "bytes" _ "embed" - "strings" "text/template" ) @@ -38,14 +37,6 @@ func getS2ITask() string { return getTask(s2iTaskTemplate) } -// GetClusterTasks returns multi-document yaml containing tekton tasks used by func. -func GetClusterTasks() string { - 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 -} - func getTask(t string) string { tmpl, err := template.New("").Parse(t) if err != nil {