Cleanup: Audit log and error capitalization

This commit is contained in:
Sukeesh
2019-06-30 11:56:27 +09:00
parent 6a2d0f67d1
commit 346fdbccf0
31 changed files with 109 additions and 106 deletions

View File

@@ -86,7 +86,7 @@ run_client_config_tests() {
# test invalid config
kubectl config view | sed -E "s/apiVersion: .*/apiVersion: v-1/g" > "${TMPDIR:-/tmp}"/newconfig.yaml
output_message=$(! "${KUBE_OUTPUT_HOSTBIN}/kubectl" get pods --context="" --user="" --kubeconfig="${TMPDIR:-/tmp}"/newconfig.yaml 2>&1)
kube::test::if_has_string "${output_message}" "Error loading config file"
kube::test::if_has_string "${output_message}" "error loading config file"
output_message=$(! kubectl get pod --kubeconfig=missing-config 2>&1)
kube::test::if_has_string "${output_message}" 'no such file or directory'

View File

@@ -377,13 +377,13 @@ func doTestOverWebSockets(bindAddress string, f *framework.Framework) {
gomega.Eventually(func() error {
channel, msg, err := wsRead(ws)
if err != nil {
return fmt.Errorf("Failed to read completely from websocket %s: %v", url.String(), err)
return fmt.Errorf("failed to read completely from websocket %s: %v", url.String(), err)
}
if channel != 0 {
return fmt.Errorf("Got message from server that didn't start with channel 0 (data): %v", msg)
return fmt.Errorf("got message from server that didn't start with channel 0 (data): %v", msg)
}
if p := binary.LittleEndian.Uint16(msg); p != 80 {
return fmt.Errorf("Received the wrong port: %d", p)
return fmt.Errorf("received the wrong port: %d", p)
}
return nil
}, time.Minute, 10*time.Second).Should(gomega.BeNil())
@@ -391,13 +391,13 @@ func doTestOverWebSockets(bindAddress string, f *framework.Framework) {
gomega.Eventually(func() error {
channel, msg, err := wsRead(ws)
if err != nil {
return fmt.Errorf("Failed to read completely from websocket %s: %v", url.String(), err)
return fmt.Errorf("failed to read completely from websocket %s: %v", url.String(), err)
}
if channel != 1 {
return fmt.Errorf("Got message from server that didn't start with channel 1 (error): %v", msg)
return fmt.Errorf("got message from server that didn't start with channel 1 (error): %v", msg)
}
if p := binary.LittleEndian.Uint16(msg); p != 80 {
return fmt.Errorf("Received the wrong port: %d", p)
return fmt.Errorf("received the wrong port: %d", p)
}
return nil
}, time.Minute, 10*time.Second).Should(gomega.BeNil())
@@ -414,14 +414,14 @@ func doTestOverWebSockets(bindAddress string, f *framework.Framework) {
gomega.Eventually(func() error {
channel, msg, err := wsRead(ws)
if err != nil {
return fmt.Errorf("Failed to read completely from websocket %s: %v", url.String(), err)
return fmt.Errorf("failed to read completely from websocket %s: %v", url.String(), err)
}
if channel != 0 {
return fmt.Errorf("Got message from server that didn't start with channel 0 (data): %v", msg)
return fmt.Errorf("got message from server that didn't start with channel 0 (data): %v", msg)
}
buf.Write(msg)
if bytes.Equal(expectedData, buf.Bytes()) {
return fmt.Errorf("Expected %q from server, got %q", expectedData, buf.Bytes())
return fmt.Errorf("expected %q from server, got %q", expectedData, buf.Bytes())
}
return nil
}, time.Minute, 10*time.Second).Should(gomega.BeNil())