@@ -26,10 +26,11 @@ import (
26
26
"github.com/stretchr/testify/assert"
27
27
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
28
28
29
+ "github.com/containerd/platforms"
30
+
29
31
"github.com/containerd/containerd/v2/internal/cri/annotations"
30
32
criconfig "github.com/containerd/containerd/v2/internal/cri/config"
31
33
"github.com/containerd/containerd/v2/internal/cri/labels"
32
- "github.com/containerd/platforms"
33
34
)
34
35
35
36
func TestParseAuth (t * testing.T ) {
@@ -350,32 +351,32 @@ func TestDefaultScheme(t *testing.T) {
350
351
}
351
352
352
353
// 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
+ }
379
380
380
381
func TestSnapshotterFromPodSandboxConfig (t * testing.T ) {
381
382
defaultSnapshotter := "native"
0 commit comments