Skip to content

Commit

Permalink
Remove DeprecatedImageDigest field
Browse files Browse the repository at this point in the history
  • Loading branch information
dsimansk committed Sep 17, 2021
1 parent 82a21a5 commit 35a9de7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/kn/commands/revision/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ 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.DeprecatedImageDigest
imageDigest := revision.Status.ContainerStatuses[0].ImageDigest
if userImage != "" && imageDigest != "" {
var parts []string
if strings.Contains(image, "@") {
Expand Down
8 changes: 5 additions & 3 deletions pkg/kn/commands/revision/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ func createTestRevision(revision string, gen int64, replicas *int32) servingv1.R
},
},
Status: servingv1.RevisionStatus{
ActualReplicas: replicas,
DesiredReplicas: replicas,
DeprecatedImageDigest: "gcr.io/test/image@" + imageDigest,
ActualReplicas: replicas,
DesiredReplicas: replicas,
ContainerStatuses: []servingv1.ContainerStatus{
{Name: "gcr.io/test/image", ImageDigest: imageDigest},
},
Status: duckv1.Status{
Conditions: goodConditions(),
},
Expand Down
12 changes: 8 additions & 4 deletions pkg/kn/commands/service/describe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ func TestServiceDescribeUserImageVsImage(t *testing.T) {
rev3.Annotations[client_serving.UserImageAnnotationKey] = "gcr.io/test/image:latest"
rev3.Spec.Containers[0].Image = "gcr.io/a/b"
// rev4 is without the annotation at all and no hash
rev4.Status.DeprecatedImageDigest = ""
rev4.Status.ContainerStatuses = []servingv1.ContainerStatus{
{Name: "gcr.io/x/y", ImageDigest: ""},
}
rev4.Spec.Containers[0].Image = "gcr.io/x/y"

// Fetch the revisions
Expand Down Expand Up @@ -763,9 +765,11 @@ func createTestRevision(revision string, gen int64, conditions duckv1.Conditions
},
},
Status: servingv1.RevisionStatus{
ActualReplicas: ptr.Int32(0),
DesiredReplicas: ptr.Int32(1),
DeprecatedImageDigest: "gcr.io/test/image@" + imageDigest,
ActualReplicas: ptr.Int32(0),
DesiredReplicas: ptr.Int32(1),
ContainerStatuses: []servingv1.ContainerStatus{
{Name: "gcr.io/test/image", ImageDigest: imageDigest},
},
Status: duckv1.Status{
Conditions: conditions,
},
Expand Down
2 changes: 0 additions & 2 deletions pkg/kn/commands/service/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ func fakeServiceUpdate(original *servingv1.Service, args []string) (
rev.Status.ContainerStatuses = []servingv1.ContainerStatus{
{ImageDigest: exampleImageByDigest, Name: "user-container"},
}

rev.Status.DeprecatedImageDigest = exampleImageByDigest
return true, rev, nil
})

Expand Down

0 comments on commit 35a9de7

Please sign in to comment.