From 892558bf2a5020da2d45bcc06022c7cf3678fd86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Th=C3=B6mmes?= Date: Thu, 15 Jul 2021 20:33:32 +0200 Subject: [PATCH] Rename module to knative.dev/kn-plugin-func (#423) Co-authored-by: Lance Ball --- buildpacks/builder.go | 2 +- client_int_test.go | 46 +++++++++++++++++++++--------------------- client_test.go | 4 ++-- cmd/build.go | 6 +++--- cmd/completion_util.go | 6 +++--- cmd/config.go | 2 +- cmd/config_envs.go | 6 +++--- cmd/config_volumes.go | 4 ++-- cmd/create.go | 6 +++--- cmd/create_test.go | 4 ++-- cmd/delete.go | 4 ++-- cmd/delete_test.go | 4 ++-- cmd/deploy.go | 10 ++++----- cmd/describe.go | 4 ++-- cmd/emit.go | 6 +++--- cmd/func/main.go | 2 +- cmd/list.go | 4 ++-- cmd/root.go | 2 +- cmd/root_test.go | 2 +- cmd/run.go | 4 ++-- config.go | 2 +- docker/pusher.go | 2 +- docker/runner.go | 2 +- docker/runner_test.go | 4 ++-- go.mod | 2 +- knative/client.go | 2 +- knative/deployer.go | 4 ++-- knative/describer.go | 4 ++-- knative/lister.go | 4 ++-- knative/remover.go | 2 +- mock/builder.go | 2 +- mock/deployer.go | 2 +- mock/lister.go | 2 +- mock/pusher.go | 2 +- mock/runner.go | 2 +- plugin/plugin.go | 2 +- 36 files changed, 84 insertions(+), 84 deletions(-) diff --git a/buildpacks/builder.go b/buildpacks/builder.go index 0f082235d..93887c3a2 100644 --- a/buildpacks/builder.go +++ b/buildpacks/builder.go @@ -29,7 +29,7 @@ import ( dockerClient "github.com/docker/docker/client" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) //Builder holds the configuration that will be passed to diff --git a/client_int_test.go b/client_int_test.go index 1bc1d663d..7a10a7545 100644 --- a/client_int_test.go +++ b/client_int_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - boson "github.com/boson-project/func" - "github.com/boson-project/func/buildpacks" - "github.com/boson-project/func/docker" - "github.com/boson-project/func/knative" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/buildpacks" + "knative.dev/kn-plugin-func/docker" + "knative.dev/kn-plugin-func/knative" ) /* @@ -61,9 +61,9 @@ func TestList(t *testing.T) { if err != nil { t.Fatal(err) } - client := boson.New( - boson.WithLister(lister), - boson.WithVerbose(verbose)) + client := fn.New( + fn.WithLister(lister), + fn.WithVerbose(verbose)) // Act names, err := client.List(context.Background()) @@ -85,7 +85,7 @@ func TestNew(t *testing.T) { client := newClient(verbose) // Act - if err := client.New(context.Background(), boson.Function{Name: "testnew", Root: ".", Runtime: "go"}); err != nil { + if err := client.New(context.Background(), fn.Function{Name: "testnew", Root: ".", Runtime: "go"}); err != nil { t.Fatal(err) } defer del(t, client, "testnew") @@ -111,7 +111,7 @@ func TestDeploy(t *testing.T) { client := newClient(verbose) - if err := client.New(context.Background(), boson.Function{Name: "deploy", Root: ".", Runtime: "go"}); err != nil { + if err := client.New(context.Background(), fn.Function{Name: "deploy", Root: ".", Runtime: "go"}); err != nil { t.Fatal(err) } defer del(t, client, "deploy") @@ -128,12 +128,12 @@ func TestRemove(t *testing.T) { client := newClient(verbose) - if err := client.New(context.Background(), boson.Function{Name: "remove", Root: ".", Runtime: "go"}); err != nil { + if err := client.New(context.Background(), fn.Function{Name: "remove", Root: ".", Runtime: "go"}); err != nil { t.Fatal(err) } waitFor(t, client, "remove") - if err := client.Remove(context.Background(), boson.Function{Name: "remove"}); err != nil { + if err := client.Remove(context.Background(), fn.Function{Name: "remove"}); err != nil { t.Fatal(err) } @@ -152,7 +152,7 @@ func TestRemove(t *testing.T) { // newClient creates an instance of the func client whose concrete impls // match those created by the kn func plugin CLI. -func newClient(verbose bool) *boson.Client { +func newClient(verbose bool) *fn.Client { builder := buildpacks.NewBuilder() builder.Verbose = verbose @@ -180,14 +180,14 @@ func newClient(verbose bool) *boson.Client { } lister.Verbose = verbose - return boson.New( - boson.WithRegistry(DefaultRegistry), - boson.WithVerbose(verbose), - boson.WithBuilder(builder), - boson.WithPusher(pusher), - boson.WithDeployer(deployer), - boson.WithRemover(remover), - boson.WithLister(lister), + return fn.New( + fn.WithRegistry(DefaultRegistry), + fn.WithVerbose(verbose), + fn.WithBuilder(builder), + fn.WithPusher(pusher), + fn.WithDeployer(deployer), + fn.WithRemover(remover), + fn.WithLister(lister), ) } @@ -201,10 +201,10 @@ func newClient(verbose bool) *boson.Client { // Of course, ideally this would be replaced by the use of a synchronous // method, or at a minimum a way to register a callback/listener for the // creation event. This is what we have for now, and the show must go on. -func del(t *testing.T, c *boson.Client, name string) { +func del(t *testing.T, c *fn.Client, name string) { t.Helper() waitFor(t, c, name) - if err := c.Remove(context.Background(), boson.Function{Name: name}); err != nil { + if err := c.Remove(context.Background(), fn.Function{Name: name}); err != nil { t.Fatal(err) } } @@ -213,7 +213,7 @@ func del(t *testing.T, c *boson.Client, name string) { // TODO: the API should be synchronous, but that depends first on // Create returning the derived name such that we can bake polling in. // Ideally the Boson provider's Creaet would be made syncrhonous. -func waitFor(t *testing.T, c *boson.Client, name string) { +func waitFor(t *testing.T, c *fn.Client, name string) { t.Helper() var pollInterval = 2 * time.Second diff --git a/client_test.go b/client_test.go index 99817c7a8..da98bcbfa 100644 --- a/client_test.go +++ b/client_test.go @@ -11,8 +11,8 @@ import ( "path/filepath" "testing" - fn "github.com/boson-project/func" - "github.com/boson-project/func/mock" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/mock" ) const ( diff --git a/cmd/build.go b/cmd/build.go index a229044de..876fb9f49 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -8,9 +8,9 @@ import ( "github.com/ory/viper" "github.com/spf13/cobra" - fn "github.com/boson-project/func" - "github.com/boson-project/func/buildpacks" - "github.com/boson-project/func/progress" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/buildpacks" + "knative.dev/kn-plugin-func/progress" ) func init() { diff --git a/cmd/completion_util.go b/cmd/completion_util.go index 82178ad47..68e16ac54 100644 --- a/cmd/completion_util.go +++ b/cmd/completion_util.go @@ -8,9 +8,9 @@ import ( "github.com/spf13/cobra" - fn "github.com/boson-project/func" - "github.com/boson-project/func/buildpacks" - "github.com/boson-project/func/knative" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/buildpacks" + "knative.dev/kn-plugin-func/knative" ) func CompleteFunctionList(cmd *cobra.Command, args []string, toComplete string) (strings []string, directive cobra.ShellCompDirective) { diff --git a/cmd/config.go b/cmd/config.go index 96b16db76..c376f5da7 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -8,7 +8,7 @@ import ( "github.com/ory/viper" "github.com/spf13/cobra" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) func init() { diff --git a/cmd/config_envs.go b/cmd/config_envs.go index 8a8f029d0..6dbc2155a 100644 --- a/cmd/config_envs.go +++ b/cmd/config_envs.go @@ -9,9 +9,9 @@ import ( "github.com/AlecAivazis/survey/v2/terminal" "github.com/spf13/cobra" - fn "github.com/boson-project/func" - "github.com/boson-project/func/k8s" - "github.com/boson-project/func/utils" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/k8s" + "knative.dev/kn-plugin-func/utils" ) func init() { diff --git a/cmd/config_volumes.go b/cmd/config_volumes.go index 82b0b1c61..8e3ee0db7 100644 --- a/cmd/config_volumes.go +++ b/cmd/config_volumes.go @@ -9,8 +9,8 @@ import ( "github.com/AlecAivazis/survey/v2/terminal" "github.com/spf13/cobra" - fn "github.com/boson-project/func" - "github.com/boson-project/func/k8s" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/k8s" ) func init() { diff --git a/cmd/create.go b/cmd/create.go index 4acd55ff7..f523ed7e0 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -9,9 +9,9 @@ import ( "github.com/ory/viper" "github.com/spf13/cobra" - fn "github.com/boson-project/func" - "github.com/boson-project/func/buildpacks" - "github.com/boson-project/func/utils" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/buildpacks" + "knative.dev/kn-plugin-func/utils" ) func init() { diff --git a/cmd/create_test.go b/cmd/create_test.go index 75330f788..5e57e806b 100644 --- a/cmd/create_test.go +++ b/cmd/create_test.go @@ -6,8 +6,8 @@ import ( "os" "testing" - fn "github.com/boson-project/func" - "github.com/boson-project/func/utils" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/utils" ) // TestCreateValidatesName ensures that the create command only accepts diff --git a/cmd/delete.go b/cmd/delete.go index 34d7f2d90..df0bd818f 100644 --- a/cmd/delete.go +++ b/cmd/delete.go @@ -8,8 +8,8 @@ import ( "github.com/ory/viper" "github.com/spf13/cobra" - fn "github.com/boson-project/func" - "github.com/boson-project/func/knative" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/knative" ) func init() { diff --git a/cmd/delete_test.go b/cmd/delete_test.go index 10c7295f2..c28583833 100644 --- a/cmd/delete_test.go +++ b/cmd/delete_test.go @@ -4,8 +4,8 @@ import ( "io/ioutil" "testing" - fn "github.com/boson-project/func" - "github.com/boson-project/func/mock" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/mock" ) // TestDeleteByName ensures that running delete specifying the name of the Funciton diff --git a/cmd/deploy.go b/cmd/deploy.go index 796f3773d..613e14912 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -13,11 +13,11 @@ import ( "github.com/spf13/cobra" "knative.dev/client/pkg/util" - fn "github.com/boson-project/func" - "github.com/boson-project/func/buildpacks" - "github.com/boson-project/func/docker" - "github.com/boson-project/func/knative" - "github.com/boson-project/func/progress" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/buildpacks" + "knative.dev/kn-plugin-func/docker" + "knative.dev/kn-plugin-func/knative" + "knative.dev/kn-plugin-func/progress" ) func init() { diff --git a/cmd/describe.go b/cmd/describe.go index 8d6ec82c1..5550562af 100644 --- a/cmd/describe.go +++ b/cmd/describe.go @@ -11,8 +11,8 @@ import ( "github.com/spf13/cobra" "gopkg.in/yaml.v2" - fn "github.com/boson-project/func" - "github.com/boson-project/func/knative" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/knative" ) func init() { diff --git a/cmd/emit.go b/cmd/emit.go index 9b7cf54a0..598cc5d32 100644 --- a/cmd/emit.go +++ b/cmd/emit.go @@ -5,12 +5,12 @@ import ( "errors" "io/ioutil" - fn "github.com/boson-project/func" - "github.com/boson-project/func/cloudevents" - "github.com/boson-project/func/knative" "github.com/google/uuid" "github.com/ory/viper" "github.com/spf13/cobra" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/cloudevents" + "knative.dev/kn-plugin-func/knative" ) func init() { diff --git a/cmd/func/main.go b/cmd/func/main.go index f89adb945..4a1b6bf7c 100644 --- a/cmd/func/main.go +++ b/cmd/func/main.go @@ -2,7 +2,7 @@ package main import ( "context" - "github.com/boson-project/func/cmd" + "knative.dev/kn-plugin-func/cmd" "os" "os/signal" "syscall" diff --git a/cmd/list.go b/cmd/list.go index 26ac67e5c..079e130de 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -13,8 +13,8 @@ import ( "github.com/spf13/cobra" "gopkg.in/yaml.v2" - fn "github.com/boson-project/func" - "github.com/boson-project/func/knative" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/knative" ) func init() { diff --git a/cmd/root.go b/cmd/root.go index dcb0a418e..d00ad0138 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -13,7 +13,7 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "knative.dev/client/pkg/util" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) // The root of the command tree defines the command name, descriotion, globally diff --git a/cmd/root_test.go b/cmd/root_test.go index a09a9c3be..84b84d280 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -7,7 +7,7 @@ import ( "knative.dev/client/pkg/util" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) func Test_mergeEnvMaps(t *testing.T) { diff --git a/cmd/run.go b/cmd/run.go index 25c9800b1..44839a428 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -7,8 +7,8 @@ import ( "github.com/spf13/cobra" "knative.dev/client/pkg/util" - fn "github.com/boson-project/func" - "github.com/boson-project/func/docker" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/docker" ) func init() { diff --git a/config.go b/config.go index 69d9f9345..a9a47b396 100644 --- a/config.go +++ b/config.go @@ -9,9 +9,9 @@ import ( "regexp" "strings" - "github.com/boson-project/func/utils" "gopkg.in/yaml.v2" "k8s.io/apimachinery/pkg/api/resource" + "knative.dev/kn-plugin-func/utils" ) // ConfigFile is the name of the config's serialized form. diff --git a/docker/pusher.go b/docker/pusher.go index e007832a9..c8cd9e121 100644 --- a/docker/pusher.go +++ b/docker/pusher.go @@ -15,7 +15,7 @@ import ( "github.com/docker/docker/client" "github.com/pkg/errors" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) type Opt func(*Pusher) error diff --git a/docker/runner.go b/docker/runner.go index 3c7e8cdf0..c54d051c9 100644 --- a/docker/runner.go +++ b/docker/runner.go @@ -16,7 +16,7 @@ import ( "github.com/docker/docker/client" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) // Runner of functions using the docker command. diff --git a/docker/runner_test.go b/docker/runner_test.go index 795c177cf..df68e8b48 100644 --- a/docker/runner_test.go +++ b/docker/runner_test.go @@ -9,8 +9,8 @@ import ( "os" "testing" - fn "github.com/boson-project/func" - "github.com/boson-project/func/docker" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/docker" ) // Docker Run Integraiton Test diff --git a/go.mod b/go.mod index 164c70cc4..6259764f1 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/boson-project/func +module knative.dev/kn-plugin-func go 1.15 diff --git a/knative/client.go b/knative/client.go index 995ccd097..beacc36c0 100644 --- a/knative/client.go +++ b/knative/client.go @@ -9,7 +9,7 @@ import ( eventingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1" servingv1 "knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1" - "github.com/boson-project/func/k8s" + "knative.dev/kn-plugin-func/k8s" ) const ( diff --git a/knative/deployer.go b/knative/deployer.go index cdd030955..373766218 100644 --- a/knative/deployer.go +++ b/knative/deployer.go @@ -20,8 +20,8 @@ import ( servingv1 "knative.dev/serving/pkg/apis/serving/v1" v1 "knative.dev/serving/pkg/apis/serving/v1" - fn "github.com/boson-project/func" - "github.com/boson-project/func/k8s" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/k8s" ) type Deployer struct { diff --git a/knative/describer.go b/knative/describer.go index 448aeb10c..4e4f6f8b9 100644 --- a/knative/describer.go +++ b/knative/describer.go @@ -7,8 +7,8 @@ import ( clientservingv1 "knative.dev/client/pkg/serving/v1" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" - fn "github.com/boson-project/func" - k8s "github.com/boson-project/func/k8s" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/k8s" ) type Describer struct { diff --git a/knative/lister.go b/knative/lister.go index e662a38a9..85aa03fd4 100644 --- a/knative/lister.go +++ b/knative/lister.go @@ -6,8 +6,8 @@ import ( clientservingv1 "knative.dev/client/pkg/serving/v1" "knative.dev/pkg/apis" - fn "github.com/boson-project/func" - "github.com/boson-project/func/k8s" + fn "knative.dev/kn-plugin-func" + "knative.dev/kn-plugin-func/k8s" ) const ( diff --git a/knative/remover.go b/knative/remover.go index 6583ce93e..ac42e27b8 100644 --- a/knative/remover.go +++ b/knative/remover.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/boson-project/func/k8s" + "knative.dev/kn-plugin-func/k8s" ) const RemoveTimeout = 120 * time.Second diff --git a/mock/builder.go b/mock/builder.go index 3b0fdc247..4980de56c 100644 --- a/mock/builder.go +++ b/mock/builder.go @@ -2,7 +2,7 @@ package mock import ( "context" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) type Builder struct { diff --git a/mock/deployer.go b/mock/deployer.go index c91e21b6a..62d75168b 100644 --- a/mock/deployer.go +++ b/mock/deployer.go @@ -3,7 +3,7 @@ package mock import ( "context" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) type Deployer struct { diff --git a/mock/lister.go b/mock/lister.go index dd18480ba..0e17b8166 100644 --- a/mock/lister.go +++ b/mock/lister.go @@ -2,7 +2,7 @@ package mock import ( "context" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) type Lister struct { diff --git a/mock/pusher.go b/mock/pusher.go index 0aed6f8da..55e17a6ad 100644 --- a/mock/pusher.go +++ b/mock/pusher.go @@ -3,7 +3,7 @@ package mock import ( "context" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) type Pusher struct { diff --git a/mock/runner.go b/mock/runner.go index 2f6c7f86a..7cf9c95c6 100644 --- a/mock/runner.go +++ b/mock/runner.go @@ -2,7 +2,7 @@ package mock import ( "context" - fn "github.com/boson-project/func" + fn "knative.dev/kn-plugin-func" ) type Runner struct { diff --git a/plugin/plugin.go b/plugin/plugin.go index 0afa54fb4..3a9f8c4ba 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -10,7 +10,7 @@ import ( "knative.dev/client/pkg/kn/plugin" - "github.com/boson-project/func/cmd" + "knative.dev/kn-plugin-func/cmd" ) func init() {