Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Go modules update #191

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 2 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ steps:
- ${_KANIKO_EXTRA_ARGS}
waitFor: ['-']

timeout: 1800s

substitutions:
_KANIKO_IMAGE_TAG: "latest"
_KANIKO_NO_PUSH: "false"
Expand Down
6 changes: 0 additions & 6 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ import (
"github.com/spf13/cobra"
"github.com/triggermesh/tm/pkg/client"
"github.com/triggermesh/tm/pkg/generate"
"github.com/triggermesh/tm/pkg/resources/build"
"github.com/triggermesh/tm/pkg/resources/buildtemplate"
"github.com/triggermesh/tm/pkg/resources/channel"
"github.com/triggermesh/tm/pkg/resources/clusterbuildtemplate"
"github.com/triggermesh/tm/pkg/resources/configuration"
"github.com/triggermesh/tm/pkg/resources/credential"
"github.com/triggermesh/tm/pkg/resources/pipelineresource"
Expand All @@ -50,7 +47,6 @@ var (
registrySecret string
registrySkipTLS bool

b build.Build
c channel.Channel
t task.Task
tr taskrun.TaskRun
Expand All @@ -62,8 +58,6 @@ var (
cf configuration.Configuration
gc credential.GitCreds
rc credential.RegistryCreds
bt buildtemplate.Buildtemplate
cbt clusterbuildtemplate.ClusterBuildtemplate
)

// tmCmd represents the base command when called without any subcommands
Expand Down
36 changes: 0 additions & 36 deletions cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ func newDeleteCmd(clientset *client.ConfigSet) *cobra.Command {
deleteCmd.Flags().StringVarP(&file, "file", "f", "serverless.yaml", "Delete functions defined in yaml")
deleteCmd.Flags().IntVarP(&concurrency, "concurrency", "c", 3, "Number of concurrent deletion threads")
deleteCmd.AddCommand(cmdDeleteConfiguration(clientset))
deleteCmd.AddCommand(cmdDeleteBuildTemplate(clientset))
deleteCmd.AddCommand(cmdDeleteRevision(clientset))
deleteCmd.AddCommand(cmdDeleteService(clientset))
deleteCmd.AddCommand(cmdDeleteBuild(clientset))
deleteCmd.AddCommand(cmdDeleteRoute(clientset))
deleteCmd.AddCommand(cmdDeleteChannel(clientset))
deleteCmd.AddCommand(cmdDeleteTask(clientset))
Expand All @@ -51,40 +49,6 @@ func newDeleteCmd(clientset *client.ConfigSet) *cobra.Command {
return deleteCmd
}

func cmdDeleteBuild(clientset *client.ConfigSet) *cobra.Command {
return &cobra.Command{
Use: "build",
Aliases: []string{"builds"},
Short: "Delete knative build resource",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
b.Name = args[0]
b.Namespace = client.Namespace
if err := b.Delete(clientset); err != nil {
log.Fatalln(err)
}
clientset.Log.Infoln("Build is being deleted")
},
}
}

func cmdDeleteBuildTemplate(clientset *client.ConfigSet) *cobra.Command {
return &cobra.Command{
Use: "buildtemplate",
Aliases: []string{"buildtemplates"},
Short: "Delete knative buildtemplate resource",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
bt.Name = args[0]
bt.Namespace = client.Namespace
if err := bt.Delete(clientset); err != nil {
log.Fatalln(err)
}
clientset.Log.Infoln("BuildTemplate is being deleted")
},
}
}

func cmdDeleteChannel(clientset *client.ConfigSet) *cobra.Command {
return &cobra.Command{
Use: "channel",
Expand Down
52 changes: 2 additions & 50 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ func newDeployCmd(clientset *client.ConfigSet) *cobra.Command {

deployCmd.AddCommand(cmdDeployService(clientset))
deployCmd.AddCommand(cmdDeployChannel(clientset))
deployCmd.AddCommand(cmdDeployBuild(clientset))
deployCmd.AddCommand(cmdDeployBuildTemplate(clientset))
deployCmd.AddCommand(cmdDeployTask(clientset))
deployCmd.AddCommand(cmdDeployTaskRun(clientset))
deployCmd.AddCommand(cmdDeployPipelineResource(clientset))
Expand Down Expand Up @@ -78,13 +76,10 @@ func cmdDeployService(clientset *client.ConfigSet) *cobra.Command {

deployServiceCmd.Flags().StringVarP(&s.Source, "from", "f", "", "Service source to deploy: local folder with sources, git repository or docker image")
deployServiceCmd.Flags().StringVar(&s.Revision, "revision", "master", "Git revision (branch, tag, commit SHA or ref)")
deployServiceCmd.Flags().StringVar(&s.Runtime, "runtime", "", "Existing buildtemplate name, local path or URL to buildtemplate yaml file")
// deployServiceCmd.Flags().StringVar(&s.RegistrySecret, "registry-secret", "", "Name of k8s secret to use in buildtemplate as registry auth json")
// deployServiceCmd.Flags().StringVar(&s.ResultImageTag, "tag", "latest", "Image tag to build")
// deployServiceCmd.Flags().StringVar(&s.PullPolicy, "image-pull-policy", "Always", "Image pull policy")
deployServiceCmd.Flags().StringVar(&s.Runtime, "runtime", "", "Existing task name, local path or URL to task yaml file")
deployServiceCmd.Flags().StringVar(&s.BuildTimeout, "build-timeout", "10m", "Service image build timeout")
deployServiceCmd.Flags().IntVar(&s.Concurrency, "concurrency", 0, "Number of concurrent events per container: 0 - multiple events, 1 - single event, N - particular number of events")
deployServiceCmd.Flags().StringSliceVar(&s.BuildArgs, "build-argument", []string{}, "Buildtemplate arguments")
deployServiceCmd.Flags().StringSliceVar(&s.BuildArgs, "build-argument", []string{}, "Build arguments")
deployServiceCmd.Flags().StringSliceVar(&s.EnvSecrets, "env-secret", []string{}, "Name of k8s secrets to populate pod environment variables")
deployServiceCmd.Flags().BoolVar(&s.BuildOnly, "build-only", false, "Build image and exit")
deployServiceCmd.Flags().StringSliceVarP(&s.Labels, "label", "l", []string{}, "Service labels")
Expand All @@ -93,49 +88,6 @@ func cmdDeployService(clientset *client.ConfigSet) *cobra.Command {
return deployServiceCmd
}

func cmdDeployBuild(clientset *client.ConfigSet) *cobra.Command {
deployBuildCmd := &cobra.Command{
Use: "build",
Aliases: []string{"builds"},
Args: cobra.ExactArgs(1),
Short: "Deploy knative build",
Example: "tm deploy build foo-builder --source git-repo --buildtemplate kaniko --args IMAGE=knative-local-registry:5000/foo-image",
Run: func(cmd *cobra.Command, args []string) {
b.Name = args[0]
b.Namespace = client.Namespace
if _, err := b.Deploy(clientset); err != nil {
clientset.Log.Fatal(err)
}
clientset.Log.Infoln("Build created")
},
}

deployBuildCmd.Flags().StringVar(&b.Source, "source", "", "Git URL or local path to get sources from")
deployBuildCmd.Flags().StringVar(&b.Revision, "revision", "master", "Git source revision")
deployBuildCmd.Flags().StringVar(&b.Buildtemplate, "buildtemplate", "", "Buildtemplate name to use with build")
deployBuildCmd.Flags().StringSliceVar(&b.Args, "args", []string{}, "Build arguments")
deployBuildCmd.MarkFlagRequired("source")
return deployBuildCmd
}

func cmdDeployBuildTemplate(clientset *client.ConfigSet) *cobra.Command {
deployBuildTemplateCmd := &cobra.Command{
Use: "buildtemplate",
Aliases: []string{"buildtemplates", "bldtmpl"},
Short: "Deploy knative build template",
Example: "tm -n default deploy buildtemplate -f https://raw.githubusercontent.com/triggermesh/nodejs-runtime/master/knative-build-template.yaml",
Run: func(cmd *cobra.Command, args []string) {
bt.Namespace = client.Namespace
if _, err := bt.Deploy(clientset); err != nil {
clientset.Log.Fatal(err)
}
},
}

deployBuildTemplateCmd.Flags().StringVarP(&bt.File, "from", "f", "", "Local path or URL to buildtemplate yaml file")
return deployBuildTemplateCmd
}

func cmdDeployChannel(clientset *client.ConfigSet) *cobra.Command {
deployChannelCmd := &cobra.Command{
Use: "channel",
Expand Down
89 changes: 0 additions & 89 deletions cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ var getCmd = &cobra.Command{

// NewGetCmd returns "Get" cobra CLI command with its subcommands
func newGetCmd(clientset *client.ConfigSet) *cobra.Command {
getCmd.AddCommand(cmdListBuild(clientset))
getCmd.AddCommand(cmdListBuildTemplates(clientset))
getCmd.AddCommand(cmdListClusterBuildTemplates(clientset))
getCmd.AddCommand(cmdListConfigurations(clientset))
getCmd.AddCommand(cmdListRevision(clientset))
getCmd.AddCommand(cmdListRoute(clientset))
Expand All @@ -51,92 +48,6 @@ func newGetCmd(clientset *client.ConfigSet) *cobra.Command {
return getCmd
}

func cmdListBuild(clientset *client.ConfigSet) *cobra.Command {
return &cobra.Command{
Use: "build",
Aliases: []string{"builds"},
Short: "List of knative build resources",
Run: func(cmd *cobra.Command, args []string) {
b.Namespace = client.Namespace
if len(args) == 0 {
list, err := b.List(clientset)
if err != nil {
clientset.Log.Fatalln(err)
}
if len(list.Items) == 0 {
fmt.Fprintf(cmd.OutOrStdout(), "No builds found\n")
return
}
clientset.Printer.PrintTable(b.GetTable(list))
return
}
b.Name = args[0]
build, err := b.Get(clientset)
if err != nil {
clientset.Log.Fatalln(err)
}
clientset.Printer.PrintObject(b.GetObject(build))
},
}
}

func cmdListBuildTemplates(clientset *client.ConfigSet) *cobra.Command {
return &cobra.Command{
Use: "buildtemplate",
Aliases: []string{"buildtemplates"},
Short: "List of buildtemplates",
Run: func(cmd *cobra.Command, args []string) {
bt.Namespace = client.Namespace
if len(args) == 0 {
list, err := bt.List(clientset)
if err != nil {
clientset.Log.Fatalln(err)
}
if len(list.Items) == 0 {
fmt.Fprintf(cmd.OutOrStdout(), "No builds found\n")
return
}
clientset.Printer.PrintTable(bt.GetTable(list))
return
}
bt.Name = args[0]
buildtemplate, err := bt.Get(clientset)
if err != nil {
clientset.Log.Fatalln(err)
}
clientset.Printer.PrintObject(bt.GetObject(buildtemplate))
},
}
}

func cmdListClusterBuildTemplates(clientset *client.ConfigSet) *cobra.Command {
return &cobra.Command{
Use: "clusterbuildtemplate",
Aliases: []string{"cbuildtemplates", "cbuildtemplate", "clusterbuildtemplates"},
Short: "List of clusterbuildtemplates",
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
list, err := cbt.List(clientset)
if err != nil {
clientset.Log.Fatalln(err)
}
if len(list.Items) == 0 {
fmt.Fprintf(cmd.OutOrStdout(), "No clusterbuildtemplates found\n")
return
}
clientset.Printer.PrintTable(cbt.GetTable(list))
return
}
cbt.Name = args[0]
cbuildtemplate, err := cbt.Get(clientset)
if err != nil {
clientset.Log.Fatalln(err)
}
clientset.Printer.PrintObject(cbt.GetObject(cbuildtemplate))
},
}
}

func cmdListChannels(clientset *client.ConfigSet) *cobra.Command {
return &cobra.Command{
Use: "channel",
Expand Down
85 changes: 33 additions & 52 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,44 @@ module github.com/triggermesh/tm
go 1.13

require (
contrib.go.opencensus.io/exporter/ocagent v0.6.0 // indirect
contrib.go.opencensus.io/exporter/stackdriver v0.12.9 // indirect
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/frankban/quicktest v1.7.2 // indirect
github.com/ghodss/yaml v1.0.0
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
github.com/knative/build v0.7.0
github.com/knative/pkg v0.0.0-20190624141606-d82505e6c5b4
github.com/mholt/archiver v2.1.0+incompatible
github.com/nwaples/rardecode v1.0.0 // indirect
github.com/googleapis/gnostic v0.4.2 // indirect
github.com/json-iterator/go v1.1.10 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mholt/archiver v3.1.1+incompatible
github.com/nwaples/rardecode v1.1.0 // indirect
github.com/olekukonko/tablewriter v0.0.4
github.com/openzipkin/zipkin-go v0.2.2 // indirect
github.com/pierrec/lz4 v2.4.0+incompatible // indirect
github.com/robfig/cron v1.2.0 // indirect
github.com/sirupsen/logrus v1.4.2
github.com/spf13/afero v1.2.2
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.4.0
github.com/tektoncd/pipeline v0.11.2
github.com/tektoncd/triggers v0.1.0
github.com/tidwall/gjson v1.3.2 // indirect
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413
google.golang.org/genproto v0.0.0-20191028173616-919d9bdd9fe6 // indirect
github.com/sirupsen/logrus v1.6.0
github.com/spf13/afero v1.3.1
github.com/spf13/cobra v1.0.0
github.com/stretchr/testify v1.5.1
github.com/tektoncd/pipeline v0.14.1
github.com/tektoncd/triggers v0.6.1
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v2 v2.2.5
k8s.io/api v0.17.2
k8s.io/apimachinery v0.17.2
k8s.io/client-go v0.17.0
k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d // indirect
knative.dev/eventing v0.12.0
knative.dev/eventing-contrib v0.11.2
knative.dev/pkg v0.0.0-20200207155214-fef852970f43
knative.dev/serving v0.12.0
sigs.k8s.io/controller-runtime v0.4.0 // indirect
gopkg.in/yaml.v2 v2.3.0
k8s.io/api v0.18.5
k8s.io/apimachinery v0.18.5
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
k8s.io/klog/v2 v2.3.0 // indirect
k8s.io/kube-openapi v0.0.0-20200615155156-dffdd1682719 // indirect
k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19 // indirect
knative.dev/eventing v0.16.0
knative.dev/eventing-contrib v0.16.0
knative.dev/networking v0.0.0-20200707203944-725ec013d8a2 // indirect
knative.dev/pkg v0.0.0-20200713031612-b09a159e12c9
knative.dev/serving v0.16.0
)

replace (
k8s.io/api => k8s.io/api v0.0.0-20191016110246-af539daaa43a
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20191016113439-b64f2075a530
k8s.io/apimachinery => k8s.io/apimachinery v0.15.10-beta.0
k8s.io/apiserver => k8s.io/apiserver v0.0.0-20191016111841-d20af8c7efc5
k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20191016113937-7693ce2cae74
k8s.io/client-go => k8s.io/client-go v0.0.0-20191016110837-54936ba21026
k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20191016115248-b061d4666016
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.0.0-20191016115051-4323e76404b0
k8s.io/code-generator => k8s.io/code-generator v0.15.10-beta.0
k8s.io/component-base => k8s.io/component-base v0.0.0-20191016111234-b8c37ee0c266
k8s.io/cri-api => k8s.io/cri-api v0.15.10-beta.0
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.0.0-20191016115443-72c16c0ea390
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.0.0-20191016112329-27bff66d0b7c
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.0.0-20191016114902-c7514f1b89da
k8s.io/kube-proxy => k8s.io/kube-proxy v0.0.0-20191016114328-7650d5e6588e
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.0.0-20191016114710-682e84547325
k8s.io/kubelet => k8s.io/kubelet v0.0.0-20191016114520-100045381629
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.0.0-20191016115707-22244e5b01eb
k8s.io/metrics => k8s.io/metrics v0.0.0-20191016113728-f445c7b35c1c
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.0.0-20191016112728-ceb381866e80
knative.dev/pkg => knative.dev/pkg v0.0.0-20200122022923-4e81bc3c320f
github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.4.0
k8s.io/api => k8s.io/api v0.17.6
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.17.6
k8s.io/apimachinery => k8s.io/apimachinery v0.17.6
k8s.io/apiserver => k8s.io/apiserver v0.17.6
k8s.io/client-go => k8s.io/client-go v0.17.6
k8s.io/code-generator => k8s.io/code-generator v0.17.6
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29
)
Loading