mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Only container-runtime-endpoint wants RuntimeSocket path as URI
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
06fda7accf
commit
8011697175
@ -479,7 +479,7 @@ func get(envInfo *cmds.Agent, proxy proxy.Proxy) (*config.Node, error) {
|
||||
}
|
||||
|
||||
if !nodeConfig.Docker && nodeConfig.ContainerRuntimeEndpoint == "" {
|
||||
nodeConfig.AgentConfig.RuntimeSocket = "unix://" + nodeConfig.Containerd.Address
|
||||
nodeConfig.AgentConfig.RuntimeSocket = nodeConfig.Containerd.Address
|
||||
} else {
|
||||
nodeConfig.AgentConfig.RuntimeSocket = nodeConfig.ContainerRuntimeEndpoint
|
||||
nodeConfig.AgentConfig.CNIPlugin = true
|
||||
|
@ -21,6 +21,8 @@ import (
|
||||
_ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration
|
||||
)
|
||||
|
||||
const unixPrefix = "unix://"
|
||||
|
||||
func Agent(config *config.Agent) error {
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
|
||||
@ -97,9 +99,13 @@ func startKubelet(cfg *config.Agent) error {
|
||||
}
|
||||
if cfg.RuntimeSocket != "" {
|
||||
argsMap["container-runtime"] = "remote"
|
||||
argsMap["container-runtime-endpoint"] = cfg.RuntimeSocket
|
||||
argsMap["containerd"] = cfg.RuntimeSocket
|
||||
argsMap["serialize-image-pulls"] = "false"
|
||||
if strings.HasPrefix(argsMap["container-runtime-endpoint"], unixPrefix) {
|
||||
argsMap["container-runtime-endpoint"] = cfg.RuntimeSocket
|
||||
} else {
|
||||
argsMap["container-runtime-endpoint"] = unixPrefix + cfg.RuntimeSocket
|
||||
}
|
||||
} else if cfg.PauseImage != "" {
|
||||
argsMap["pod-infra-container-image"] = cfg.PauseImage
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user