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"
fn "github.com/boson-project/func"
fn "knative.dev/kn-plugin-func"
)
//Builder holds the configuration that will be passed to

View File

@ -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

View File

@ -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 (

View File

@ -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() {

View File

@ -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) {

View File

@ -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() {

View File

@ -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() {

View File

@ -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() {

View File

@ -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() {

View File

@ -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

View File

@ -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() {

View File

@ -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

View File

@ -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() {

View File

@ -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() {

View File

@ -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() {

View File

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

View File

@ -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() {

View File

@ -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

View File

@ -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) {

View File

@ -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() {

View File

@ -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.

View File

@ -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

View File

@ -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.

View File

@ -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

2
go.mod
View File

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

View File

@ -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 (

View File

@ -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 {

View File

@ -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 {

View File

@ -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 (

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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() {