@@ -25,8 +25,6 @@ import (
25
25
26
26
"gotest.tools/v3/assert"
27
27
28
- "github.com/containerd/platforms"
29
-
30
28
"github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers"
31
29
"github.com/containerd/nerdctl/v2/pkg/testutil"
32
30
)
@@ -56,34 +54,6 @@ CMD ["echo", "nerdctl-build-test-string"]
56
54
base .Cmd ("run" , "--rm" , ignoredImageNamed ).AssertFail ()
57
55
}
58
56
59
- func TestBuildIsShareableForCompatiblePlatform (t * testing.T ) {
60
- testutil .RequiresBuild (t )
61
- testutil .RegisterBuildCacheCleanup (t )
62
- base := testutil .NewBase (t )
63
- imageName := testutil .Identifier (t )
64
- defer base .Cmd ("rmi" , imageName ).Run ()
65
-
66
- dockerfile := fmt .Sprintf (`FROM %s
67
- CMD ["echo", "nerdctl-build-test-string"]
68
- ` , testutil .CommonImage )
69
-
70
- buildCtx := helpers .CreateBuildContext (t , dockerfile )
71
-
72
- base .Cmd ("build" , buildCtx , "-t" , imageName ).AssertErrNotContains ("tarball" )
73
-
74
- d := platforms .DefaultSpec ()
75
- platformConfig := fmt .Sprintf ("%s/%s" , d .OS , d .Architecture )
76
- base .Cmd ("build" , buildCtx , "-t" , imageName , "--platform" , platformConfig ).AssertOK ()
77
- base .Cmd ("build" , buildCtx , "-t" , imageName , "--platform" , platformConfig , "--progress" , "plain" ).AssertErrNotContains ("tarball" )
78
-
79
- n := platforms.Platform {OS : "linux" , Architecture : "arm" , Variant : "" }
80
- if n .OS != d .OS && n .Architecture != d .Architecture {
81
- notCompatiblePlatformConfig := fmt .Sprintf ("%s/%s" , n .OS , n .Architecture )
82
- base .Cmd ("build" , buildCtx , "-t" , imageName , "--platform" , notCompatiblePlatformConfig ).AssertOK ()
83
- base .Cmd ("build" , buildCtx , "-t" , imageName , "--platform" , notCompatiblePlatformConfig , "--progress" , "plain" ).AssertErrContains ("tarball" )
84
- }
85
- }
86
-
87
57
// TestBuildBaseImage tests if an image can be built on the previously built image.
88
58
// This isn't currently supported by nerdctl with BuildKit OCI worker.
89
59
func TestBuildBaseImage (t * testing.T ) {
0 commit comments