From 671e679e7168a6e98ac84e62254a229ea59b56ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20Suszy=C5=84ski?= Date: Thu, 20 Jun 2024 19:04:08 +0200 Subject: [PATCH] Move the lib/ to public pkg/ packages --- cmd/kn/main_test.go | 14 +-- pkg/commands/completion/completion_test.go | 7 +- pkg/commands/namespaced_test.go | 6 +- pkg/commands/service/export_test.go | 108 +++++++++--------- pkg/commands/source/apiserver/describe.go | 4 +- pkg/commands/source/binding/describe.go | 4 +- pkg/commands/source/container/describe.go | 4 +- pkg/commands/source/ping/describe.go | 4 +- pkg/commands/subscription/describe.go | 8 +- pkg/commands/testing_helper_test.go | 3 +- pkg/commands/trigger/describe.go | 4 +- pkg/commands/types_test.go | 2 +- pkg/flags/podspec_helper_test.go | 8 +- pkg/flags/podspec_test.go | 6 +- pkg/plugin/manager.go | 14 +-- .../printers/describe/sink.go | 6 +- pkg/serving/v1/gitops_test.go | 18 ++- pkg/templates/command_groups_test.go | 3 +- pkg/templates/template_engine_test.go | 6 +- {lib => pkg/util}/test/broker.go | 0 {lib => pkg/util}/test/capture_output.go | 0 {lib => pkg/util}/test/channel.go | 0 {lib => pkg/util}/test/cli.go | 0 {lib => pkg/util}/test/eventtype.go | 0 {lib => pkg/util}/test/flags.go | 0 {lib => pkg/util}/test/integration.go | 0 {lib => pkg/util}/test/result_collector.go | 0 {lib => pkg/util}/test/revision.go | 0 {lib => pkg/util}/test/service.go | 0 {lib => pkg/util}/test/subscription.go | 0 {lib => pkg/util}/test/utils.go | 0 test/e2e/basic_workflow_test.go | 3 +- test/e2e/broker_test.go | 3 +- test/e2e/channels_test.go | 2 +- test/e2e/domain_mapping_test.go | 6 +- test/e2e/eventtype_test.go | 2 +- test/e2e/extra_containers_test.go | 6 +- test/e2e/ping_test.go | 3 +- test/e2e/plugins_test.go | 3 +- test/e2e/revision_test.go | 3 +- test/e2e/route_test.go | 3 +- test/e2e/service_apply_test.go | 6 +- test/e2e/service_export_test.go | 7 +- test/e2e/service_file_test.go | 6 +- test/e2e/service_import_test.go | 2 +- test/e2e/service_options_test.go | 6 +- test/e2e/service_test.go | 2 +- test/e2e/sink_test.go | 3 +- test/e2e/sinkprefix_test.go | 3 +- test/e2e/source_apiserver_test.go | 3 +- test/e2e/source_binding_test.go | 3 +- test/e2e/source_container_test.go | 3 +- test/e2e/source_list_crd_test.go | 3 +- test/e2e/source_list_test.go | 3 +- test/e2e/subscription_test.go | 3 +- test/e2e/tekton_test.go | 3 +- test/e2e/traffic_split_test.go | 3 +- test/e2e/trigger_test.go | 3 +- test/e2e/version_test.go | 3 +- 59 files changed, 140 insertions(+), 188 deletions(-) rename lib/printing/describe.go => pkg/printers/describe/sink.go (86%) rename {lib => pkg/util}/test/broker.go (100%) rename {lib => pkg/util}/test/capture_output.go (100%) rename {lib => pkg/util}/test/channel.go (100%) rename {lib => pkg/util}/test/cli.go (100%) rename {lib => pkg/util}/test/eventtype.go (100%) rename {lib => pkg/util}/test/flags.go (100%) rename {lib => pkg/util}/test/integration.go (100%) rename {lib => pkg/util}/test/result_collector.go (100%) rename {lib => pkg/util}/test/revision.go (100%) rename {lib => pkg/util}/test/service.go (100%) rename {lib => pkg/util}/test/subscription.go (100%) rename {lib => pkg/util}/test/utils.go (100%) diff --git a/cmd/kn/main_test.go b/cmd/kn/main_test.go index 6f6e524568..4e96b0711a 100644 --- a/cmd/kn/main_test.go +++ b/cmd/kn/main_test.go @@ -21,25 +21,23 @@ import ( "strings" "testing" - "knative.dev/client/pkg/config" - pluginpkg "knative.dev/client/pkg/plugin" - "github.com/spf13/cobra" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" + "knative.dev/client/pkg/config" + pluginpkg "knative.dev/client/pkg/plugin" "knative.dev/client/pkg/root" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestValidatePlugin(t *testing.T) { // Build up simple command hierarchy - root := cobra.Command{} + rootCmd := cobra.Command{} one := &cobra.Command{Use: "one"} one.AddCommand(&cobra.Command{Use: "eins"}, &cobra.Command{Use: "zwei"}) two := &cobra.Command{Use: "two"} - root.AddCommand(one, two) + rootCmd.AddCommand(one, two) data := []struct { givenPluginCommandParts []string @@ -84,7 +82,7 @@ func TestValidatePlugin(t *testing.T) { for i, d := range data { step := fmt.Sprintf("Check %d", i) - err := validatePlugin(&root, commandPartsOnlyPlugin(d.givenPluginCommandParts)) + err := validatePlugin(&rootCmd, commandPartsOnlyPlugin(d.givenPluginCommandParts)) if len(d.expectedErrors) == 0 { assert.NilError(t, err, step) } else { diff --git a/pkg/commands/completion/completion_test.go b/pkg/commands/completion/completion_test.go index 84ba92d4ef..7108076040 100644 --- a/pkg/commands/completion/completion_test.go +++ b/pkg/commands/completion/completion_test.go @@ -17,12 +17,11 @@ package completion import ( "testing" - "knative.dev/client/lib/test" - "knative.dev/client/pkg/commands" - "knative.dev/client/pkg/util" - "github.com/spf13/cobra" "gotest.tools/v3/assert" + "knative.dev/client/pkg/commands" + "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestCompletionUsage(t *testing.T) { diff --git a/pkg/commands/namespaced_test.go b/pkg/commands/namespaced_test.go index 3110c08508..92a6f893d1 100644 --- a/pkg/commands/namespaced_test.go +++ b/pkg/commands/namespaced_test.go @@ -19,12 +19,10 @@ import ( "path/filepath" "testing" - "knative.dev/client/lib/test" - - "k8s.io/client-go/tools/clientcmd" - "github.com/spf13/cobra" "gotest.tools/v3/assert" + "k8s.io/client-go/tools/clientcmd" + "knative.dev/client/pkg/util/test" ) // testCommandGenerator generates a test cobra command diff --git a/pkg/commands/service/export_test.go b/pkg/commands/service/export_test.go index 7b2b2ee83f..f39f961a3d 100644 --- a/pkg/commands/service/export_test.go +++ b/pkg/commands/service/export_test.go @@ -19,15 +19,13 @@ import ( "encoding/json" "testing" - "knative.dev/client/pkg/serving" - "gotest.tools/v3/assert" - v1 "k8s.io/api/core/v1" - libtest "knative.dev/client/lib/test" clientv1alpha1 "knative.dev/client/pkg/apis/client/v1alpha1" + "knative.dev/client/pkg/serving" knclient "knative.dev/client/pkg/serving/v1" "knative.dev/client/pkg/util/mock" + "knative.dev/client/pkg/util/test" "knative.dev/pkg/ptr" apiserving "knative.dev/serving/pkg/apis/serving" servingv1 "knative.dev/serving/pkg/apis/serving/v1" @@ -63,14 +61,14 @@ func TestServiceExportError(t *testing.T) { func TestServiceExport(t *testing.T) { for _, tc := range []testCase{ - {latestSvc: libtest.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()))}, - {latestSvc: libtest.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(v1.EnvVar{Name: "a", Value: "mouse"}))}, - {latestSvc: libtest.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), libtest.WithRevisionAnnotations(map[string]string{"client.knative.dev/user-image": "busybox:v2"}))}, - {latestSvc: libtest.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithServiceLabel("a", "mouse"), servingtest.WithServiceAnnotation("a", "mouse"))}, - {latestSvc: libtest.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithVolume("secretName", "/mountpath", volumeSource("secretName")))}, + {latestSvc: test.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()))}, + {latestSvc: test.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(v1.EnvVar{Name: "a", Value: "mouse"}))}, + {latestSvc: test.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), test.WithRevisionAnnotations(map[string]string{"client.knative.dev/user-image": "busybox:v2"}))}, + {latestSvc: test.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithServiceLabel("a", "mouse"), servingtest.WithServiceAnnotation("a", "mouse"))}, + {latestSvc: test.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithVolume("secretName", "/mountpath", volumeSource("secretName")))}, } { exportServiceTestForReplay(t, &tc) - tc.expectedKNExport = libtest.BuildKNExportWithOptions() + tc.expectedKNExport = test.BuildKNExportWithOptions() exportServiceTest(t, &tc, true) //test default exportServiceTest(t, &tc, false) @@ -108,38 +106,38 @@ func exportServiceTest(t *testing.T, tc *testCase, addMode bool) { func TestServiceExportwithMultipleRevisions(t *testing.T) { for _, tc := range []testCase{{ name: "test 2 revisions with traffic split", - latestSvc: libtest.BuildServiceWithOptions( + latestSvc: test.BuildServiceWithOptions( "foo", servingtest.WithConfigSpec(buildConfiguration()), - libtest.WithRevisionAnnotations(map[string]string{"client.knative.dev/user-image": "busybox:v2"}), - libtest.WithTrafficSpec([]string{"foo-rev-1", "latest"}, []int{50, 50}, []string{"", ""}), + test.WithRevisionAnnotations(map[string]string{"client.knative.dev/user-image": "busybox:v2"}), + test.WithTrafficSpec([]string{"foo-rev-1", "latest"}, []int{50, 50}, []string{"", ""}), ), - expectedSvcList: libtest.BuildServiceListWithOptions( - libtest.WithService(libtest.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), - libtest.WithRevisionAnnotations(map[string]string{"client.knative.dev/user-image": "busybox:v1"}), + expectedSvcList: test.BuildServiceListWithOptions( + test.WithService(test.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), + test.WithRevisionAnnotations(map[string]string{"client.knative.dev/user-image": "busybox:v1"}), servingtest.WithBYORevisionName("foo-rev-1"), )), - libtest.WithService(libtest.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), - libtest.WithRevisionAnnotations(map[string]string{"client.knative.dev/user-image": "busybox:v2"}), - libtest.WithTrafficSpec([]string{"foo-rev-1", "latest"}, []int{50, 50}, []string{"", ""}), + test.WithService(test.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), + test.WithRevisionAnnotations(map[string]string{"client.knative.dev/user-image": "busybox:v2"}), + test.WithTrafficSpec([]string{"foo-rev-1", "latest"}, []int{50, 50}, []string{"", ""}), )), ), - revisionList: libtest.BuildRevisionListWithOptions( - libtest.WithRevision(*(libtest.BuildRevision("foo-rev-1", + revisionList: test.BuildRevisionListWithOptions( + test.WithRevision(*(test.BuildRevision("foo-rev-1", servingtest.WithRevisionLabel(apiserving.ServiceLabelKey, "foo"), servingtest.WithRevisionLabel(apiserving.ConfigurationGenerationLabelKey, "1"), servingtest.WithRevisionAnn("client.knative.dev/user-image", "busybox:v1"), servingtest.WithRevisionAnn("serving.knative.dev/lastPinned", "1111132"), servingtest.WithRevisionAnn(serving.UpdateTimestampAnnotationKey, "now"), ))), - libtest.WithRevision(*(libtest.BuildRevision("foo-rev-2", + test.WithRevision(*(test.BuildRevision("foo-rev-2", servingtest.WithRevisionLabel(apiserving.ServiceLabelKey, "foo"), servingtest.WithRevisionLabel(apiserving.ConfigurationGenerationLabelKey, "1"), servingtest.WithRevisionAnn("client.knative.dev/user-image", "busybox:v2"), servingtest.WithRevisionAnn(serving.UpdateTimestampAnnotationKey, "now"), ))), ), - expectedKNExport: libtest.BuildKNExportWithOptions( - libtest.WithKNRevision(*(libtest.BuildRevision("foo-rev-1", + expectedKNExport: test.BuildKNExportWithOptions( + test.WithKNRevision(*(test.BuildRevision("foo-rev-1", servingtest.WithRevisionLabel(apiserving.ServiceLabelKey, "foo"), servingtest.WithRevisionLabel(apiserving.ConfigurationGenerationLabelKey, "1"), servingtest.WithRevisionAnn("client.knative.dev/user-image", "busybox:v1"), @@ -147,86 +145,86 @@ func TestServiceExportwithMultipleRevisions(t *testing.T) { ), }, { name: "test 2 revisions no traffic split", - latestSvc: libtest.BuildServiceWithOptions( + latestSvc: test.BuildServiceWithOptions( "foo", servingtest.WithConfigSpec(buildConfiguration()), - libtest.WithTrafficSpec([]string{"latest"}, []int{100}, []string{""}), + test.WithTrafficSpec([]string{"latest"}, []int{100}, []string{""}), ), - expectedSvcList: libtest.BuildServiceListWithOptions( - libtest.WithService(libtest.BuildServiceWithOptions( + expectedSvcList: test.BuildServiceListWithOptions( + test.WithService(test.BuildServiceWithOptions( "foo", servingtest.WithConfigSpec(buildConfiguration()), - libtest.WithTrafficSpec([]string{"latest"}, []int{100}, []string{""}), + test.WithTrafficSpec([]string{"latest"}, []int{100}, []string{""}), )), ), - revisionList: libtest.BuildRevisionListWithOptions( - libtest.WithRevision(*(libtest.BuildRevision("foo-rev-1", + revisionList: test.BuildRevisionListWithOptions( + test.WithRevision(*(test.BuildRevision("foo-rev-1", servingtest.WithRevisionLabel(apiserving.ConfigurationGenerationLabelKey, "1"), servingtest.WithRevisionLabel(apiserving.ServiceLabelKey, "foo"), ))), - libtest.WithRevision(*(libtest.BuildRevision("foo-rev-2", + test.WithRevision(*(test.BuildRevision("foo-rev-2", servingtest.WithRevisionLabel(apiserving.ConfigurationGenerationLabelKey, "2"), servingtest.WithRevisionLabel(apiserving.ServiceLabelKey, "foo"), ))), ), - expectedKNExport: libtest.BuildKNExportWithOptions(), + expectedKNExport: test.BuildKNExportWithOptions(), }, { name: "test 3 active revisions with traffic split with no latest revision", - latestSvc: libtest.BuildServiceWithOptions( + latestSvc: test.BuildServiceWithOptions( "foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(v1.EnvVar{Name: "a", Value: "mouse"}), servingtest.WithBYORevisionName("foo-rev-3"), - libtest.WithTrafficSpec([]string{"foo-rev-1", "foo-rev-2", "foo-rev-3"}, []int{25, 50, 25}, []string{"", "", ""}), + test.WithTrafficSpec([]string{"foo-rev-1", "foo-rev-2", "foo-rev-3"}, []int{25, 50, 25}, []string{"", "", ""}), ), - expectedSvcList: libtest.BuildServiceListWithOptions( - libtest.WithService( - libtest.BuildServiceWithOptions( + expectedSvcList: test.BuildServiceListWithOptions( + test.WithService( + test.BuildServiceWithOptions( "foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(v1.EnvVar{Name: "a", Value: "cat"}), servingtest.WithBYORevisionName("foo-rev-1"), ), ), - libtest.WithService( - libtest.BuildServiceWithOptions( + test.WithService( + test.BuildServiceWithOptions( "foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(v1.EnvVar{Name: "a", Value: "dog"}), servingtest.WithBYORevisionName("foo-rev-2"), ), ), - libtest.WithService( - libtest.BuildServiceWithOptions( + test.WithService( + test.BuildServiceWithOptions( "foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(v1.EnvVar{Name: "a", Value: "mouse"}), servingtest.WithBYORevisionName("foo-rev-3"), - libtest.WithTrafficSpec([]string{"foo-rev-1", "foo-rev-2", "foo-rev-3"}, []int{25, 50, 25}, []string{"", "", ""}), + test.WithTrafficSpec([]string{"foo-rev-1", "foo-rev-2", "foo-rev-3"}, []int{25, 50, 25}, []string{"", "", ""}), ), ), ), - revisionList: libtest.BuildRevisionListWithOptions( - libtest.WithRevision(*(libtest.BuildRevision("foo-rev-1", + revisionList: test.BuildRevisionListWithOptions( + test.WithRevision(*(test.BuildRevision("foo-rev-1", servingtest.WithRevisionLabel(apiserving.ConfigurationGenerationLabelKey, "1"), servingtest.WithRevisionLabel(apiserving.ServiceLabelKey, "foo"), - libtest.WithRevisionEnv(v1.EnvVar{Name: "a", Value: "cat"}), + test.WithRevisionEnv(v1.EnvVar{Name: "a", Value: "cat"}), ))), - libtest.WithRevision(*(libtest.BuildRevision("foo-rev-2", + test.WithRevision(*(test.BuildRevision("foo-rev-2", servingtest.WithRevisionLabel(apiserving.ConfigurationGenerationLabelKey, "2"), servingtest.WithRevisionLabel(apiserving.ServiceLabelKey, "foo"), - libtest.WithRevisionEnv(v1.EnvVar{Name: "a", Value: "dog"}), + test.WithRevisionEnv(v1.EnvVar{Name: "a", Value: "dog"}), ))), - libtest.WithRevision(*(libtest.BuildRevision("foo-rev-3", + test.WithRevision(*(test.BuildRevision("foo-rev-3", servingtest.WithRevisionLabel(apiserving.ConfigurationGenerationLabelKey, "3"), servingtest.WithRevisionLabel(apiserving.ServiceLabelKey, "foo"), - libtest.WithRevisionEnv(v1.EnvVar{Name: "a", Value: "mouse"}), + test.WithRevisionEnv(v1.EnvVar{Name: "a", Value: "mouse"}), ))), ), - expectedKNExport: libtest.BuildKNExportWithOptions( - libtest.WithKNRevision(*(libtest.BuildRevision("foo-rev-1", + expectedKNExport: test.BuildKNExportWithOptions( + test.WithKNRevision(*(test.BuildRevision("foo-rev-1", servingtest.WithRevisionLabel(apiserving.ConfigurationGenerationLabelKey, "1"), servingtest.WithRevisionLabel(apiserving.ServiceLabelKey, "foo"), - libtest.WithRevisionEnv(v1.EnvVar{Name: "a", Value: "cat"}), + test.WithRevisionEnv(v1.EnvVar{Name: "a", Value: "cat"}), ))), - libtest.WithKNRevision(*(libtest.BuildRevision("foo-rev-2", + test.WithKNRevision(*(test.BuildRevision("foo-rev-2", servingtest.WithRevisionLabel(apiserving.ConfigurationGenerationLabelKey, "2"), servingtest.WithRevisionLabel(apiserving.ServiceLabelKey, "foo"), - libtest.WithRevisionEnv(v1.EnvVar{Name: "a", Value: "dog"}), + test.WithRevisionEnv(v1.EnvVar{Name: "a", Value: "dog"}), ))), ), }} { diff --git a/pkg/commands/source/apiserver/describe.go b/pkg/commands/source/apiserver/describe.go index 006dbbda4e..844628f5e1 100644 --- a/pkg/commands/source/apiserver/describe.go +++ b/pkg/commands/source/apiserver/describe.go @@ -21,8 +21,8 @@ import ( "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" + "knative.dev/client/pkg/printers/describe" - "knative.dev/client/lib/printing" "knative.dev/client/pkg/commands" "knative.dev/client/pkg/printers" v1 "knative.dev/eventing/pkg/apis/sources/v1" @@ -85,7 +85,7 @@ func NewAPIServerDescribeCommand(p *commands.KnParams) *cobra.Command { return err } - printing.DescribeSink(dw, "Sink", apiSource.Namespace, &apiSource.Spec.Sink) + describe.Sink(dw, "Sink", apiSource.Namespace, &apiSource.Spec.Sink) dw.WriteLine() if err := dw.Flush(); err != nil { return err diff --git a/pkg/commands/source/binding/describe.go b/pkg/commands/source/binding/describe.go index 9437e0cd50..99e9ead4e3 100644 --- a/pkg/commands/source/binding/describe.go +++ b/pkg/commands/source/binding/describe.go @@ -21,10 +21,10 @@ import ( "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" + "knative.dev/client/pkg/printers/describe" v1 "knative.dev/eventing/pkg/apis/sources/v1" "knative.dev/pkg/tracker" - "knative.dev/client/lib/printing" "knative.dev/client/pkg/commands" "knative.dev/client/pkg/printers" ) @@ -105,7 +105,7 @@ func NewBindingDescribeCommand(p *commands.KnParams) *cobra.Command { func writeSinkBinding(dw printers.PrefixWriter, binding *v1.SinkBinding, printDetails bool) { commands.WriteMetadata(dw, &binding.ObjectMeta, printDetails) writeSubject(dw, binding.Namespace, &binding.Spec.Subject) - printing.DescribeSink(dw, "Sink", binding.Namespace, &binding.Spec.Sink) + describe.Sink(dw, "Sink", binding.Namespace, &binding.Spec.Sink) if binding.Spec.CloudEventOverrides != nil && binding.Spec.CloudEventOverrides.Extensions != nil { writeCeOverrides(dw, binding.Spec.CloudEventOverrides.Extensions) } diff --git a/pkg/commands/source/container/describe.go b/pkg/commands/source/container/describe.go index b2babb77ee..ed96265b3a 100644 --- a/pkg/commands/source/container/describe.go +++ b/pkg/commands/source/container/describe.go @@ -22,9 +22,9 @@ import ( "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" - "knative.dev/client/lib/printing" "knative.dev/client/pkg/commands" "knative.dev/client/pkg/printers" + "knative.dev/client/pkg/printers/describe" v1 "knative.dev/eventing/pkg/apis/sources/v1" ) @@ -67,7 +67,7 @@ func NewContainerDescribeCommand(p *commands.KnParams) *cobra.Command { return err } - printing.DescribeSink(dw, "Sink", source.Namespace, &source.Spec.Sink) + describe.Sink(dw, "Sink", source.Namespace, &source.Spec.Sink) dw.WriteLine() if err := dw.Flush(); err != nil { return err diff --git a/pkg/commands/source/ping/describe.go b/pkg/commands/source/ping/describe.go index 6c23120819..b070f7dd41 100644 --- a/pkg/commands/source/ping/describe.go +++ b/pkg/commands/source/ping/describe.go @@ -20,8 +20,8 @@ import ( "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" + "knative.dev/client/pkg/printers/describe" - "knative.dev/client/lib/printing" "knative.dev/client/pkg/commands" "knative.dev/client/pkg/printers" clientsourcesv1beta2 "knative.dev/eventing/pkg/apis/sources/v1beta2" @@ -85,7 +85,7 @@ func NewPingDescribeCommand(p *commands.KnParams) *cobra.Command { } // Revisions summary info - printing.DescribeSink(dw, "Sink", pingSource.Namespace, &pingSource.Spec.Sink) + describe.Sink(dw, "Sink", pingSource.Namespace, &pingSource.Spec.Sink) dw.WriteLine() if err := dw.Flush(); err != nil { return err diff --git a/pkg/commands/subscription/describe.go b/pkg/commands/subscription/describe.go index f29c6d7713..02c015f6d7 100644 --- a/pkg/commands/subscription/describe.go +++ b/pkg/commands/subscription/describe.go @@ -21,11 +21,11 @@ import ( "fmt" "github.com/spf13/cobra" + "knative.dev/client/pkg/printers/describe" "k8s.io/cli-runtime/pkg/genericclioptions" messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1" - "knative.dev/client/lib/printing" "knative.dev/client/pkg/commands" knerrors "knative.dev/client/pkg/errors" "knative.dev/client/pkg/printers" @@ -103,9 +103,9 @@ func writeSubscription(dw printers.PrefixWriter, subscription *messagingv1.Subsc commands.WriteMetadata(dw, &subscription.ObjectMeta, printDetails) ctype := fmt.Sprintf("%s:%s (%s)", subscription.Spec.Channel.Kind, subscription.Spec.Channel.Name, subscription.Spec.Channel.APIVersion) dw.WriteAttribute("Channel", ctype) - printing.DescribeSink(dw, "Subscriber", subscription.Namespace, subscription.Spec.Subscriber) - printing.DescribeSink(dw, "Reply", subscription.Namespace, subscription.Spec.Reply) + describe.Sink(dw, "Subscriber", subscription.Namespace, subscription.Spec.Subscriber) + describe.Sink(dw, "Reply", subscription.Namespace, subscription.Spec.Reply) if subscription.Spec.DeepCopy().Delivery != nil { - printing.DescribeSink(dw, "DeadLetterSink", subscription.Namespace, subscription.Spec.Delivery.DeadLetterSink) + describe.Sink(dw, "DeadLetterSink", subscription.Namespace, subscription.Spec.Delivery.DeadLetterSink) } } diff --git a/pkg/commands/testing_helper_test.go b/pkg/commands/testing_helper_test.go index 0685010abb..d7691b67f9 100644 --- a/pkg/commands/testing_helper_test.go +++ b/pkg/commands/testing_helper_test.go @@ -20,8 +20,7 @@ import ( "github.com/spf13/cobra" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" + "knative.dev/client/pkg/util/test" ) func TestCreateTestKnCommand(t *testing.T) { diff --git a/pkg/commands/trigger/describe.go b/pkg/commands/trigger/describe.go index 2c83699fbc..887753e081 100644 --- a/pkg/commands/trigger/describe.go +++ b/pkg/commands/trigger/describe.go @@ -19,9 +19,9 @@ import ( "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" - "knative.dev/client/lib/printing" "knative.dev/client/pkg/commands" "knative.dev/client/pkg/printers" + "knative.dev/client/pkg/printers/describe" v1beta1 "knative.dev/eventing/pkg/apis/eventing/v1" ) @@ -91,7 +91,7 @@ func NewTriggerDescribeCommand(p *commands.KnParams) *cobra.Command { } // Revisions summary info - printing.DescribeSink(dw, "Sink", trigger.Namespace, &trigger.Spec.Subscriber) + describe.Sink(dw, "Sink", trigger.Namespace, &trigger.Spec.Subscriber) dw.WriteLine() if err := dw.Flush(); err != nil { return err diff --git a/pkg/commands/types_test.go b/pkg/commands/types_test.go index 0ae5f166c6..7986774b38 100644 --- a/pkg/commands/types_test.go +++ b/pkg/commands/types_test.go @@ -21,7 +21,7 @@ import ( "strings" "testing" - "knative.dev/client/lib/test" + "knative.dev/client/pkg/util/test" "gotest.tools/v3/assert" "k8s.io/client-go/tools/clientcmd" diff --git a/pkg/flags/podspec_helper_test.go b/pkg/flags/podspec_helper_test.go index 52d8c77e7e..aeee9914f1 100644 --- a/pkg/flags/podspec_helper_test.go +++ b/pkg/flags/podspec_helper_test.go @@ -24,14 +24,12 @@ import ( "strings" "testing" - "k8s.io/apimachinery/pkg/util/intstr" - - "k8s.io/apimachinery/pkg/api/resource" - "knative.dev/client/lib/test" - "gotest.tools/v3/assert" corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/util/intstr" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" "knative.dev/pkg/ptr" ) diff --git a/pkg/flags/podspec_test.go b/pkg/flags/podspec_test.go index 96da8b8719..8f91976c84 100644 --- a/pkg/flags/podspec_test.go +++ b/pkg/flags/podspec_test.go @@ -22,14 +22,12 @@ import ( "path/filepath" "testing" - "k8s.io/apimachinery/pkg/util/intstr" - - "knative.dev/client/lib/test" - "github.com/spf13/cobra" "gotest.tools/v3/assert" corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/util/intstr" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" "knative.dev/pkg/ptr" ) diff --git a/pkg/plugin/manager.go b/pkg/plugin/manager.go index de26bbf498..3def550c2f 100644 --- a/pkg/plugin/manager.go +++ b/pkg/plugin/manager.go @@ -27,31 +27,31 @@ import ( pkgplugin "knative.dev/client-pkg/pkg/plugin" - homedir "github.com/mitchellh/go-homedir" + "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" ) -// Allow plugins to register to this slice for inlining +// InternalPlugins allow plugins to register to this slice for inlining var InternalPlugins PluginList var synced bool -// Interface describing a plugin +// Plugin describes a plugin type Plugin interface { - // Get the name of the plugin (the file name without extensions) + // Name of the plugin (the file name without extensions) Name() string // Execute the plugin with the given arguments Execute(args []string) error - // Return a description of the plugin (if support by the plugin binary) + // Description of the plugin (if support by the plugin binary) Description() (string, error) - // The command path leading to this plugin. + // CommandParts leading to this plugin. // Eg. for a plugin "kn source github" this will be [ "source", "github" ] CommandParts() []string - // Location of the plugin where it is stored in the filesystem + // Path of the plugin where it is stored in the filesystem Path() string } diff --git a/lib/printing/describe.go b/pkg/printers/describe/sink.go similarity index 86% rename from lib/printing/describe.go rename to pkg/printers/describe/sink.go index 66467d01af..f509ecdc92 100644 --- a/lib/printing/describe.go +++ b/pkg/printers/describe/sink.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package printing +package describe import ( "fmt" @@ -23,9 +23,9 @@ import ( duckv1 "knative.dev/pkg/apis/duck/v1" ) -// DescribeSink prints the given 'sink' for the given prefix writer 'dw', +// Sink prints the given 'sink' for the given prefix writer 'dw', // provide 'attribute' to print the section heading for this sink, -func DescribeSink(dw printers.PrefixWriter, attribute, namespace string, sink *duckv1.Destination) { +func Sink(dw printers.PrefixWriter, attribute, namespace string, sink *duckv1.Destination) { if sink == nil { return } diff --git a/pkg/serving/v1/gitops_test.go b/pkg/serving/v1/gitops_test.go index 8095dccceb..bc3c45fb7c 100644 --- a/pkg/serving/v1/gitops_test.go +++ b/pkg/serving/v1/gitops_test.go @@ -21,15 +21,13 @@ import ( "time" "gotest.tools/v3/assert" - corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - servingtest "knative.dev/serving/pkg/testing/v1" - - libtest "knative.dev/client/lib/test" + "knative.dev/client/pkg/util/test" "knative.dev/pkg/ptr" servingv1 "knative.dev/serving/pkg/apis/serving/v1" + servingtest "knative.dev/serving/pkg/testing/v1" ) func TestGitOpsOperations(t *testing.T) { @@ -43,10 +41,10 @@ func TestGitOpsOperations(t *testing.T) { diffClusterClient := NewKnServingGitOpsClient("", "tmp") // set up test services - fooSvc := libtest.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration())) - barSvc := libtest.BuildServiceWithOptions("bar", servingtest.WithConfigSpec(buildConfiguration())) - fooUpdateSvc := libtest.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(corev1.EnvVar{Name: "a", Value: "mouse"})) - mockUpdateSvc := libtest.BuildServiceWithOptions("mock", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(corev1.EnvVar{Name: "a", Value: "mouse"})) + fooSvc := test.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration())) + barSvc := test.BuildServiceWithOptions("bar", servingtest.WithConfigSpec(buildConfiguration())) + fooUpdateSvc := test.BuildServiceWithOptions("foo", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(corev1.EnvVar{Name: "a", Value: "mouse"})) + mockUpdateSvc := test.BuildServiceWithOptions("mock", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(corev1.EnvVar{Name: "a", Value: "mouse"})) fooserviceList := getServiceList([]servingv1.Service{*barSvc, *fooSvc}) allServices := getServiceList([]servingv1.Service{*barSvc, *barSvc, *fooSvc}) @@ -145,8 +143,8 @@ func TestGitOpsSingleFile(t *testing.T) { mockDirclient := NewKnServingGitOpsClient("", tmpDir) // set up test services - testSvc := libtest.BuildServiceWithOptions("test", servingtest.WithConfigSpec(buildConfiguration())) - updateSvc := libtest.BuildServiceWithOptions("test", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(corev1.EnvVar{Name: "a", Value: "mouse"})) + testSvc := test.BuildServiceWithOptions("test", servingtest.WithConfigSpec(buildConfiguration())) + updateSvc := test.BuildServiceWithOptions("test", servingtest.WithConfigSpec(buildConfiguration()), servingtest.WithEnv(corev1.EnvVar{Name: "a", Value: "mouse"})) svcList := getServiceList([]servingv1.Service{*updateSvc}) diff --git a/pkg/templates/command_groups_test.go b/pkg/templates/command_groups_test.go index 0b7fcae66f..b21f7be844 100644 --- a/pkg/templates/command_groups_test.go +++ b/pkg/templates/command_groups_test.go @@ -21,9 +21,8 @@ import ( "github.com/spf13/cobra" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) var groups = CommandGroups{ diff --git a/pkg/templates/template_engine_test.go b/pkg/templates/template_engine_test.go index 4d5b4722c8..659f7eeaec 100644 --- a/pkg/templates/template_engine_test.go +++ b/pkg/templates/template_engine_test.go @@ -18,13 +18,11 @@ import ( "strings" "testing" - flag "github.com/spf13/pflag" - "github.com/spf13/cobra" + flag "github.com/spf13/pflag" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) type testData struct { diff --git a/lib/test/broker.go b/pkg/util/test/broker.go similarity index 100% rename from lib/test/broker.go rename to pkg/util/test/broker.go diff --git a/lib/test/capture_output.go b/pkg/util/test/capture_output.go similarity index 100% rename from lib/test/capture_output.go rename to pkg/util/test/capture_output.go diff --git a/lib/test/channel.go b/pkg/util/test/channel.go similarity index 100% rename from lib/test/channel.go rename to pkg/util/test/channel.go diff --git a/lib/test/cli.go b/pkg/util/test/cli.go similarity index 100% rename from lib/test/cli.go rename to pkg/util/test/cli.go diff --git a/lib/test/eventtype.go b/pkg/util/test/eventtype.go similarity index 100% rename from lib/test/eventtype.go rename to pkg/util/test/eventtype.go diff --git a/lib/test/flags.go b/pkg/util/test/flags.go similarity index 100% rename from lib/test/flags.go rename to pkg/util/test/flags.go diff --git a/lib/test/integration.go b/pkg/util/test/integration.go similarity index 100% rename from lib/test/integration.go rename to pkg/util/test/integration.go diff --git a/lib/test/result_collector.go b/pkg/util/test/result_collector.go similarity index 100% rename from lib/test/result_collector.go rename to pkg/util/test/result_collector.go diff --git a/lib/test/revision.go b/pkg/util/test/revision.go similarity index 100% rename from lib/test/revision.go rename to pkg/util/test/revision.go diff --git a/lib/test/service.go b/pkg/util/test/service.go similarity index 100% rename from lib/test/service.go rename to pkg/util/test/service.go diff --git a/lib/test/subscription.go b/pkg/util/test/subscription.go similarity index 100% rename from lib/test/subscription.go rename to pkg/util/test/subscription.go diff --git a/lib/test/utils.go b/pkg/util/test/utils.go similarity index 100% rename from lib/test/utils.go rename to pkg/util/test/utils.go diff --git a/test/e2e/basic_workflow_test.go b/test/e2e/basic_workflow_test.go index 199b285624..56b2e459f9 100644 --- a/test/e2e/basic_workflow_test.go +++ b/test/e2e/basic_workflow_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestBasicWorkflow(t *testing.T) { diff --git a/test/e2e/broker_test.go b/test/e2e/broker_test.go index 461dfad848..f4c0af384a 100644 --- a/test/e2e/broker_test.go +++ b/test/e2e/broker_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestBroker(t *testing.T) { diff --git a/test/e2e/channels_test.go b/test/e2e/channels_test.go index b3ad947b1f..c2bbac2a3a 100644 --- a/test/e2e/channels_test.go +++ b/test/e2e/channels_test.go @@ -21,8 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) const ( diff --git a/test/e2e/domain_mapping_test.go b/test/e2e/domain_mapping_test.go index e6f9f0ef87..049caf2c49 100644 --- a/test/e2e/domain_mapping_test.go +++ b/test/e2e/domain_mapping_test.go @@ -32,11 +32,9 @@ import ( "testing" "time" - "knative.dev/client/pkg/util" - "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" + "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestDomain(t *testing.T) { diff --git a/test/e2e/eventtype_test.go b/test/e2e/eventtype_test.go index 9172391067..c95d1ccc46 100644 --- a/test/e2e/eventtype_test.go +++ b/test/e2e/eventtype_test.go @@ -21,8 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) const ( diff --git a/test/e2e/extra_containers_test.go b/test/e2e/extra_containers_test.go index 4d09ddfad8..d91bc158d2 100644 --- a/test/e2e/extra_containers_test.go +++ b/test/e2e/extra_containers_test.go @@ -26,12 +26,10 @@ import ( "strings" "testing" + "gotest.tools/v3/assert" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" pkgtest "knative.dev/pkg/test" - - "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" ) func TestMultiContainers(t *testing.T) { diff --git a/test/e2e/ping_test.go b/test/e2e/ping_test.go index 80fa0b4202..78ba0ee083 100644 --- a/test/e2e/ping_test.go +++ b/test/e2e/ping_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestSourcePing(t *testing.T) { diff --git a/test/e2e/plugins_test.go b/test/e2e/plugins_test.go index f4404d75e6..d27b98d6ef 100644 --- a/test/e2e/plugins_test.go +++ b/test/e2e/plugins_test.go @@ -25,9 +25,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) const ( diff --git a/test/e2e/revision_test.go b/test/e2e/revision_test.go index fd9fb9a340..141cb81c4f 100644 --- a/test/e2e/revision_test.go +++ b/test/e2e/revision_test.go @@ -21,8 +21,7 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" + "knative.dev/client/pkg/util/test" ) func TestRevision(t *testing.T) { diff --git a/test/e2e/route_test.go b/test/e2e/route_test.go index 8880f9582b..8c6fc3c8cd 100644 --- a/test/e2e/route_test.go +++ b/test/e2e/route_test.go @@ -23,9 +23,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestRoute(t *testing.T) { diff --git a/test/e2e/service_apply_test.go b/test/e2e/service_apply_test.go index 64c9ca4e36..aef21ee025 100644 --- a/test/e2e/service_apply_test.go +++ b/test/e2e/service_apply_test.go @@ -21,11 +21,9 @@ import ( "testing" "gotest.tools/v3/assert" - - pkgtest "knative.dev/pkg/test" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" + pkgtest "knative.dev/pkg/test" ) func TestServiceApply(t *testing.T) { diff --git a/test/e2e/service_export_test.go b/test/e2e/service_export_test.go index f787329f0d..816cbbe207 100644 --- a/test/e2e/service_export_test.go +++ b/test/e2e/service_export_test.go @@ -23,16 +23,13 @@ import ( "testing" "gotest.tools/v3/assert" - - "sigs.k8s.io/yaml" - - "knative.dev/client/lib/test" - corev1 "k8s.io/api/core/v1" clientv1alpha1 "knative.dev/client/pkg/apis/client/v1alpha1" + "knative.dev/client/pkg/util/test" pkgtest "knative.dev/pkg/test" servingv1 "knative.dev/serving/pkg/apis/serving/v1" servingtest "knative.dev/serving/pkg/testing/v1" + "sigs.k8s.io/yaml" ) func TestServiceExport(t *testing.T) { diff --git a/test/e2e/service_file_test.go b/test/e2e/service_file_test.go index 266c84b29c..e330032ec6 100644 --- a/test/e2e/service_file_test.go +++ b/test/e2e/service_file_test.go @@ -22,12 +22,10 @@ import ( "path/filepath" "testing" - "gotest.tools/v3/assert/cmp" - "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" + "gotest.tools/v3/assert/cmp" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" pkgtest "knative.dev/pkg/test" ) diff --git a/test/e2e/service_import_test.go b/test/e2e/service_import_test.go index 9bbf343c0a..f5713cc38f 100644 --- a/test/e2e/service_import_test.go +++ b/test/e2e/service_import_test.go @@ -23,8 +23,8 @@ import ( "testing" "gotest.tools/v3/assert" - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestServiceImport(t *testing.T) { diff --git a/test/e2e/service_options_test.go b/test/e2e/service_options_test.go index ce1962c499..13041e9ab3 100644 --- a/test/e2e/service_options_test.go +++ b/test/e2e/service_options_test.go @@ -25,14 +25,12 @@ import ( "strings" "testing" - "knative.dev/serving/pkg/apis/autoscaling" - "gotest.tools/v3/assert" corev1 "k8s.io/api/core/v1" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" pkgtest "knative.dev/pkg/test" + "knative.dev/serving/pkg/apis/autoscaling" servingv1 "knative.dev/serving/pkg/apis/serving/v1" ) diff --git a/test/e2e/service_test.go b/test/e2e/service_test.go index 62e3c402c0..4389232434 100644 --- a/test/e2e/service_test.go +++ b/test/e2e/service_test.go @@ -26,8 +26,8 @@ import ( "gotest.tools/v3/assert" v1 "k8s.io/api/core/v1" - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" network "knative.dev/networking/pkg/apis/networking" pkgtest "knative.dev/pkg/test" "knative.dev/serving/pkg/apis/serving" diff --git a/test/e2e/sink_test.go b/test/e2e/sink_test.go index 118a7f8196..ed7469bcdd 100644 --- a/test/e2e/sink_test.go +++ b/test/e2e/sink_test.go @@ -21,8 +21,7 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" + "knative.dev/client/pkg/util/test" ) func TestSink(t *testing.T) { diff --git a/test/e2e/sinkprefix_test.go b/test/e2e/sinkprefix_test.go index bfaa55feac..db79314a7d 100644 --- a/test/e2e/sinkprefix_test.go +++ b/test/e2e/sinkprefix_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) const ( diff --git a/test/e2e/source_apiserver_test.go b/test/e2e/source_apiserver_test.go index d7db394163..fa1e0192f6 100644 --- a/test/e2e/source_apiserver_test.go +++ b/test/e2e/source_apiserver_test.go @@ -23,9 +23,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) const ( diff --git a/test/e2e/source_binding_test.go b/test/e2e/source_binding_test.go index c41894607c..97566c7c36 100644 --- a/test/e2e/source_binding_test.go +++ b/test/e2e/source_binding_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestSourceBinding(t *testing.T) { diff --git a/test/e2e/source_container_test.go b/test/e2e/source_container_test.go index 973d417472..fe6ed44627 100644 --- a/test/e2e/source_container_test.go +++ b/test/e2e/source_container_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" pkgtest "knative.dev/pkg/test" ) diff --git a/test/e2e/source_list_crd_test.go b/test/e2e/source_list_crd_test.go index 988a815827..b46c6ef073 100644 --- a/test/e2e/source_list_crd_test.go +++ b/test/e2e/source_list_crd_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) // This test requires cluster admin permissions due to working with CustomResourceDefinitions. diff --git a/test/e2e/source_list_test.go b/test/e2e/source_list_test.go index d5660cc595..80203e070c 100644 --- a/test/e2e/source_list_test.go +++ b/test/e2e/source_list_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestSourceListTypes(t *testing.T) { diff --git a/test/e2e/subscription_test.go b/test/e2e/subscription_test.go index 3242563145..c645042fdc 100644 --- a/test/e2e/subscription_test.go +++ b/test/e2e/subscription_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestSubscriptions(t *testing.T) { diff --git a/test/e2e/tekton_test.go b/test/e2e/tekton_test.go index 4d375e956d..997edea6c8 100644 --- a/test/e2e/tekton_test.go +++ b/test/e2e/tekton_test.go @@ -26,9 +26,8 @@ import ( "gotest.tools/v3/assert" "k8s.io/apimachinery/pkg/util/wait" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) const ( diff --git a/test/e2e/traffic_split_test.go b/test/e2e/traffic_split_test.go index 46d0204fcd..6634f721af 100644 --- a/test/e2e/traffic_split_test.go +++ b/test/e2e/traffic_split_test.go @@ -24,8 +24,7 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" + "knative.dev/client/pkg/util/test" ) var targetsSeparator = "|" diff --git a/test/e2e/trigger_test.go b/test/e2e/trigger_test.go index df037117ea..f9c7d04ada 100644 --- a/test/e2e/trigger_test.go +++ b/test/e2e/trigger_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestBrokerTrigger(t *testing.T) { diff --git a/test/e2e/version_test.go b/test/e2e/version_test.go index cd83696569..b09218e96c 100644 --- a/test/e2e/version_test.go +++ b/test/e2e/version_test.go @@ -21,9 +21,8 @@ import ( "testing" "gotest.tools/v3/assert" - - "knative.dev/client/lib/test" "knative.dev/client/pkg/util" + "knative.dev/client/pkg/util/test" ) func TestVersion(t *testing.T) {