@@ -26,10 +26,11 @@ import (
2626 "github.com/stretchr/testify/assert"
2727 runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
2828
29+ "github.com/containerd/platforms"
30+
2931 "github.com/containerd/containerd/v2/internal/cri/annotations"
3032 criconfig "github.com/containerd/containerd/v2/internal/cri/config"
3133 "github.com/containerd/containerd/v2/internal/cri/labels"
32- "github.com/containerd/platforms"
3334)
3435
3536func TestParseAuth (t * testing.T ) {
@@ -350,32 +351,32 @@ func TestDefaultScheme(t *testing.T) {
350351}
351352
352353// Temporarily remove for v2 upgrade
353- // func TestEncryptedImagePullOpts(t *testing.T) {
354- // for _, test := range []struct {
355- // desc string
356- // keyModel string
357- // expectedOpts int
358- // }{
359- // {
360- // desc: "node key model should return one unpack opt",
361- // keyModel: criconfig.KeyModelNode,
362- // expectedOpts: 1,
363- // },
364- // {
365- // desc: "no key model selected should default to node key model",
366- // keyModel: "",
367- // expectedOpts: 0,
368- // },
369- // } {
370- // test := test
371- // t.Run(test.desc, func(t *testing.T) {
372- // c, _ := newTestCRIService()
373- // c.config.ImageDecryption.KeyModel = test.keyModel
374- // got := len(c.encryptedImagesPullOpts())
375- // assert.Equal(t, test.expectedOpts, got)
376- // })
377- // }
378- // }
354+ func TestEncryptedImagePullOpts (t * testing.T ) {
355+ for _ , test := range []struct {
356+ desc string
357+ keyModel string
358+ expectedOpts int
359+ }{
360+ {
361+ desc : "node key model should return one unpack opt" ,
362+ keyModel : criconfig .KeyModelNode ,
363+ expectedOpts : 1 ,
364+ },
365+ {
366+ desc : "no key model selected should default to node key model" ,
367+ keyModel : "" ,
368+ expectedOpts : 0 ,
369+ },
370+ } {
371+ test := test
372+ t .Run (test .desc , func (t * testing.T ) {
373+ c , _ := newTestCRIService ()
374+ c .config .ImageDecryption .KeyModel = test .keyModel
375+ got := len (c .encryptedImagesPullOpts ())
376+ assert .Equal (t , test .expectedOpts , got )
377+ })
378+ }
379+ }
379380
380381func TestSnapshotterFromPodSandboxConfig (t * testing.T ) {
381382 defaultSnapshotter := "native"
0 commit comments