diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 25b5da69f3..5c5e884456 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -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%"] |=== diff --git a/pkg/kn/commands/revision/describe.go b/pkg/kn/commands/revision/describe.go index 346ad7eac1..599dca1256 100644 --- a/pkg/kn/commands/revision/describe.go +++ b/pkg/kn/commands/revision/describe.go @@ -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, "@") {