diff --git a/deploy/addons/assets.go b/deploy/addons/assets.go index dfbdbfa379..9031cb4a99 100644 --- a/deploy/addons/assets.go +++ b/deploy/addons/assets.go @@ -21,7 +21,6 @@ import "embed" var ( // AutoPauseAssets assets for auto-pause addon //go:embed auto-pause/*.tmpl - //go:embed auto-pause/auto-pause.service //go:embed auto-pause/unpause.lua AutoPauseAssets embed.FS diff --git a/deploy/addons/auto-pause/auto-pause.service b/deploy/addons/auto-pause/auto-pause.service.tmpl similarity index 62% rename from deploy/addons/auto-pause/auto-pause.service rename to deploy/addons/auto-pause/auto-pause.service.tmpl index 7d763ca68a..0a5260a7b4 100644 --- a/deploy/addons/auto-pause/auto-pause.service +++ b/deploy/addons/auto-pause/auto-pause.service.tmpl @@ -3,7 +3,7 @@ Description=Auto Pause Service [Service] Type=simple -ExecStart=/bin/auto-pause +ExecStart=/bin/auto-pause --container-runtime={{.ContainerRuntime}} Restart=always [Install] diff --git a/pkg/addons/addons_autopause.go b/pkg/addons/addons_autopause.go index c4ead7f7ce..ec8836fa4f 100644 --- a/pkg/addons/addons_autopause.go +++ b/pkg/addons/addons_autopause.go @@ -25,11 +25,9 @@ import ( "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/driver" - "k8s.io/minikube/pkg/minikube/exit" "k8s.io/minikube/pkg/minikube/kubeconfig" "k8s.io/minikube/pkg/minikube/mustload" "k8s.io/minikube/pkg/minikube/out" - "k8s.io/minikube/pkg/minikube/reason" "k8s.io/minikube/pkg/minikube/sysinit" ) @@ -42,9 +40,6 @@ func enableOrDisableAutoPause(cc *config.ClusterConfig, name string, val string) out.Infof("auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.") out.Infof("https://github.com/kubernetes/minikube/labels/co/auto-pause") - if cc.KubernetesConfig.ContainerRuntime != "docker" { - exit.Message(reason.Usage, `auto-pause currently is only supported on docker runtime. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601`) - } co := mustload.Running(cc.Name) if enable { if err := sysinit.New(co.CP.Runner).EnableNow("auto-pause"); err != nil { diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index 737420aff1..d249636acc 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -107,7 +107,7 @@ var Addons = map[string]*Addon{ "0640"), MustBinAsset( addons.AutoPauseAssets, - "auto-pause/auto-pause.service", + "auto-pause/auto-pause.service.tmpl", "/etc/systemd/system/", "auto-pause.service", "0640"), @@ -788,6 +788,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig, netInfo Net LoadBalancerStartIP string LoadBalancerEndIP string CustomIngressCert string + ContainerRuntime string Images map[string]string Registries map[string]string CustomRegistries map[string]string @@ -799,6 +800,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig, netInfo Net LoadBalancerStartIP: cfg.LoadBalancerStartIP, LoadBalancerEndIP: cfg.LoadBalancerEndIP, CustomIngressCert: cfg.CustomIngressCert, + ContainerRuntime: cfg.ContainerRuntime, Images: images, Registries: addon.Registries, CustomRegistries: customRegistries,