Skip to content

Commit

Permalink
Replace knative.dev/client references to knative.dev/client-pkg (#277)
Browse files Browse the repository at this point in the history
* Replace knative/client module with knative/client-pkg

* Fix conflicts

---------

Co-authored-by: David Simansky <[email protected]>
  • Loading branch information
vyasgun and dsimansk authored Apr 19, 2023
1 parent 2f84918 commit a9dce0e
Show file tree
Hide file tree
Showing 117 changed files with 163 additions and 4,287 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.18
require (
github.com/hashicorp/golang-lru v0.5.4
github.com/hashicorp/hcl v1.0.0
github.com/maximilien/kn-source-pkg v0.6.3
github.com/mitchellh/go-homedir v1.1.0
github.com/spf13/cobra v1.6.0
github.com/spf13/viper v1.13.0
Expand All @@ -14,7 +13,7 @@ require (
k8s.io/api v0.25.4
k8s.io/apimachinery v0.25.4
k8s.io/client-go v0.25.4
knative.dev/client v0.36.1-0.20230413134553-7e90298d926d
knative.dev/client-pkg v0.0.0-20230406095919-30a17e519723
knative.dev/hack v0.0.0-20230417170854-f591fea109b3
knative.dev/networking v0.0.0-20230412014752-750a9e4f13f1
knative.dev/serving v0.36.1-0.20230418170156-b38ef3a7ff2c
Expand Down
619 changes: 2 additions & 617 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/command/autoscaling/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
"knative.dev/client/pkg/kn/commands/flags"
hprinters "knative.dev/client/pkg/printers"
"knative.dev/client-pkg/pkg/kn/commands/flags"
hprinters "knative.dev/client-pkg/pkg/printers"
"knative.dev/kn-plugin-admin/pkg"
"knative.dev/serving/pkg/autoscaler/config"
"knative.dev/serving/pkg/autoscaler/config/autoscalerconfig"
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/autoscaling/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"gotest.tools/v3/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/client/pkg/util"
"knative.dev/client-pkg/pkg/util"
"knative.dev/kn-plugin-admin/pkg/testutil"
"knative.dev/serving/pkg/autoscaler/config"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/autoscaling/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"

"knative.dev/client/pkg/kn/flags"
"knative.dev/client-pkg/pkg/kn/flags"

as "knative.dev/serving/pkg/apis/autoscaling"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/command/cdc/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
"knative.dev/client/pkg/kn/commands/flags"
"knative.dev/client/pkg/printers"
hprinters "knative.dev/client/pkg/printers"
"knative.dev/client-pkg/pkg/kn/commands/flags"
"knative.dev/client-pkg/pkg/printers"
hprinters "knative.dev/client-pkg/pkg/printers"
"knative.dev/kn-plugin-admin/pkg"
typev1alpha1 "knative.dev/networking/pkg/apis/networking/v1alpha1"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/domain/human_readable_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"

hprinters "knative.dev/client/pkg/printers"
hprinters "knative.dev/client-pkg/pkg/printers"
)

// DomainListHandlers adds print handlers for domain list command
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/domain/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/client/pkg/kn/commands/flags"
"knative.dev/client-pkg/pkg/kn/commands/flags"
"knative.dev/kn-plugin-admin/pkg"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/command/domain/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"gotest.tools/v3/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/client/pkg/util"
"knative.dev/client-pkg/pkg/util"

"knative.dev/kn-plugin-admin/pkg/testutil"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/registry/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/client/pkg/kn/commands"
"knative.dev/client-pkg/pkg/kn/commands"
"knative.dev/kn-plugin-admin/pkg"

"encoding/json"
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/registry/human_readable_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
"k8s.io/apimachinery/pkg/runtime"

hprinters "knative.dev/client/pkg/printers"
hprinters "knative.dev/client-pkg/pkg/printers"
)

// RegistryListHandlers adds print handlers for registry list command
Expand Down
4 changes: 2 additions & 2 deletions pkg/command/registry/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/kubernetes"

"knative.dev/client/pkg/kn/commands"
"knative.dev/client/pkg/kn/commands/flags"
"knative.dev/client-pkg/pkg/kn/commands"
"knative.dev/client-pkg/pkg/kn/commands/flags"
"knative.dev/kn-plugin-admin/pkg"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/command/registry/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"k8s.io/client-go/kubernetes"
k8sfake "k8s.io/client-go/kubernetes/fake"

"knative.dev/client/pkg/util"
"knative.dev/client-pkg/pkg/util"
"knative.dev/kn-plugin-admin/pkg"
"knative.dev/kn-plugin-admin/pkg/testutil"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/command/registry/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/kubernetes"

"knative.dev/client/pkg/kn/commands"
"knative.dev/client-pkg/pkg/kn/commands"
"knative.dev/kn-plugin-admin/pkg"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"knative.dev/kn-plugin-admin/core"

"knative.dev/client/pkg/kn/plugin"
"knative.dev/client-pkg/pkg/kn/plugin"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/kn_admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"strings"
"testing"

testcommon "github.com/maximilien/kn-source-pkg/test/e2e"
"gotest.tools/v3/assert"
"knative.dev/client/lib/test"
"knative.dev/client/pkg/util"
testcommon "knative.dev/client-pkg/pkg/kn-source-pkg/test/e2e"
"knative.dev/client-pkg/pkg/util"
"knative.dev/client-pkg/pkg/util/test"
"knative.dev/kn-plugin-admin/pkg/command/autoscaling"
"knative.dev/serving/pkg/autoscaler/config"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ package client

// GroupName is the group name used in this package
const (
GroupName = "client.knative.dev"
GroupName = "client-pkg.knative.dev"
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*/

// +k8s:deepcopy-gen=package
// +groupName=client.knative.dev
// +groupName=client-pkg.knative.dev

// Package v1alpha1 is the v1alpha1 version of the API.
package v1alpha1 // import "knative.dev/client/pkg/apis/client/serving/v1alpha1"
package v1alpha1 // import "knative.dev/client-pkg/pkg/apis/client/v1alpha1"
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"

"knative.dev/client/pkg/apis/client"
"knative.dev/client-pkg/pkg/apis/client"
)

// SchemeGroupVersion is group version used to register these objects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
"knative.dev/client/pkg/util"
"knative.dev/client-pkg/pkg/util"
"knative.dev/eventing/pkg/apis/messaging"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
"knative.dev/client/pkg/util/mock"
"knative.dev/client-pkg/pkg/util/mock"
)

// MockKnDynamicClient is a combine of test object and recorder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/runtime"

"knative.dev/client/pkg/dynamic"
"knative.dev/client-pkg/pkg/dynamic"

eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1"
messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/util/retry"
"knative.dev/client/pkg/config"
"knative.dev/client-pkg/pkg/config"
v1 "knative.dev/eventing/pkg/apis/duck/v1"
eventingv1 "knative.dev/eventing/pkg/apis/eventing/v1"
"knative.dev/eventing/pkg/client/clientset/versioned/scheme"
clientv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1"
duckv1 "knative.dev/pkg/apis/duck/v1"

kn_errors "knative.dev/client/pkg/errors"
"knative.dev/client/pkg/util"
"knative.dev/client/pkg/wait"
kn_errors "knative.dev/client-pkg/pkg/errors"
"knative.dev/client-pkg/pkg/util"
"knative.dev/client-pkg/pkg/wait"
)

type TriggerUpdateFunc func(origTrigger *eventingv1.Trigger) (*eventingv1.Trigger, error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (

apis_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
kn_errors "knative.dev/client/pkg/errors"
"knative.dev/client/pkg/util"
kn_errors "knative.dev/client-pkg/pkg/errors"
"knative.dev/client-pkg/pkg/util"
eventingv1beta1 "knative.dev/eventing/pkg/apis/eventing/v1beta1"
"knative.dev/eventing/pkg/client/clientset/versioned/scheme"
beta1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package e2e

import (
"knative.dev/client/lib/test"
"knative.dev/client-pkg/pkg/util/test"
)

type E2ETest struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,37 @@ package e2e

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"runtime"
"strings"

homedir "github.com/mitchellh/go-homedir"
"knative.dev/client/lib/test"
test2 "knative.dev/client-pkg/pkg/util/test"
)

type knPlugin struct {
kn test.Kn
kn test2.Kn
pluginName string
pluginPath string
install bool
}

// Run the KnPlugin returning a KnRunResult
func (kp *knPlugin) Run(args ...string) test.KnRunResult {
func (kp *knPlugin) Run(args ...string) test2.KnRunResult {
if kp.install {
err := kp.Install()
if err != nil {
fmt.Printf("error installing kn plugin: %s\n", err.Error())
return test.KnRunResult{}
return test2.KnRunResult{}
}
defer kp.Uninstall()
}
return RunKnPlugin(kp.kn.Namespace(), kp.pluginName, args)
}

// Kn object to run `kn`
func (kp *knPlugin) Kn() test.Kn {
func (kp *knPlugin) Kn() test2.Kn {
return kp.kn
}

Expand Down Expand Up @@ -100,12 +99,12 @@ func (kp *knPlugin) Uninstall() error {
// Utility functions

func copyPluginFile(sourceFile string, destDir string) error {
input, err := ioutil.ReadFile(sourceFile)
input, err := os.ReadFile(sourceFile)
if err != nil {
return err
}

err = ioutil.WriteFile(destDir, input, 0700)
err = os.WriteFile(destDir, input, 0700)
if err != nil {
return err
}
Expand Down Expand Up @@ -154,9 +153,9 @@ func pluginArgs(pluginName string) []string {
return pluginParts[1:]
}

func RunKnPlugin(namespace string, pluginName string, args []string) test.KnRunResult {
func RunKnPlugin(namespace string, pluginName string, args []string) test2.KnRunResult {
pluginArgs := pluginArgs(pluginName)
args = append(args, []string{"--namespace", namespace}...)
argsWithPlugin := append(pluginArgs, args...)
return test.RunKn(namespace, argsWithPlugin)
return test2.RunKn(namespace, argsWithPlugin)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/duration"
"knative.dev/client/pkg/printers"
"knative.dev/client-pkg/pkg/printers"
"knative.dev/pkg/apis"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/cli-runtime/pkg/genericclioptions"

"knative.dev/client/pkg/kn/commands"
hprinters "knative.dev/client/pkg/printers"
"knative.dev/client/pkg/util"
"knative.dev/client-pkg/pkg/kn/commands"
hprinters "knative.dev/client-pkg/pkg/printers"
"knative.dev/client-pkg/pkg/util"
)

// ListFlags composes common printer flag structs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"

clientdynamic "knative.dev/client/pkg/dynamic"
"knative.dev/client/pkg/kn/config"
clientdynamic "knative.dev/client-pkg/pkg/dynamic"
"knative.dev/client-pkg/pkg/kn/config"
)

type SinkFlags struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/spf13/pflag"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/duration"
hprinters "knative.dev/client/pkg/printers"
hprinters "knative.dev/client-pkg/pkg/printers"
"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ package commands
import (
"bytes"

"knative.dev/client/pkg/dynamic/fake"
"knative.dev/client-pkg/pkg/dynamic/fake"

"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/runtime"
clienttesting "k8s.io/client-go/testing"
servingv1fake "knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1/fake"

"knative.dev/client/pkg/kn/flags"
clientservingv1 "knative.dev/client/pkg/serving/v1"
v1 "knative.dev/client/pkg/sources/v1"
"knative.dev/client-pkg/pkg/kn/flags"
clientservingv1 "knative.dev/client-pkg/pkg/serving/v1"
v1 "knative.dev/client-pkg/pkg/sources/v1"

sourcesv1fake "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1/fake"

clientdynamic "knative.dev/client/pkg/dynamic"
clientdynamic "knative.dev/client-pkg/pkg/dynamic"
)

const FakeNamespace = "current"
Expand Down
Loading

0 comments on commit a9dce0e

Please sign in to comment.