Move DefaultSnapshotter constants
Move the DefaultSnapshotter constants to the defaults package. Fixes issue #8226. Signed-off-by: James Jenkins <James.Jenkins@ibm.com>
This commit is contained in:
@@ -19,14 +19,14 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
containerd "github.com/containerd/containerd/v2/client"
|
||||
"github.com/containerd/containerd/v2/defaults"
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
"k8s.io/kubelet/pkg/cri/streaming"
|
||||
)
|
||||
|
||||
func DefaultImageConfig() ImageConfig {
|
||||
return ImageConfig{
|
||||
Snapshotter: containerd.DefaultSnapshotter,
|
||||
Snapshotter: defaults.DefaultSnapshotter,
|
||||
DisableSnapshotAnnotations: true,
|
||||
MaxConcurrentDownloads: 3,
|
||||
ImageDecryption: ImageDecryption{
|
||||
|
||||
@@ -20,13 +20,13 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
containerd "github.com/containerd/containerd/v2/client"
|
||||
"github.com/containerd/containerd/v2/defaults"
|
||||
"k8s.io/kubelet/pkg/cri/streaming"
|
||||
)
|
||||
|
||||
func DefaultImageConfig() ImageConfig {
|
||||
return ImageConfig{
|
||||
Snapshotter: containerd.DefaultSnapshotter,
|
||||
Snapshotter: defaults.DefaultSnapshotter,
|
||||
StatsCollectPeriod: 10,
|
||||
MaxConcurrentDownloads: 3,
|
||||
ImageDecryption: ImageDecryption{
|
||||
|
||||
@@ -20,8 +20,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
containerd "github.com/containerd/containerd/v2/client"
|
||||
"github.com/containerd/containerd/v2/content"
|
||||
"github.com/containerd/containerd/v2/defaults"
|
||||
"github.com/containerd/containerd/v2/errdefs"
|
||||
"github.com/containerd/containerd/v2/images"
|
||||
"github.com/containerd/containerd/v2/pkg/transfer"
|
||||
@@ -286,7 +286,7 @@ func getSupportedPlatform(uc transfer.UnpackConfiguration, supportedPlatforms []
|
||||
// Assume sp.SnapshotterKey is not empty
|
||||
if uc.Snapshotter == sp.SnapshotterKey {
|
||||
return true, sp
|
||||
} else if uc.Snapshotter == "" && sp.SnapshotterKey == containerd.DefaultSnapshotter {
|
||||
} else if uc.Snapshotter == "" && sp.SnapshotterKey == defaults.DefaultSnapshotter {
|
||||
return true, sp
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package local
|
||||
import (
|
||||
"testing"
|
||||
|
||||
containerd "github.com/containerd/containerd/v2/client"
|
||||
"github.com/containerd/containerd/v2/defaults"
|
||||
"github.com/containerd/containerd/v2/pkg/transfer"
|
||||
"github.com/containerd/containerd/v2/pkg/unpack"
|
||||
"github.com/containerd/containerd/v2/platforms"
|
||||
@@ -45,7 +45,7 @@ func TestGetSupportedPlatform(t *testing.T) {
|
||||
},
|
||||
{
|
||||
Platform: platforms.DefaultStrict(),
|
||||
SnapshotterKey: containerd.DefaultSnapshotter,
|
||||
SnapshotterKey: defaults.DefaultSnapshotter,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ func TestGetSupportedPlatform(t *testing.T) {
|
||||
Match: true,
|
||||
ExpectedPlatform: transfer.UnpackConfiguration{
|
||||
Platform: platforms.DefaultSpec(),
|
||||
Snapshotter: containerd.DefaultSnapshotter,
|
||||
Snapshotter: defaults.DefaultSnapshotter,
|
||||
},
|
||||
},
|
||||
} {
|
||||
|
||||
Reference in New Issue
Block a user