diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 3f1e3161ef..2e7bf185b2 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -34,6 +34,10 @@ | Add "--annotation-service" and "--annotation-revision" to kn service create/update | https://github.com/knative/client/pull/1029[#1029] +| 🎁 +| Add alias to commands +| https://github.com/knative/client/pull/1041[#1041] + |=== ## v0.17.0 (2020-08-26) diff --git a/docs/cmd/kn_broker.md b/docs/cmd/kn_broker.md index 104788dbd7..354ad3e1f4 100644 --- a/docs/cmd/kn_broker.md +++ b/docs/cmd/kn_broker.md @@ -30,5 +30,5 @@ kn broker * [kn broker create](kn_broker_create.md) - Create a broker * [kn broker delete](kn_broker_delete.md) - Delete a broker * [kn broker describe](kn_broker_describe.md) - Describe broker -* [kn broker list](kn_broker_list.md) - List brokers +* [kn broker list](kn_broker_list.md) - List brokers (alias: 'ls') diff --git a/docs/cmd/kn_broker_list.md b/docs/cmd/kn_broker_list.md index 506de7ee61..ed7f205f3a 100644 --- a/docs/cmd/kn_broker_list.md +++ b/docs/cmd/kn_broker_list.md @@ -1,10 +1,10 @@ ## kn broker list -List brokers +List brokers (alias: 'ls') ### Synopsis -List brokers +List brokers (alias: 'ls') ``` kn broker list diff --git a/docs/cmd/kn_channel.md b/docs/cmd/kn_channel.md index 41e69096ad..864ea16049 100644 --- a/docs/cmd/kn_channel.md +++ b/docs/cmd/kn_channel.md @@ -30,5 +30,5 @@ kn channel COMMAND * [kn channel create](kn_channel_create.md) - Create an event channel * [kn channel delete](kn_channel_delete.md) - Delete a channel * [kn channel describe](kn_channel_describe.md) - Show details of a channel -* [kn channel list](kn_channel_list.md) - List channels +* [kn channel list](kn_channel_list.md) - List channels (alias: 'ls') diff --git a/docs/cmd/kn_channel_list.md b/docs/cmd/kn_channel_list.md index 646f663f34..53ff1b4300 100644 --- a/docs/cmd/kn_channel_list.md +++ b/docs/cmd/kn_channel_list.md @@ -1,10 +1,10 @@ ## kn channel list -List channels +List channels (alias: 'ls') ### Synopsis -List channels +List channels (alias: 'ls') ``` kn channel list diff --git a/docs/cmd/kn_plugin.md b/docs/cmd/kn_plugin.md index ead701a002..9627078873 100644 --- a/docs/cmd/kn_plugin.md +++ b/docs/cmd/kn_plugin.md @@ -30,5 +30,5 @@ kn plugin ### SEE ALSO * [kn](kn.md) - kn manages Knative Serving and Eventing resources -* [kn plugin list](kn_plugin_list.md) - List plugins +* [kn plugin list](kn_plugin_list.md) - List plugins (alias: 'ls') diff --git a/docs/cmd/kn_plugin_list.md b/docs/cmd/kn_plugin_list.md index 28009fb524..525553defe 100644 --- a/docs/cmd/kn_plugin_list.md +++ b/docs/cmd/kn_plugin_list.md @@ -1,6 +1,6 @@ ## kn plugin list -List plugins +List plugins (alias: 'ls') ### Synopsis diff --git a/docs/cmd/kn_revision.md b/docs/cmd/kn_revision.md index d07e70aeb9..441bf0ea02 100644 --- a/docs/cmd/kn_revision.md +++ b/docs/cmd/kn_revision.md @@ -29,5 +29,5 @@ kn revision * [kn](kn.md) - kn manages Knative Serving and Eventing resources * [kn revision delete](kn_revision_delete.md) - Delete revisions * [kn revision describe](kn_revision_describe.md) - Show details of a revision -* [kn revision list](kn_revision_list.md) - List revisions +* [kn revision list](kn_revision_list.md) - List revisions (alias: 'ls') diff --git a/docs/cmd/kn_revision_list.md b/docs/cmd/kn_revision_list.md index 2764c26198..4645246e54 100644 --- a/docs/cmd/kn_revision_list.md +++ b/docs/cmd/kn_revision_list.md @@ -1,6 +1,6 @@ ## kn revision list -List revisions +List revisions (alias: 'ls') ### Synopsis diff --git a/docs/cmd/kn_route.md b/docs/cmd/kn_route.md index 1e9e377568..3332657600 100644 --- a/docs/cmd/kn_route.md +++ b/docs/cmd/kn_route.md @@ -28,5 +28,5 @@ kn route * [kn](kn.md) - kn manages Knative Serving and Eventing resources * [kn route describe](kn_route_describe.md) - Show details of a route -* [kn route list](kn_route_list.md) - List routes +* [kn route list](kn_route_list.md) - List routes (alias: 'ls') diff --git a/docs/cmd/kn_route_list.md b/docs/cmd/kn_route_list.md index b5f62285a6..b51af0ed90 100644 --- a/docs/cmd/kn_route_list.md +++ b/docs/cmd/kn_route_list.md @@ -1,10 +1,10 @@ ## kn route list -List routes +List routes (alias: 'ls') ### Synopsis -List routes +List routes (alias: 'ls') ``` kn route list NAME diff --git a/docs/cmd/kn_service.md b/docs/cmd/kn_service.md index 7243d7e9dd..e878bef9b2 100644 --- a/docs/cmd/kn_service.md +++ b/docs/cmd/kn_service.md @@ -31,6 +31,6 @@ kn service * [kn service delete](kn_service_delete.md) - Delete services * [kn service describe](kn_service_describe.md) - Show details of a service * [kn service export](kn_service_export.md) - Export a service and its revisions -* [kn service list](kn_service_list.md) - List services +* [kn service list](kn_service_list.md) - List services (alias: 'ls') * [kn service update](kn_service_update.md) - Update a service diff --git a/docs/cmd/kn_service_list.md b/docs/cmd/kn_service_list.md index 70fdc12de5..783da9aceb 100644 --- a/docs/cmd/kn_service_list.md +++ b/docs/cmd/kn_service_list.md @@ -1,10 +1,10 @@ ## kn service list -List services +List services (alias: 'ls') ### Synopsis -List services +List services (alias: 'ls') ``` kn service list diff --git a/docs/cmd/kn_source.md b/docs/cmd/kn_source.md index 8eece17416..8423274f54 100644 --- a/docs/cmd/kn_source.md +++ b/docs/cmd/kn_source.md @@ -29,7 +29,7 @@ kn source SOURCE|COMMAND * [kn](kn.md) - kn manages Knative Serving and Eventing resources * [kn source apiserver](kn_source_apiserver.md) - Manage Kubernetes api-server sources * [kn source binding](kn_source_binding.md) - Manage sink bindings -* [kn source list](kn_source_list.md) - List event sources +* [kn source list](kn_source_list.md) - List event sources (alias: 'ls') * [kn source list-types](kn_source_list-types.md) - List event source types * [kn source ping](kn_source_ping.md) - Manage ping sources diff --git a/docs/cmd/kn_source_list.md b/docs/cmd/kn_source_list.md index 8053e9c41d..a223fc181e 100644 --- a/docs/cmd/kn_source_list.md +++ b/docs/cmd/kn_source_list.md @@ -1,10 +1,10 @@ ## kn source list -List event sources +List event sources (alias: 'ls') ### Synopsis -List event sources +List event sources (alias: 'ls') ``` kn source list diff --git a/docs/cmd/kn_subscription.md b/docs/cmd/kn_subscription.md index 640bb9a386..e9e6dddf1d 100644 --- a/docs/cmd/kn_subscription.md +++ b/docs/cmd/kn_subscription.md @@ -30,6 +30,6 @@ kn subscription COMMAND * [kn subscription create](kn_subscription_create.md) - Create a subscription * [kn subscription delete](kn_subscription_delete.md) - Delete a subscription * [kn subscription describe](kn_subscription_describe.md) - Show details of a subscription -* [kn subscription list](kn_subscription_list.md) - List subscriptions +* [kn subscription list](kn_subscription_list.md) - List subscriptions (alias: 'ls') * [kn subscription update](kn_subscription_update.md) - Update an event subscription diff --git a/docs/cmd/kn_subscription_list.md b/docs/cmd/kn_subscription_list.md index 4aead93ab4..07696cb7a5 100644 --- a/docs/cmd/kn_subscription_list.md +++ b/docs/cmd/kn_subscription_list.md @@ -1,10 +1,10 @@ ## kn subscription list -List subscriptions +List subscriptions (alias: 'ls') ### Synopsis -List subscriptions +List subscriptions (alias: 'ls') ``` kn subscription list diff --git a/docs/cmd/kn_trigger.md b/docs/cmd/kn_trigger.md index 4f82747ce4..431ee962fa 100644 --- a/docs/cmd/kn_trigger.md +++ b/docs/cmd/kn_trigger.md @@ -30,6 +30,6 @@ kn trigger * [kn trigger create](kn_trigger_create.md) - Create a trigger * [kn trigger delete](kn_trigger_delete.md) - Delete a trigger * [kn trigger describe](kn_trigger_describe.md) - Show details of a trigger -* [kn trigger list](kn_trigger_list.md) - List triggers +* [kn trigger list](kn_trigger_list.md) - List triggers (alias: 'ls') * [kn trigger update](kn_trigger_update.md) - Update a trigger diff --git a/docs/cmd/kn_trigger_list.md b/docs/cmd/kn_trigger_list.md index 7bbe298b3e..961e0f67c4 100644 --- a/docs/cmd/kn_trigger_list.md +++ b/docs/cmd/kn_trigger_list.md @@ -1,10 +1,10 @@ ## kn trigger list -List triggers +List triggers (alias: 'ls') ### Synopsis -List triggers +List triggers (alias: 'ls') ``` kn trigger list diff --git a/pkg/kn/commands/broker/broker.go b/pkg/kn/commands/broker/broker.go index bbb9334915..79a244ae1b 100644 --- a/pkg/kn/commands/broker/broker.go +++ b/pkg/kn/commands/broker/broker.go @@ -25,8 +25,9 @@ import ( // NewBrokerCommand represents broker management commands func NewBrokerCommand(p *commands.KnParams) *cobra.Command { brokerCmd := &cobra.Command{ - Use: "broker", - Short: "Manage message broker", + Use: "broker", + Short: "Manage message broker", + Aliases: []string{"brokers"}, } brokerCmd.AddCommand(NewBrokerCreateCommand(p)) brokerCmd.AddCommand(NewBrokerDescribeCommand(p)) diff --git a/pkg/kn/commands/broker/list.go b/pkg/kn/commands/broker/list.go index a4418187c1..fb90d0adfc 100644 --- a/pkg/kn/commands/broker/list.go +++ b/pkg/kn/commands/broker/list.go @@ -43,7 +43,8 @@ func NewBrokerListCommand(p *commands.KnParams) *cobra.Command { cmd := &cobra.Command{ Use: "list", - Short: "List brokers", + Short: "List brokers (alias: 'ls')", + Aliases: []string{"ls"}, Example: listExample, RunE: func(cmd *cobra.Command, args []string) (err error) { namespace, err := p.GetNamespace(cmd) diff --git a/pkg/kn/commands/channel/channel.go b/pkg/kn/commands/channel/channel.go index be324754da..c1792ff315 100644 --- a/pkg/kn/commands/channel/channel.go +++ b/pkg/kn/commands/channel/channel.go @@ -27,8 +27,9 @@ import ( // NewChannelCommand to manage event channels func NewChannelCommand(p *commands.KnParams) *cobra.Command { channelCmd := &cobra.Command{ - Use: "channel COMMAND", - Short: "Manage event channels", + Use: "channel COMMAND", + Short: "Manage event channels", + Aliases: []string{"channels"}, } channelCmd.AddCommand(NewChannelCreateCommand(p)) channelCmd.AddCommand(NewChannelListCommand(p)) diff --git a/pkg/kn/commands/channel/list.go b/pkg/kn/commands/channel/list.go index 0d4466dbeb..a8f994fae7 100644 --- a/pkg/kn/commands/channel/list.go +++ b/pkg/kn/commands/channel/list.go @@ -28,8 +28,9 @@ func NewChannelListCommand(p *commands.KnParams) *cobra.Command { listFlags := flags.NewListPrintFlags(ListHandlers) listCommand := &cobra.Command{ - Use: "list", - Short: "List channels", + Use: "list", + Short: "List channels (alias: 'ls')", + Aliases: []string{"ls"}, Example: ` # List all channels kn channel list diff --git a/pkg/kn/commands/plugin/list.go b/pkg/kn/commands/plugin/list.go index 153a8f5a08..4d78b41f2f 100644 --- a/pkg/kn/commands/plugin/list.go +++ b/pkg/kn/commands/plugin/list.go @@ -40,8 +40,9 @@ func NewPluginListCommand(p *commands.KnParams) *cobra.Command { plFlags := pluginListFlags{} pluginListCommand := &cobra.Command{ - Use: "list", - Short: "List plugins", + Use: "list", + Short: "List plugins (alias: 'ls')", + Aliases: []string{"ls"}, Long: `List all installed plugins. Available plugins are those that are: diff --git a/pkg/kn/commands/plugin/list_test.go b/pkg/kn/commands/plugin/list_test.go index 3624800ed6..798cd173f5 100644 --- a/pkg/kn/commands/plugin/list_test.go +++ b/pkg/kn/commands/plugin/list_test.go @@ -39,7 +39,7 @@ func TestPluginListBasic(t *testing.T) { } assert.Assert(t, pluginListCmd.Use == "list") - assert.Assert(t, pluginListCmd.Short == "List plugins") + assert.Assert(t, pluginListCmd.Short == "List plugins(alias: 'ls')") assert.Assert(t, strings.Contains(pluginListCmd.Long, "List all installed plugins")) assert.Assert(t, pluginListCmd.RunE != nil) } diff --git a/pkg/kn/commands/plugin/plugin.go b/pkg/kn/commands/plugin/plugin.go index 4a82598366..155023fe9a 100644 --- a/pkg/kn/commands/plugin/plugin.go +++ b/pkg/kn/commands/plugin/plugin.go @@ -22,8 +22,9 @@ import ( func NewPluginCommand(p *commands.KnParams) *cobra.Command { pluginCmd := &cobra.Command{ - Use: "plugin", - Short: "Manage kn plugins", + Use: "plugin", + Short: "Manage kn plugins", + Aliases: []string{"plugins"}, Long: `Manage kn plugins Plugins provide extended functionality that is not part of the core kn command-line distribution. diff --git a/pkg/kn/commands/revision/list.go b/pkg/kn/commands/revision/list.go index 5fd57e6f30..7a6864d14c 100644 --- a/pkg/kn/commands/revision/list.go +++ b/pkg/kn/commands/revision/list.go @@ -38,9 +38,10 @@ func NewRevisionListCommand(p *commands.KnParams) *cobra.Command { revisionListFlags := flags.NewListPrintFlags(RevisionListHandlers) revisionListCommand := &cobra.Command{ - Use: "list", - Short: "List revisions", - Long: "List revisions for a given service.", + Use: "list", + Short: "List revisions (alias: 'ls')", + Aliases: []string{"ls"}, + Long: "List revisions for a given service.", Example: ` # List all revisions kn revision list diff --git a/pkg/kn/commands/revision/revision.go b/pkg/kn/commands/revision/revision.go index c7c2fc32ff..6b8bac0648 100644 --- a/pkg/kn/commands/revision/revision.go +++ b/pkg/kn/commands/revision/revision.go @@ -23,8 +23,9 @@ import ( func NewRevisionCommand(p *commands.KnParams) *cobra.Command { revisionCmd := &cobra.Command{ - Use: "revision", - Short: "Manage service revisions", + Use: "revision", + Short: "Manage service revisions", + Aliases: []string{"revisions"}, } revisionCmd.AddCommand(NewRevisionListCommand(p)) revisionCmd.AddCommand(NewRevisionDescribeCommand(p)) diff --git a/pkg/kn/commands/route/list.go b/pkg/kn/commands/route/list.go index 9db68b5f88..622cd2878c 100644 --- a/pkg/kn/commands/route/list.go +++ b/pkg/kn/commands/route/list.go @@ -31,8 +31,9 @@ import ( func NewRouteListCommand(p *commands.KnParams) *cobra.Command { routeListFlags := flags.NewListPrintFlags(RouteListHandlers) routeListCommand := &cobra.Command{ - Use: "list NAME", - Short: "List routes", + Use: "list NAME", + Short: "List routes (alias: 'ls')", + Aliases: []string{"ls"}, Example: ` # List all routes kn route list diff --git a/pkg/kn/commands/route/route.go b/pkg/kn/commands/route/route.go index e1a4a24a0e..e2d855696e 100644 --- a/pkg/kn/commands/route/route.go +++ b/pkg/kn/commands/route/route.go @@ -22,8 +22,9 @@ import ( func NewRouteCommand(p *commands.KnParams) *cobra.Command { routeCmd := &cobra.Command{ - Use: "route", - Short: "List and describe service routes", + Use: "route", + Short: "List and describe service routes", + Aliases: []string{"routes"}, } routeCmd.AddCommand(NewRouteListCommand(p)) routeCmd.AddCommand(NewRouteDescribeCommand(p)) diff --git a/pkg/kn/commands/service/list.go b/pkg/kn/commands/service/list.go index ff300304a1..904d8d842e 100644 --- a/pkg/kn/commands/service/list.go +++ b/pkg/kn/commands/service/list.go @@ -31,8 +31,9 @@ func NewServiceListCommand(p *commands.KnParams) *cobra.Command { serviceListFlags := flags.NewListPrintFlags(ServiceListHandlers) serviceListCommand := &cobra.Command{ - Use: "list", - Short: "List services", + Use: "list", + Short: "List services (alias: 'ls')", + Aliases: []string{"ls"}, Example: ` # List all services kn service list diff --git a/pkg/kn/commands/service/list_mock_test.go b/pkg/kn/commands/service/list_mock_test.go index c3ec42b994..1d91cb643f 100644 --- a/pkg/kn/commands/service/list_mock_test.go +++ b/pkg/kn/commands/service/list_mock_test.go @@ -168,6 +168,19 @@ func TestServiceListWithTwoSrvNameMock(t *testing.T) { r.Validate() } +func TestServiceListWithTwoSrvNameAliasMock(t *testing.T) { + // New mock client + client := clientservingv1.NewMockKnServiceClient(t) + + // Recording: + r := client.Recorder() + + _, err := executeServiceCommand(client, "ls", "foo", "bar") + assert.ErrorContains(t, err, "'kn service list' accepts maximum 1 argument") + + r.Validate() +} + func getServiceWithNamespace(name, namespace string) *servingv1.Service { service := servingv1.Service{} service.Name = name diff --git a/pkg/kn/commands/service/list_test.go b/pkg/kn/commands/service/list_test.go index 43b46b4a4c..eedf89e03b 100644 --- a/pkg/kn/commands/service/list_test.go +++ b/pkg/kn/commands/service/list_test.go @@ -146,6 +146,24 @@ func TestServiceGetWithTwoSrvName(t *testing.T) { _, _, err := fakeServiceList([]string{"service", "list", "foo", "bar"}, serviceList) assert.ErrorContains(t, err, "'kn service list' accepts maximum 1 argument") } +func TestServiceListWithAlias(t *testing.T) { + service1 := createMockServiceWithParams("foo", "default", "http://foo.default.example.com", "foo-xyz") + service3 := createMockServiceWithParams("sss", "default", "http://sss.default.example.com", "sss-xyz") + service2 := createMockServiceWithParams("bar", "default", "http://bar.default.example.com", "bar-xyz") + serviceList := &servingv1.ServiceList{Items: []servingv1.Service{*service1, *service2, *service3}} + action, output, err := fakeServiceList([]string{"service", "ls"}, serviceList) + assert.NilError(t, err) + if action == nil { + t.Errorf("No action") + } else if !action.Matches("list", "services") { + t.Errorf("Bad action %v", action) + } + // Outputs in alphabetical order + assert.Check(t, util.ContainsAll(output[0], "NAME", "URL", "LATEST", "AGE", "CONDITIONS", "READY", "REASON")) + assert.Check(t, util.ContainsAll(output[1], "bar", "bar.default.example.com", "bar-xyz")) + assert.Check(t, util.ContainsAll(output[2], "foo", "foo.default.example.com", "foo-xyz")) + assert.Check(t, util.ContainsAll(output[3], "sss", "sss.default.example.com", "sss-xyz")) +} func createMockServiceWithParams(name, namespace, urlS string, revision string) *servingv1.Service { url, _ := apis.ParseURL(urlS) diff --git a/pkg/kn/commands/service/service.go b/pkg/kn/commands/service/service.go index 1652f65a2b..3a4a273b00 100644 --- a/pkg/kn/commands/service/service.go +++ b/pkg/kn/commands/service/service.go @@ -33,8 +33,9 @@ const ( func NewServiceCommand(p *commands.KnParams) *cobra.Command { serviceCmd := &cobra.Command{ - Use: "service", - Short: "Manage Knative services", + Use: "service", + Short: "Manage Knative services", + Aliases: []string{"ksvc", "services"}, } serviceCmd.AddCommand(NewServiceListCommand(p)) serviceCmd.AddCommand(NewServiceDescribeCommand(p)) diff --git a/pkg/kn/commands/source/list.go b/pkg/kn/commands/source/list.go index ce29e9dc14..54090ff37a 100644 --- a/pkg/kn/commands/source/list.go +++ b/pkg/kn/commands/source/list.go @@ -43,7 +43,8 @@ func NewListCommand(p *commands.KnParams) *cobra.Command { listFlags := flags.NewListPrintFlags(ListHandlers) listCommand := &cobra.Command{ Use: "list", - Short: "List event sources", + Short: "List event sources (alias: 'ls')", + Aliases: []string{"ls"}, Example: listExample, RunE: func(cmd *cobra.Command, args []string) error { namespace, err := p.GetNamespace(cmd) diff --git a/pkg/kn/commands/source/source.go b/pkg/kn/commands/source/source.go index b3e30c0fc9..e7817c7d49 100644 --- a/pkg/kn/commands/source/source.go +++ b/pkg/kn/commands/source/source.go @@ -25,8 +25,9 @@ import ( func NewSourceCommand(p *commands.KnParams) *cobra.Command { sourceCmd := &cobra.Command{ - Use: "source SOURCE|COMMAND", - Short: "Manage event sources", + Use: "source SOURCE|COMMAND", + Short: "Manage event sources", + Aliases: []string{"sources"}, } sourceCmd.AddCommand(NewListTypesCommand(p)) sourceCmd.AddCommand(NewListCommand(p)) diff --git a/pkg/kn/commands/subscription/list.go b/pkg/kn/commands/subscription/list.go index 8ee749d23d..16780b0672 100644 --- a/pkg/kn/commands/subscription/list.go +++ b/pkg/kn/commands/subscription/list.go @@ -31,7 +31,7 @@ func NewSubscriptionListCommand(p *commands.KnParams) *cobra.Command { listCommand := &cobra.Command{ Use: "list", - Short: "List subscriptions", + Short: "List subscriptions (alias: 'ls')", Example: ` # List all subscriptions kn subscription list diff --git a/pkg/kn/commands/trigger/list.go b/pkg/kn/commands/trigger/list.go index a237ffd823..4d1f1b78e5 100644 --- a/pkg/kn/commands/trigger/list.go +++ b/pkg/kn/commands/trigger/list.go @@ -28,8 +28,9 @@ func NewTriggerListCommand(p *commands.KnParams) *cobra.Command { triggerListFlags := flags.NewListPrintFlags(TriggerListHandlers) triggerListCommand := &cobra.Command{ - Use: "list", - Short: "List triggers", + Use: "list", + Short: "List triggers (alias: 'ls')", + Aliases: []string{"ls"}, Example: ` # List all triggers kn trigger list diff --git a/pkg/kn/commands/trigger/trigger.go b/pkg/kn/commands/trigger/trigger.go index 683f7de983..35aab409d3 100644 --- a/pkg/kn/commands/trigger/trigger.go +++ b/pkg/kn/commands/trigger/trigger.go @@ -28,8 +28,9 @@ const ( // NewTriggerCommand to create trigger command group func NewTriggerCommand(p *commands.KnParams) *cobra.Command { triggerCmd := &cobra.Command{ - Use: "trigger", - Short: "Manage event triggers", + Use: "trigger", + Short: "Manage event triggers", + Aliases: []string{"triggers"}, } triggerCmd.AddCommand(NewTriggerCreateCommand(p)) triggerCmd.AddCommand(NewTriggerUpdateCommand(p)) diff --git a/test/e2e/service_test.go b/test/e2e/service_test.go index db5c65320b..25f5ffe01a 100644 --- a/test/e2e/service_test.go +++ b/test/e2e/service_test.go @@ -147,7 +147,7 @@ func serviceMultipleDelete(r *test.KnRunResultCollector, existService, nonexistS } func serviceUntagTagThatDoesNotExist(r *test.KnRunResultCollector, serviceName string) { - out := r.KnTest().Kn().Run("service", "list", serviceName) + out := r.KnTest().Kn().Run("ksvc", "ls", serviceName) r.AssertNoError(out) assert.Check(r.T(), strings.Contains(out.Stdout, serviceName), "Service "+serviceName+" does not exist for test (but should exist)") @@ -156,17 +156,17 @@ func serviceUntagTagThatDoesNotExist(r *test.KnRunResultCollector, serviceName s } func serviceDeleteAll(r *test.KnRunResultCollector) { - out := r.KnTest().Kn().Run("service", "list") + out := r.KnTest().Kn().Run("services", "ls") r.AssertNoError(out) // Check if services created successfully/available for test. assert.Check(r.T(), !strings.Contains(out.Stdout, "No services found."), "No services created for kn service delete --all e2e (but should exist)") - out = r.KnTest().Kn().Run("service", "delete", "--all") + out = r.KnTest().Kn().Run("services", "delete", "--all") r.AssertNoError(out) // Check if output contains successfully deleted to verify deletion took place. assert.Check(r.T(), strings.Contains(out.Stdout, "successfully deleted"), "Failed to get 'successfully deleted' message") - out = r.KnTest().Kn().Run("service", "list") + out = r.KnTest().Kn().Run("services", "list") r.AssertNoError(out) // Check if no services present after kn service delete --all. assert.Check(r.T(), strings.Contains(out.Stdout, "No services found."), "Failed to show 'No services found' after kn service delete --all")