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:
Kubernetes Prow Robot 2024-10-17 17:17:10 +01:00 committed by GitHub
commit e6099268e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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",
},
}