@@ -29,15 +29,17 @@ import (
2929 "testing"
3030 "time"
3131
32- cri "github.com/containerd/containerd/integration/cri-api/pkg/apis"
3332 "github.com/containerd/nri/pkg/api"
3433 "github.com/containerd/nri/pkg/stub"
3534 "github.com/opencontainers/selinux/go-selinux"
3635 runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
3736
38- "github.com/containerd/containerd/integration/images"
37+ cri "github.com/containerd/containerd/integration/cri-api/pkg/apis"
38+
3939 "github.com/stretchr/testify/assert"
4040 "github.com/stretchr/testify/require"
41+
42+ "github.com/containerd/containerd/integration/images"
4143)
4244
4345const (
@@ -808,11 +810,11 @@ func (m *mockPlugin) Log(format string, args ...interface{}) {
808810 m .logf (fmt .Sprintf ("[plugin:%s-%s] " , m .idx , m .name )+ format , args ... )
809811}
810812
811- func (m * mockPlugin ) Configure (cfg string ) (stub.EventMask , error ) {
813+ func (m * mockPlugin ) Configure (ctx context. Context , cfg string ) (stub.EventMask , error ) {
812814 return m .mask , nil
813815}
814816
815- func (m * mockPlugin ) Synchronize (pods []* api.PodSandbox , ctrs []* api.Container ) ([]* api.ContainerUpdate , error ) {
817+ func (m * mockPlugin ) Synchronize (ctx context. Context , pods []* api.PodSandbox , ctrs []* api.Container ) ([]* api.ContainerUpdate , error ) {
816818 m .Log ("Synchronize" )
817819 for _ , pod := range pods {
818820 m .Log (" - pod %s" , pod .Id )
@@ -828,11 +830,11 @@ func (m *mockPlugin) Synchronize(pods []*api.PodSandbox, ctrs []*api.Container)
828830 return m .synchronize (m , pods , ctrs )
829831}
830832
831- func (m * mockPlugin ) Shutdown () {
833+ func (m * mockPlugin ) Shutdown (ctx context. Context ) {
832834 m .Log ("Shutdown" )
833835}
834836
835- func (m * mockPlugin ) RunPodSandbox (pod * api.PodSandbox ) error {
837+ func (m * mockPlugin ) RunPodSandbox (ctx context. Context , pod * api.PodSandbox ) error {
836838 if ! m .inNamespace (pod .Namespace ) {
837839 return nil
838840 }
@@ -843,7 +845,7 @@ func (m *mockPlugin) RunPodSandbox(pod *api.PodSandbox) error {
843845 return nil
844846}
845847
846- func (m * mockPlugin ) StopPodSandbox (pod * api.PodSandbox ) error {
848+ func (m * mockPlugin ) StopPodSandbox (ctx context. Context , pod * api.PodSandbox ) error {
847849 if ! m .inNamespace (pod .Namespace ) {
848850 return nil
849851 }
@@ -854,7 +856,7 @@ func (m *mockPlugin) StopPodSandbox(pod *api.PodSandbox) error {
854856 return nil
855857}
856858
857- func (m * mockPlugin ) RemovePodSandbox (pod * api.PodSandbox ) error {
859+ func (m * mockPlugin ) RemovePodSandbox (ctx context. Context , pod * api.PodSandbox ) error {
858860 if ! m .inNamespace (pod .Namespace ) {
859861 return nil
860862 }
@@ -865,7 +867,7 @@ func (m *mockPlugin) RemovePodSandbox(pod *api.PodSandbox) error {
865867 return nil
866868}
867869
868- func (m * mockPlugin ) CreateContainer (pod * api.PodSandbox , ctr * api.Container ) (* api.ContainerAdjustment , []* api.ContainerUpdate , error ) {
870+ func (m * mockPlugin ) CreateContainer (ctx context. Context , pod * api.PodSandbox , ctr * api.Container ) (* api.ContainerAdjustment , []* api.ContainerUpdate , error ) {
869871 if ! m .inNamespace (pod .Namespace ) {
870872 return nil , nil , nil
871873 }
@@ -878,7 +880,7 @@ func (m *mockPlugin) CreateContainer(pod *api.PodSandbox, ctr *api.Container) (*
878880 return m .createContainer (m , pod , ctr )
879881}
880882
881- func (m * mockPlugin ) PostCreateContainer (pod * api.PodSandbox , ctr * api.Container ) error {
883+ func (m * mockPlugin ) PostCreateContainer (ctx context. Context , pod * api.PodSandbox , ctr * api.Container ) error {
882884 if ! m .inNamespace (pod .Namespace ) {
883885 return nil
884886 }
@@ -891,7 +893,7 @@ func (m *mockPlugin) PostCreateContainer(pod *api.PodSandbox, ctr *api.Container
891893 return nil
892894}
893895
894- func (m * mockPlugin ) StartContainer (pod * api.PodSandbox , ctr * api.Container ) error {
896+ func (m * mockPlugin ) StartContainer (ctx context. Context , pod * api.PodSandbox , ctr * api.Container ) error {
895897 if ! m .inNamespace (pod .Namespace ) {
896898 return nil
897899 }
@@ -903,7 +905,7 @@ func (m *mockPlugin) StartContainer(pod *api.PodSandbox, ctr *api.Container) err
903905 return nil
904906}
905907
906- func (m * mockPlugin ) PostStartContainer (pod * api.PodSandbox , ctr * api.Container ) error {
908+ func (m * mockPlugin ) PostStartContainer (ctx context. Context , pod * api.PodSandbox , ctr * api.Container ) error {
907909 if ! m .inNamespace (pod .Namespace ) {
908910 return nil
909911 }
@@ -915,7 +917,7 @@ func (m *mockPlugin) PostStartContainer(pod *api.PodSandbox, ctr *api.Container)
915917 return nil
916918}
917919
918- func (m * mockPlugin ) UpdateContainer (pod * api.PodSandbox , ctr * api.Container ) ([]* api.ContainerUpdate , error ) {
920+ func (m * mockPlugin ) UpdateContainer (ctx context. Context , pod * api.PodSandbox , ctr * api.Container ) ([]* api.ContainerUpdate , error ) {
919921 if ! m .inNamespace (pod .Namespace ) {
920922 return nil , nil
921923 }
@@ -927,7 +929,7 @@ func (m *mockPlugin) UpdateContainer(pod *api.PodSandbox, ctr *api.Container) ([
927929 return m .updateContainer (m , pod , ctr )
928930}
929931
930- func (m * mockPlugin ) PostUpdateContainer (pod * api.PodSandbox , ctr * api.Container ) error {
932+ func (m * mockPlugin ) PostUpdateContainer (ctx context. Context , pod * api.PodSandbox , ctr * api.Container ) error {
931933 if ! m .inNamespace (pod .Namespace ) {
932934 return nil
933935 }
@@ -940,7 +942,7 @@ func (m *mockPlugin) PostUpdateContainer(pod *api.PodSandbox, ctr *api.Container
940942 return nil
941943}
942944
943- func (m * mockPlugin ) StopContainer (pod * api.PodSandbox , ctr * api.Container ) ([]* api.ContainerUpdate , error ) {
945+ func (m * mockPlugin ) StopContainer (ctx context. Context , pod * api.PodSandbox , ctr * api.Container ) ([]* api.ContainerUpdate , error ) {
944946 if ! m .inNamespace (pod .Namespace ) {
945947 return nil , nil
946948 }
@@ -952,7 +954,7 @@ func (m *mockPlugin) StopContainer(pod *api.PodSandbox, ctr *api.Container) ([]*
952954 return m .stopContainer (m , pod , ctr )
953955}
954956
955- func (m * mockPlugin ) RemoveContainer (pod * api.PodSandbox , ctr * api.Container ) error {
957+ func (m * mockPlugin ) RemoveContainer (ctx context. Context , pod * api.PodSandbox , ctr * api.Container ) error {
956958 if ! m .inNamespace (pod .Namespace ) {
957959 return nil
958960 }
0 commit comments