File tree Expand file tree Collapse file tree 3 files changed +18
-19
lines changed Expand file tree Collapse file tree 3 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ var Addons = []*Addon{
71
71
{
72
72
name : "gvisor" ,
73
73
set : SetBool ,
74
- validations : []setFn {SupportsAmd64 , IsRuntimeContainerd },
74
+ validations : []setFn {IsRuntimeContainerd },
75
75
callbacks : []setFn {EnableOrDisableAddon , verifyAddonStatus },
76
76
},
77
77
{
Original file line number Diff line number Diff line change @@ -18,14 +18,12 @@ package addons
18
18
19
19
import (
20
20
"fmt"
21
- "runtime"
22
21
"strconv"
23
22
24
23
"github.com/spf13/viper"
25
24
"k8s.io/minikube/pkg/minikube/assets"
26
25
"k8s.io/minikube/pkg/minikube/config"
27
26
"k8s.io/minikube/pkg/minikube/cruntime"
28
- "k8s.io/minikube/pkg/minikube/driver"
29
27
"k8s.io/minikube/pkg/minikube/out"
30
28
)
31
29
@@ -95,15 +93,3 @@ func contains(slice []string, val string) bool {
95
93
}
96
94
return false
97
95
}
98
-
99
- // SupportsAmd64 ensures that the cluster supports running amd64 images
100
- func SupportsAmd64 (cc * config.ClusterConfig , name , _ string ) error {
101
- // KIC can run amd64 images on a non-amd64 environment
102
- if driver .IsKIC (cc .Driver ) {
103
- return nil
104
- }
105
- if runtime .GOARCH == "amd64" {
106
- return nil
107
- }
108
- return fmt .Errorf ("the %q addon requires a cluster that supports running amd64 images" , name )
109
- }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import (
25
25
"os/exec"
26
26
"os/signal"
27
27
"path/filepath"
28
+ "runtime"
28
29
"syscall"
29
30
30
31
"github.com/docker/machine/libmachine/mcnutils"
@@ -36,17 +37,29 @@ const (
36
37
containerdConfigPath = "/etc/containerd/config.toml"
37
38
containerdConfigBackupPath = "/tmp/containerd-config.toml.bak"
38
39
39
- releaseURL = "https://storage.googleapis.com/gvisor/releases/release/latest/x86_64/"
40
- shimURL = releaseURL + "containerd-shim-runsc-v1"
41
- gvisorURL = releaseURL + "runsc"
42
-
43
40
configFragment = `
44
41
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runsc]
45
42
runtime_type = "io.containerd.runsc.v1"
46
43
pod_annotations = [ "dev.gvisor.*" ]
47
44
`
48
45
)
49
46
47
+ var (
48
+ shimURL = releaseURL () + "containerd-shim-runsc-v1"
49
+ gvisorURL = releaseURL () + "runsc"
50
+ )
51
+
52
+ func releaseURL () string {
53
+ arch := runtime .GOARCH
54
+ switch arch {
55
+ case "amd64" :
56
+ arch = "x86_64"
57
+ case "arm64" :
58
+ arch = "aarch64"
59
+ }
60
+ return fmt .Sprintf ("https://storage.googleapis.com/gvisor/releases/release/latest/%s/" , arch )
61
+ }
62
+
50
63
// Enable follows these steps for enabling gvisor in minikube:
51
64
// 1. creates necessary directories for storing binaries and runsc logs
52
65
// 2. downloads runsc and gvisor-containerd-shim
You can’t perform that action at this time.
0 commit comments