mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 06:15:45 +00:00
kubelet/apis/config/validation: improve unit tests coverage
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
This commit is contained in:
parent
c9a1a0a3b8
commit
3c57c206c0
@ -598,6 +598,27 @@ func TestValidateKubeletConfiguration(t *testing.T) {
|
|||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
errMsg: `invalid configuration: pod logs path "/🧪" mut contains ASCII characters only`,
|
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