Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: embed tkn tasks in func binary #2396

Merged
merged 5 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions cmd/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"knative.dev/func/pkg/config"
"knative.dev/func/pkg/functions"
"knative.dev/func/pkg/k8s"
"knative.dev/func/pkg/pipelines/tekton"
)

var format string = "json"
Expand Down Expand Up @@ -67,7 +66,6 @@ type Environment struct {
Templates map[string][]string
Environment []string
Cluster string
TektonTasks map[string]string
Defaults config.Global
Function *functions.Function `json:",omitempty" yaml:",omitempty"`
Instance *functions.Instance `json:",omitempty" yaml:",omitempty"`
Expand Down Expand Up @@ -137,11 +135,6 @@ func runEnvironment(cmd *cobra.Command, newClient ClientFactory, v *Version) (er
Environment: envs,
Cluster: host,
Defaults: defaults,
TektonTasks: map[string]string{
"func-buildpack": tekton.BuildpackTaskURL,
"func-s2i": tekton.S2ITaskURL,
"func-deploy": tekton.DeployTaskURL,
},
}

function, instance := describeFuncInformation(cmd.Context(), newClient, cfg)
Expand Down
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Learn more about Knative at: https://knative.dev`, cfg.Name),
Commands: []*cobra.Command{
NewCompletionCmd(),
NewVersionCmd(cfg.Version),
NewTektonClusterTasksCmd(),
},
},
}
Expand Down
27 changes: 27 additions & 0 deletions cmd/tkn_tasks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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 -
matejvasek marked this conversation as resolved.
Show resolved Hide resolved
`,
Hidden: true,
RunE: func(cmd *cobra.Command, args []string) error {
_, err := fmt.Fprintln(cmd.OutOrStdout(), tekton.GetClusterTasks())
return err
},
}

return cmd
}
3 changes: 3 additions & 0 deletions docs/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func ignoreConfigEnv() (done func()) {
// string to the file name, and recursively calls itself for each subcommand.
func processSubCommands(c *cobra.Command, parent string, opts TemplateOptions) error {
for _, cc := range c.Commands() {
if cc.Hidden {
continue
}
name := cc.Name()
if name == "help" {
continue
Expand Down

This file was deleted.

136 changes: 0 additions & 136 deletions pkg/pipelines/resources/tekton/task/func-s2i/0.1/func-s2i.yaml

This file was deleted.

Loading
Loading