Rename module to knative.dev/kn-plugin-func (#423)

Co-authored-by: Lance Ball <lball@redhat.com>
This commit is contained in:
Markus Thömmes 2021-07-15 20:33:32 +02:00 committed by GitHub
parent 771a2307a1
commit 892558bf2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 84 additions and 84 deletions

View File

@ -29,7 +29,7 @@ import (
dockerClient "github.com/docker/docker/client" 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 //Builder holds the configuration that will be passed to

View File

@ -9,10 +9,10 @@ import (
"testing" "testing"
"time" "time"
boson "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/buildpacks" "knative.dev/kn-plugin-func/buildpacks"
"github.com/boson-project/func/docker" "knative.dev/kn-plugin-func/docker"
"github.com/boson-project/func/knative" "knative.dev/kn-plugin-func/knative"
) )
/* /*
@ -61,9 +61,9 @@ func TestList(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
client := boson.New( client := fn.New(
boson.WithLister(lister), fn.WithLister(lister),
boson.WithVerbose(verbose)) fn.WithVerbose(verbose))
// Act // Act
names, err := client.List(context.Background()) names, err := client.List(context.Background())
@ -85,7 +85,7 @@ func TestNew(t *testing.T) {
client := newClient(verbose) client := newClient(verbose)
// Act // 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) t.Fatal(err)
} }
defer del(t, client, "testnew") defer del(t, client, "testnew")
@ -111,7 +111,7 @@ func TestDeploy(t *testing.T) {
client := newClient(verbose) 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) t.Fatal(err)
} }
defer del(t, client, "deploy") defer del(t, client, "deploy")
@ -128,12 +128,12 @@ func TestRemove(t *testing.T) {
client := newClient(verbose) 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) t.Fatal(err)
} }
waitFor(t, client, "remove") 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) t.Fatal(err)
} }
@ -152,7 +152,7 @@ func TestRemove(t *testing.T) {
// newClient creates an instance of the func client whose concrete impls // newClient creates an instance of the func client whose concrete impls
// match those created by the kn func plugin CLI. // 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 := buildpacks.NewBuilder()
builder.Verbose = verbose builder.Verbose = verbose
@ -180,14 +180,14 @@ func newClient(verbose bool) *boson.Client {
} }
lister.Verbose = verbose lister.Verbose = verbose
return boson.New( return fn.New(
boson.WithRegistry(DefaultRegistry), fn.WithRegistry(DefaultRegistry),
boson.WithVerbose(verbose), fn.WithVerbose(verbose),
boson.WithBuilder(builder), fn.WithBuilder(builder),
boson.WithPusher(pusher), fn.WithPusher(pusher),
boson.WithDeployer(deployer), fn.WithDeployer(deployer),
boson.WithRemover(remover), fn.WithRemover(remover),
boson.WithLister(lister), 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 // 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 // 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. // 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() t.Helper()
waitFor(t, c, name) 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) 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 // TODO: the API should be synchronous, but that depends first on
// Create returning the derived name such that we can bake polling in. // Create returning the derived name such that we can bake polling in.
// Ideally the Boson provider's Creaet would be made syncrhonous. // 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() t.Helper()
var pollInterval = 2 * time.Second var pollInterval = 2 * time.Second

View File

@ -11,8 +11,8 @@ import (
"path/filepath" "path/filepath"
"testing" "testing"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/mock" "knative.dev/kn-plugin-func/mock"
) )
const ( const (

View File

@ -8,9 +8,9 @@ import (
"github.com/ory/viper" "github.com/ory/viper"
"github.com/spf13/cobra" "github.com/spf13/cobra"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/buildpacks" "knative.dev/kn-plugin-func/buildpacks"
"github.com/boson-project/func/progress" "knative.dev/kn-plugin-func/progress"
) )
func init() { func init() {

View File

@ -8,9 +8,9 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/buildpacks" "knative.dev/kn-plugin-func/buildpacks"
"github.com/boson-project/func/knative" "knative.dev/kn-plugin-func/knative"
) )
func CompleteFunctionList(cmd *cobra.Command, args []string, toComplete string) (strings []string, directive cobra.ShellCompDirective) { func CompleteFunctionList(cmd *cobra.Command, args []string, toComplete string) (strings []string, directive cobra.ShellCompDirective) {

View File

@ -8,7 +8,7 @@ import (
"github.com/ory/viper" "github.com/ory/viper"
"github.com/spf13/cobra" "github.com/spf13/cobra"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
) )
func init() { func init() {

View File

@ -9,9 +9,9 @@ import (
"github.com/AlecAivazis/survey/v2/terminal" "github.com/AlecAivazis/survey/v2/terminal"
"github.com/spf13/cobra" "github.com/spf13/cobra"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/k8s" "knative.dev/kn-plugin-func/k8s"
"github.com/boson-project/func/utils" "knative.dev/kn-plugin-func/utils"
) )
func init() { func init() {

View File

@ -9,8 +9,8 @@ import (
"github.com/AlecAivazis/survey/v2/terminal" "github.com/AlecAivazis/survey/v2/terminal"
"github.com/spf13/cobra" "github.com/spf13/cobra"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/k8s" "knative.dev/kn-plugin-func/k8s"
) )
func init() { func init() {

View File

@ -9,9 +9,9 @@ import (
"github.com/ory/viper" "github.com/ory/viper"
"github.com/spf13/cobra" "github.com/spf13/cobra"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/buildpacks" "knative.dev/kn-plugin-func/buildpacks"
"github.com/boson-project/func/utils" "knative.dev/kn-plugin-func/utils"
) )
func init() { func init() {

View File

@ -6,8 +6,8 @@ import (
"os" "os"
"testing" "testing"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/utils" "knative.dev/kn-plugin-func/utils"
) )
// TestCreateValidatesName ensures that the create command only accepts // TestCreateValidatesName ensures that the create command only accepts

View File

@ -8,8 +8,8 @@ import (
"github.com/ory/viper" "github.com/ory/viper"
"github.com/spf13/cobra" "github.com/spf13/cobra"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/knative" "knative.dev/kn-plugin-func/knative"
) )
func init() { func init() {

View File

@ -4,8 +4,8 @@ import (
"io/ioutil" "io/ioutil"
"testing" "testing"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/mock" "knative.dev/kn-plugin-func/mock"
) )
// TestDeleteByName ensures that running delete specifying the name of the Funciton // TestDeleteByName ensures that running delete specifying the name of the Funciton

View File

@ -13,11 +13,11 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"knative.dev/client/pkg/util" "knative.dev/client/pkg/util"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/buildpacks" "knative.dev/kn-plugin-func/buildpacks"
"github.com/boson-project/func/docker" "knative.dev/kn-plugin-func/docker"
"github.com/boson-project/func/knative" "knative.dev/kn-plugin-func/knative"
"github.com/boson-project/func/progress" "knative.dev/kn-plugin-func/progress"
) )
func init() { func init() {

View File

@ -11,8 +11,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/knative" "knative.dev/kn-plugin-func/knative"
) )
func init() { func init() {

View File

@ -5,12 +5,12 @@ import (
"errors" "errors"
"io/ioutil" "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/google/uuid"
"github.com/ory/viper" "github.com/ory/viper"
"github.com/spf13/cobra" "github.com/spf13/cobra"
fn "knative.dev/kn-plugin-func"
"knative.dev/kn-plugin-func/cloudevents"
"knative.dev/kn-plugin-func/knative"
) )
func init() { func init() {

View File

@ -2,7 +2,7 @@ package main
import ( import (
"context" "context"
"github.com/boson-project/func/cmd" "knative.dev/kn-plugin-func/cmd"
"os" "os"
"os/signal" "os/signal"
"syscall" "syscall"

View File

@ -13,8 +13,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/knative" "knative.dev/kn-plugin-func/knative"
) )
func init() { func init() {

View File

@ -13,7 +13,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
"knative.dev/client/pkg/util" "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 // The root of the command tree defines the command name, descriotion, globally

View File

@ -7,7 +7,7 @@ import (
"knative.dev/client/pkg/util" "knative.dev/client/pkg/util"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
) )
func Test_mergeEnvMaps(t *testing.T) { func Test_mergeEnvMaps(t *testing.T) {

View File

@ -7,8 +7,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"knative.dev/client/pkg/util" "knative.dev/client/pkg/util"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/docker" "knative.dev/kn-plugin-func/docker"
) )
func init() { func init() {

View File

@ -9,9 +9,9 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/boson-project/func/utils"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
"knative.dev/kn-plugin-func/utils"
) )
// ConfigFile is the name of the config's serialized form. // ConfigFile is the name of the config's serialized form.

View File

@ -15,7 +15,7 @@ import (
"github.com/docker/docker/client" "github.com/docker/docker/client"
"github.com/pkg/errors" "github.com/pkg/errors"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
) )
type Opt func(*Pusher) error type Opt func(*Pusher) error

View File

@ -16,7 +16,7 @@ import (
"github.com/docker/docker/client" "github.com/docker/docker/client"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
) )
// Runner of functions using the docker command. // Runner of functions using the docker command.

View File

@ -9,8 +9,8 @@ import (
"os" "os"
"testing" "testing"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/docker" "knative.dev/kn-plugin-func/docker"
) )
// Docker Run Integraiton Test // Docker Run Integraiton Test

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/boson-project/func module knative.dev/kn-plugin-func
go 1.15 go 1.15

View File

@ -9,7 +9,7 @@ import (
eventingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1" eventingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1"
servingv1 "knative.dev/serving/pkg/client/clientset/versioned/typed/serving/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 ( const (

View File

@ -20,8 +20,8 @@ import (
servingv1 "knative.dev/serving/pkg/apis/serving/v1" servingv1 "knative.dev/serving/pkg/apis/serving/v1"
v1 "knative.dev/serving/pkg/apis/serving/v1" v1 "knative.dev/serving/pkg/apis/serving/v1"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/k8s" "knative.dev/kn-plugin-func/k8s"
) )
type Deployer struct { type Deployer struct {

View File

@ -7,8 +7,8 @@ import (
clientservingv1 "knative.dev/client/pkg/serving/v1" clientservingv1 "knative.dev/client/pkg/serving/v1"
eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1" eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
k8s "github.com/boson-project/func/k8s" "knative.dev/kn-plugin-func/k8s"
) )
type Describer struct { type Describer struct {

View File

@ -6,8 +6,8 @@ import (
clientservingv1 "knative.dev/client/pkg/serving/v1" clientservingv1 "knative.dev/client/pkg/serving/v1"
"knative.dev/pkg/apis" "knative.dev/pkg/apis"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
"github.com/boson-project/func/k8s" "knative.dev/kn-plugin-func/k8s"
) )
const ( const (

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/boson-project/func/k8s" "knative.dev/kn-plugin-func/k8s"
) )
const RemoveTimeout = 120 * time.Second const RemoveTimeout = 120 * time.Second

View File

@ -2,7 +2,7 @@ package mock
import ( import (
"context" "context"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
) )
type Builder struct { type Builder struct {

View File

@ -3,7 +3,7 @@ package mock
import ( import (
"context" "context"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
) )
type Deployer struct { type Deployer struct {

View File

@ -2,7 +2,7 @@ package mock
import ( import (
"context" "context"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
) )
type Lister struct { type Lister struct {

View File

@ -3,7 +3,7 @@ package mock
import ( import (
"context" "context"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
) )
type Pusher struct { type Pusher struct {

View File

@ -2,7 +2,7 @@ package mock
import ( import (
"context" "context"
fn "github.com/boson-project/func" fn "knative.dev/kn-plugin-func"
) )
type Runner struct { type Runner struct {

View File

@ -10,7 +10,7 @@ import (
"knative.dev/client/pkg/kn/plugin" "knative.dev/client/pkg/kn/plugin"
"github.com/boson-project/func/cmd" "knative.dev/kn-plugin-func/cmd"
) )
func init() { func init() {