@@ -18,7 +18,6 @@ import (
1818 "github.com/Microsoft/hcsshim/internal/hcsoci"
1919 "github.com/Microsoft/hcsshim/pkg/ctrdtaskapi"
2020 task "github.com/containerd/containerd/api/runtime/task/v2"
21- "github.com/containerd/containerd/protobuf"
2221 "github.com/containerd/errdefs"
2322 typeurl "github.com/containerd/typeurl/v2"
2423 "github.com/opencontainers/runtime-spec/specs-go"
@@ -527,12 +526,18 @@ func Test_TaskShim_updateInternal_Success(t *testing.T) {
527526 },
528527 }
529528
530- any , err := typeurl .MarshalAny (resources )
529+ resourcesTypeURL , _ := typeurl .MarshalAny (resources )
530+ any , err := typeurl .MarshalAny (resourcesTypeURL )
531531 if err != nil {
532532 t .Fatal (err )
533533 }
534534
535- resp , err := s .updateInternal (context .TODO (), & task.UpdateTaskRequest {ID : t1 .ID (), Resources : protobuf .FromAny (any )})
535+ resp , err := s .updateInternal (
536+ context .TODO (),
537+ & task.UpdateTaskRequest {
538+ ID : t1 .ID (),
539+ Resources : typeurl .MarshalProto (any ),
540+ })
536541 if err != nil {
537542 t .Fatalf ("should not have failed with error, got: %v" , err )
538543 }
@@ -563,7 +568,12 @@ func Test_TaskShimWindowsMount_updateInternal_Success(t *testing.T) {
563568 t .Fatal (err )
564569 }
565570
566- resp , err := s .updateInternal (context .TODO (), & task.UpdateTaskRequest {ID : t1 .ID (), Resources : protobuf .FromAny (any )})
571+ resp , err := s .updateInternal (
572+ context .TODO (),
573+ & task.UpdateTaskRequest {
574+ ID : t1 .ID (),
575+ Resources : typeurl .MarshalProto (any ),
576+ })
567577 if err != nil {
568578 t .Fatalf ("should not have failed update mount with error, got: %v" , err )
569579 }
@@ -593,7 +603,12 @@ func Test_TaskShimWindowsMount_updateInternal_Error(t *testing.T) {
593603 t .Fatal (err )
594604 }
595605
596- resp , err := s .updateInternal (context .TODO (), & task.UpdateTaskRequest {ID : t1 .ID (), Resources : protobuf .FromAny (any )})
606+ resp , err := s .updateInternal (
607+ context .TODO (),
608+ & task.UpdateTaskRequest {
609+ ID : t1 .ID (),
610+ Resources : typeurl .MarshalProto (any ),
611+ })
597612 if err == nil {
598613 t .Fatalf ("should have failed update mount with error" )
599614 }
@@ -612,7 +627,10 @@ func Test_TaskShim_updateInternal_Error(t *testing.T) {
612627 t .Fatal (err )
613628 }
614629
615- _ , err = s .updateInternal (context .TODO (), & task.UpdateTaskRequest {ID : t1 .ID (), Resources : protobuf .FromAny (any )})
630+ _ , err = s .updateInternal (context .TODO (), & task.UpdateTaskRequest {
631+ ID : t1 .ID (),
632+ Resources : typeurl .MarshalProto (any ),
633+ })
616634 if err == nil {
617635 t .Fatal ("expected to get an error for incorrect resource's type" )
618636 }
0 commit comments