mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Fixed code formatting issues discovered by verify-gofmt
This commit is contained in:
parent
e70a630dac
commit
78248d0c2a
@ -248,15 +248,15 @@ func TestDescribeHelpMessage(t *testing.T) {
|
|||||||
func TestDescribeNoResourcesFound(t *testing.T) {
|
func TestDescribeNoResourcesFound(t *testing.T) {
|
||||||
testNS := "testns"
|
testNS := "testns"
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
flags map[string]string
|
flags map[string]string
|
||||||
namespace string
|
namespace string
|
||||||
expectedOutput string
|
expectedOutput string
|
||||||
expectedErr string
|
expectedErr string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "all namespaces",
|
name: "all namespaces",
|
||||||
flags: map[string]string{"all-namespaces": "true"},
|
flags: map[string]string{"all-namespaces": "true"},
|
||||||
expectedOutput: "",
|
expectedOutput: "",
|
||||||
expectedErr: "No resources found\n",
|
expectedErr: "No resources found\n",
|
||||||
},
|
},
|
||||||
|
@ -452,12 +452,12 @@ func TestTopPodWithMetricsServer(t *testing.T) {
|
|||||||
func TestTopPodNoResourcesFound(t *testing.T) {
|
func TestTopPodNoResourcesFound(t *testing.T) {
|
||||||
testNS := "testns"
|
testNS := "testns"
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
options *TopPodOptions
|
options *TopPodOptions
|
||||||
namespace string
|
namespace string
|
||||||
expectedOutput string
|
expectedOutput string
|
||||||
expectedErr string
|
expectedErr string
|
||||||
expectedPath string
|
expectedPath string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "all namespaces",
|
name: "all namespaces",
|
||||||
@ -501,7 +501,7 @@ func TestTopPodNoResourcesFound(t *testing.T) {
|
|||||||
return &http.Response{StatusCode: http.StatusOK, Header: cmdtesting.DefaultHeader(), Body: ioutil.NopCloser(bytes.NewReader([]byte(apibody)))}, nil
|
return &http.Response{StatusCode: http.StatusOK, Header: cmdtesting.DefaultHeader(), Body: ioutil.NopCloser(bytes.NewReader([]byte(apibody)))}, nil
|
||||||
case p == "/apis":
|
case p == "/apis":
|
||||||
return &http.Response{StatusCode: http.StatusOK, Header: cmdtesting.DefaultHeader(), Body: ioutil.NopCloser(bytes.NewReader([]byte(apisbodyWithMetrics)))}, nil
|
return &http.Response{StatusCode: http.StatusOK, Header: cmdtesting.DefaultHeader(), Body: ioutil.NopCloser(bytes.NewReader([]byte(apisbodyWithMetrics)))}, nil
|
||||||
case p == "/api/v1/namespaces/" + testNS + "/pods":
|
case p == "/api/v1/namespaces/"+testNS+"/pods":
|
||||||
// Top Pod calls this endpoint to check if there are pods whenever it gets no metrics,
|
// Top Pod calls this endpoint to check if there are pods whenever it gets no metrics,
|
||||||
// so we need to return no pods for this test scenario
|
// so we need to return no pods for this test scenario
|
||||||
body, _ := marshallBody(metricsv1alpha1api.PodMetricsList{
|
body, _ := marshallBody(metricsv1alpha1api.PodMetricsList{
|
||||||
|
Loading…
Reference in New Issue
Block a user