Skip to content

Commit

Permalink
Fixed panic in kn service describe (#1529)
Browse files Browse the repository at this point in the history
* Fixed panic in kn service describe

* Added changelog entry

* Update CHANGELOG.adoc

Co-authored-by: David Simansky <[email protected]>

Co-authored-by: David Simansky <[email protected]>
  • Loading branch information
vyasgun and dsimansk authored Nov 23, 2021
1 parent 5eb1ece commit 4316d03
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 11 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
| https://github.com/knative/client/pull/[#]
////

## v1.1.0 (Unreleased)
[cols="1,10,3", options="header", width="100%"]
|===
| | Description | PR

| 🐛
| Fixed panic in kn service describe
| https://github.com/knative/client/pull/1529[#1529]

|===

## v1.0.0 (2021-11-02)
[cols="1,10,3", options="header", width="100%"]
|===
Expand Down
7 changes: 6 additions & 1 deletion pkg/kn/commands/revision/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ func WriteImage(dw printers.PrefixWriter, revision *servingv1.Revision) {
// Check if the user image is likely a more user-friendly description
pinnedDesc := "at"
userImage := clientserving.UserImage(&revision.ObjectMeta)
imageDigest := revision.Status.ContainerStatuses[0].ImageDigest

containerStatuses := revision.Status.ContainerStatuses
var imageDigest string
if len(containerStatuses) > 0 {
imageDigest = containerStatuses[0].ImageDigest
}
if userImage != "" && imageDigest != "" {
var parts []string
if strings.Contains(image, "@") {
Expand Down

0 comments on commit 4316d03

Please sign in to comment.