Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
| List revisions sorted by configuration generation
| https://github.com/knative/client/pull/332[#332]

| 🎁
| `kn service describe`
| https://github.com/knative/client/pull/252[#252]

|===

## v0.2.0 (2019-07-10)
Expand Down
2 changes: 1 addition & 1 deletion docs/cmd/kn_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ kn service [flags]
* [kn](kn.md) - Knative client
* [kn service create](kn_service_create.md) - Create a service.
* [kn service delete](kn_service_delete.md) - Delete a service.
* [kn service describe](kn_service_describe.md) - Describe available services.
* [kn service describe](kn_service_describe.md) - Show details for a given service
* [kn service list](kn_service_list.md) - List available services.
* [kn service update](kn_service_update.md) - Update a service.

7 changes: 4 additions & 3 deletions docs/cmd/kn_service_describe.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## kn service describe

Describe available services.
Show details for a given service

### Synopsis

Describe available services.
Show details for a given service

```
kn service describe NAME [flags]
Expand All @@ -16,8 +16,9 @@ kn service describe NAME [flags]
--allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true)
-h, --help help for describe
-n, --namespace string List the requested object(s) in given namespace.
-o, --output string Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file. (default "yaml")
-o, --output string Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file.
--template string Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
-v, --verbose More output.
```

### Options inherited from parent commands
Expand Down
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ require (
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gogo/protobuf v1.2.1 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/protobuf v1.3.1 // indirect
github.com/golang/protobuf v1.3.2 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/go-cmp v0.3.0 // indirect
github.com/google/go-containerregistry v0.0.0-20190623150931-ca8b66cb1b79 // indirect
github.com/google/gofuzz v1.0.0 // indirect
github.com/google/go-containerregistry v0.0.0-20190723205234-74f764b9c575 // indirect
github.com/googleapis/gnostic v0.3.0 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.6 // indirect
github.com/json-iterator/go v1.1.7 // indirect
github.com/knative/build v0.7.0 // indirect
github.com/knative/pkg v0.0.0-20190617142447-13b093adc272
github.com/knative/serving v0.6.0
Expand All @@ -29,7 +28,7 @@ require (
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.3.1
golang.org/x/net v0.0.0-20190628185345-da137c7871d7 // indirect
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand All @@ -38,7 +37,7 @@ require (
k8s.io/apimachinery v0.0.0-20190221084156-01f179d85dbc
k8s.io/cli-runtime v0.0.0-20190325194458-f2b4781c3ae1
k8s.io/client-go v0.0.0-20190226174127-78295b709ec6
k8s.io/kube-openapi v0.0.0-20190603182131-db7b694dc208 // indirect
k8s.io/kube-openapi v0.0.0-20190722073852-5e22f3d471e6 // indirect
knative.dev/test-infra v0.0.0-20190730202142-17f2331e80ad
sigs.k8s.io/yaml v1.1.0
)
253 changes: 13 additions & 240 deletions go.sum

Large diffs are not rendered by default.

19 changes: 1 addition & 18 deletions pkg/kn/commands/service/service_create_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package service

import (
"bytes"
"testing"

"github.com/knative/pkg/apis"
Expand All @@ -24,7 +23,6 @@ import (

"github.com/knative/serving/pkg/apis/serving/v1alpha1"

"github.com/knative/client/pkg/kn/commands"
knclient "github.com/knative/client/pkg/serving/v1alpha1"

"github.com/knative/client/pkg/util"
Expand All @@ -47,7 +45,7 @@ func TestServiceCreateImageMock(t *testing.T) {
r.GetService("foo", getServiceWithUrl("foo", "http://foo.example.com"), nil)

// Testing:
output, err := executeCommand(client, "create", "foo", "--image", "gcr.io/foo/bar:baz")
output, err := executeServiceCommand(client, "create", "foo", "--image", "gcr.io/foo/bar:baz")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

assert.NilError(t, err)
assert.Assert(t, util.ContainsAll(output, "created", "foo", "http://foo.example.com", "Waiting"))

Expand All @@ -62,18 +60,3 @@ func getServiceWithUrl(name string, urlName string) *v1alpha1.Service {
service.Name = name
return &service
}

func executeCommand(client knclient.KnClient, args ...string) (string, error) {
knParams := &commands.KnParams{}

output := new(bytes.Buffer)
knParams.Output = output
knParams.NewClient = func(namespace string) (knclient.KnClient, error) {
return client, nil
}
cmd := NewServiceCommand(knParams)
cmd.SetArgs(args)
cmd.SetOutput(output)
err := cmd.Execute()
return output.String(), err
}
Loading