mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #39302 from bruceauyeung/k8s-branch-fix-nil-check-and-typos
Automatic merge from submit-queue (batch tested with PRs 40132, 39302, 40194, 40619, 40601) fix nil check and typos **What this PR does / why we need it**: 1. nil error should be checked before defer statement. 2. fix some typos. Signed-off-by: bruceauyeung ouyang.qinhua@zte.com.cn
This commit is contained in:
commit
a812493aae
@ -157,10 +157,10 @@ func TestConfigDirCleaner(t *testing.T) {
|
||||
for _, createFile := range test.setupFiles {
|
||||
fullPath := filepath.Join(tmpDir, createFile)
|
||||
f, err := os.Create(fullPath)
|
||||
defer f.Close()
|
||||
if err != nil {
|
||||
t.Errorf("Unable to create test file: %s", err)
|
||||
}
|
||||
defer f.Close()
|
||||
}
|
||||
|
||||
resetConfigDir(tmpDir, filepath.Join(tmpDir, "pki"))
|
||||
|
@ -360,7 +360,7 @@ func getAPIServerCommand(cfg *kubeadmapi.MasterConfiguration, selfHosted bool) [
|
||||
command = append(command, "--kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname")
|
||||
}
|
||||
|
||||
// This is a critical "bugfix". Any version above this is vulnarable unless a RBAC/ABAC-authorizer is provided (which kubeadm doesn't for the time being)
|
||||
// This is a critical "bugfix". Any version above this is vulnerable unless a RBAC/ABAC-authorizer is provided (which kubeadm doesn't for the time being)
|
||||
if err == nil && k8sVersion.GTE(anonAuthDisableAPIServerMinVersion) {
|
||||
command = append(command, "--anonymous-auth=false")
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ func TestInvalidVersion(t *testing.T) {
|
||||
ver, err := KubernetesReleaseVersion(s)
|
||||
t.Log("Invalid: ", s, ver, err)
|
||||
if err == nil {
|
||||
t.Errorf("KubernetesReleaseVersion error expected for version %q, but returned succesfully", s)
|
||||
t.Errorf("KubernetesReleaseVersion error expected for version %q, but returned successfully", s)
|
||||
}
|
||||
if ver != "" {
|
||||
t.Errorf("KubernetesReleaseVersion should return empty string in case of error. Returned %q for version %q", ver, s)
|
||||
|
Loading…
Reference in New Issue
Block a user