mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Merge pull request #125080 from TommyStarK/unit-tests/kubelet-apis-config-validation
kubelet/apis/config/validation: improve unit test coverage
This commit is contained in:
commit
e6099268e3
@ -635,6 +635,27 @@ func TestValidateKubeletConfiguration(t *testing.T) {
|
||||
return config
|
||||
},
|
||||
errMsg: `invalid configuration: pod logs path "/🧪" mut contains ASCII characters only`,
|
||||
}, {
|
||||
name: "invalid ContainerRuntimeEndpoint",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
conf.ContainerRuntimeEndpoint = ""
|
||||
return conf
|
||||
},
|
||||
errMsg: "invalid configuration: the containerRuntimeEndpoint was not specified or empty",
|
||||
}, {
|
||||
name: "invalid Logging configuration",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
conf.Logging.Format = "invalid"
|
||||
return conf
|
||||
},
|
||||
errMsg: "logging.format: Invalid value: \"invalid\": Unsupported log format",
|
||||
}, {
|
||||
name: "invalid FeatureGate",
|
||||
configure: func(conf *kubeletconfig.KubeletConfiguration) *kubeletconfig.KubeletConfiguration {
|
||||
conf.FeatureGates["invalid"] = true
|
||||
return conf
|
||||
},
|
||||
errMsg: "unrecognized feature gate: invalid",
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user