remove a flag check that was introduced in #112542; address several comments

Signed-off-by: Paco Xu <paco.xu@daocloud.io>
This commit is contained in:
Paco Xu
2022-10-12 02:09:19 +08:00
parent 214a0ee7b8
commit f28f40e521
14 changed files with 31 additions and 23 deletions

View File

@@ -189,13 +189,6 @@ func ValidateKubeletFlags(f *KubeletFlags) error {
return fmt.Errorf("unsupported CRI runtime: %q, only %q is currently supported", f.ContainerRuntime, kubetypes.RemoteContainerRuntime)
}
// Note: maybe we can test it for being a valid socket address as an additional improvement.
// The only problem with it will be that some setups may not specify 'unix://' prefix.
// So just check empty for back compat.
if f.RemoteRuntimeEndpoint == "" {
return fmt.Errorf("the container runtime endpoint address was not specified or empty, use --container-runtime-endpoint to set")
}
return nil
}

View File

@@ -183,8 +183,7 @@ func TestValidateKubeletFlags(t *testing.T) {
ContainerRuntimeOptions: config.ContainerRuntimeOptions{
ContainerRuntime: kubetypes.RemoteContainerRuntime,
},
RemoteRuntimeEndpoint: "unix:///run/containerd/containerd.sock",
NodeLabels: tt.labels,
NodeLabels: tt.labels,
})
if tt.error && err == nil {