Skip to content

Commit

Permalink
vim can sort
Browse files Browse the repository at this point in the history
  • Loading branch information
eaudetcobello committed Jun 13, 2024
1 parent 4637cd7 commit de23a5d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
28 changes: 14 additions & 14 deletions src/k8s/pkg/k8sd/setup/kube_apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,25 @@ func TestKubeAPIServer(t *testing.T) {
expectedVal string
}{
{key: "--allow-privileged", expectedVal: "true"},
{key: "--anonymous-auth", expectedVal: "false"},
{key: "--authentication-token-webhook-config-file", expectedVal: path.Join(s.Mock.ServiceExtraConfigDir, "auth-token-webhook.conf")},
{key: "--authorization-mode", expectedVal: "Node,RBAC"},
{key: "--client-ca-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "client-ca.crt")},
{key: "--enable-admission-plugins", expectedVal: "NodeRestriction"},
{key: "--etcd-servers", expectedVal: fmt.Sprintf("unix://%s", path.Join(s.Mock.K8sDqliteStateDir, "k8s-dqlite.sock"))},
{key: "--kubelet-certificate-authority", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "ca.crt")},
{key: "--kubelet-client-certificate", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "apiserver-kubelet-client.crt")},
{key: "--kubelet-client-key", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "apiserver-kubelet-client.key")},
{key: "--kubelet-preferred-address-types", expectedVal: "InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP"},
{key: "--profiling", expectedVal: "false"},
{key: "--proxy-client-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "front-proxy-client.crt")},
{key: "--proxy-client-key-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "front-proxy-client.key")},
{key: "--requestheader-allowed-names", expectedVal: "front-proxy-client"},
{key: "--requestheader-client-ca-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "front-proxy-ca.crt")},
{key: "--requestheader-extra-headers-prefix", expectedVal: "X-Remote-Extra-"},
{key: "--requestheader-group-headers", expectedVal: "X-Remote-Group"},
{key: "--requestheader-username-headers", expectedVal: "X-Remote-User"},
{key: "--requests-timeout", expectedVal: "300s"},
{key: "--secure-port", expectedVal: "6443"},
{key: "--service-account-issuer", expectedVal: "https://kubernetes.default.svc"},
{key: "--service-account-key-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "serviceaccount.key")},
Expand All @@ -60,17 +71,6 @@ func TestKubeAPIServer(t *testing.T) {
{key: "--tls-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "apiserver.crt")},
{key: "--tls-cipher-suites", expectedVal: apiserverTLSCipherSuites},
{key: "--tls-private-key-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "apiserver.key")},
{key: "--etcd-servers", expectedVal: fmt.Sprintf("unix://%s", path.Join(s.Mock.K8sDqliteStateDir, "k8s-dqlite.sock"))},
{key: "--requestheader-client-ca-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "front-proxy-ca.crt")},
{key: "--requestheader-allowed-names", expectedVal: "front-proxy-client"},
{key: "--requestheader-extra-headers-prefix", expectedVal: "X-Remote-Extra-"},
{key: "--requestheader-group-headers", expectedVal: "X-Remote-Group"},
{key: "--requestheader-username-headers", expectedVal: "X-Remote-User"},
{key: "--proxy-client-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "front-proxy-client.crt")},
{key: "--proxy-client-key-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "front-proxy-client.key")},
{key: "--anonymous-auth", expectedVal: "false"},
{key: "--profiling", expectedVal: "false"},
{key: "--requests-timeout", expectedVal: "300s"},
}
for _, tc := range tests {
t.Run(tc.key, func(t *testing.T) {
Expand Down Expand Up @@ -102,14 +102,17 @@ func TestKubeAPIServer(t *testing.T) {
expectedVal string
}{
{key: "--allow-privileged", expectedVal: "true"},
{key: "--anonymous-auth", expectedVal: "false"},
{key: "--authentication-token-webhook-config-file", expectedVal: path.Join(s.Mock.ServiceExtraConfigDir, "auth-token-webhook.conf")},
{key: "--authorization-mode", expectedVal: "Node,RBAC"},
{key: "--client-ca-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "client-ca.crt")},
{key: "--enable-admission-plugins", expectedVal: "NodeRestriction"},
{key: "--etcd-servers", expectedVal: fmt.Sprintf("unix://%s", path.Join(s.Mock.K8sDqliteStateDir, "k8s-dqlite.sock"))},
{key: "--kubelet-certificate-authority", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "ca.crt")},
{key: "--kubelet-client-certificate", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "apiserver-kubelet-client.crt")},
{key: "--kubelet-client-key", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "apiserver-kubelet-client.key")},
{key: "--kubelet-preferred-address-types", expectedVal: "InternalIP,Hostname,InternalDNS,ExternalDNS,ExternalIP"},
{key: "--requests-timeout", expectedVal: "300s"},
{key: "--secure-port", expectedVal: "6443"},
{key: "--service-account-issuer", expectedVal: "https://kubernetes.default.svc"},
{key: "--service-account-key-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "serviceaccount.key")},
Expand All @@ -118,10 +121,7 @@ func TestKubeAPIServer(t *testing.T) {
{key: "--tls-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "apiserver.crt")},
{key: "--tls-cipher-suites", expectedVal: apiserverTLSCipherSuites},
{key: "--tls-private-key-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "apiserver.key")},
{key: "--etcd-servers", expectedVal: fmt.Sprintf("unix://%s", path.Join(s.Mock.K8sDqliteStateDir, "k8s-dqlite.sock"))},
{key: "--anonymous-auth", expectedVal: "false"},
{key: "--profiling", expectedVal: "false"},
{key: "--requests-timeout", expectedVal: "300s"},
}
for _, tc := range tests {
t.Run(tc.key, func(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions src/k8s/pkg/k8sd/setup/kube_controller_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ func TestKubeControllerManager(t *testing.T) {
}{
{key: "--authentication-kubeconfig", expectedVal: path.Join(s.Mock.KubernetesConfigDir, "controller.conf")},
{key: "--authorization-kubeconfig", expectedVal: path.Join(s.Mock.KubernetesConfigDir, "controller.conf")},
{key: "--cluster-signing-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "ca.crt")},
{key: "--cluster-signing-key-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "ca.key")},
{key: "--kubeconfig", expectedVal: path.Join(s.Mock.KubernetesConfigDir, "controller.conf")},
{key: "--leader-elect-lease-duration", expectedVal: "30s"},
{key: "--leader-elect-renew-deadline", expectedVal: "15s"},
{key: "--profiling", expectedVal: "false"},
{key: "--root-ca-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "ca.crt")},
{key: "--service-account-private-key-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "serviceaccount.key")},
{key: "--use-service-account-credentials", expectedVal: "true"},
{key: "--cluster-signing-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "ca.crt")},
{key: "--cluster-signing-key-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "ca.key")},
{key: "--terminated-pod-gc-threshold", expectedVal: "12500"},
{key: "--use-service-account-credentials", expectedVal: "true"},
}
for _, tc := range tests {
t.Run(tc.key, func(t *testing.T) {
Expand Down
32 changes: 16 additions & 16 deletions src/k8s/pkg/k8sd/setup/kubelet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@ func TestKubelet(t *testing.T) {
}{
{key: "--anonymous-auth", expectedVal: "false"},
{key: "--authentication-token-webhook", expectedVal: "true"},
{key: "--tls-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.crt")},
{key: "--tls-private-key", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.key")},
{key: "--client-ca-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "client-ca.crt")},
{key: "--cloud-provider", expectedVal: "provider"},
{key: "--cluster-dns", expectedVal: "10.152.1.1"},
{key: "--cluster-domain", expectedVal: "test-cluster.local"},
{key: "--container-runtime-endpoint", expectedVal: path.Join(s.Mock.ContainerdSocketDir, "containerd.sock")},
{key: "--containerd", expectedVal: path.Join(s.Mock.ContainerdSocketDir, "containerd.sock")},
{key: "--eviction-hard", expectedVal: "'memory.available<100Mi,nodefs.available<1Gi,imagefs.available<1Gi'"},
{key: "--fail-swap-on", expectedVal: "false"},
{key: "--hostname-override", expectedVal: "dev"},
{key: "--kubeconfig", expectedVal: path.Join(s.Mock.KubernetesConfigDir, "kubelet.conf")},
{key: "--node-ip", expectedVal: "192.168.0.1"},
{key: "--node-labels", expectedVal: expectedControlPlaneLabels},
{key: "--read-only-port", expectedVal: "0"},
{key: "--register-with-taints", expectedVal: ""},
{key: "--root-dir", expectedVal: s.Mock.KubeletRootDir},
{key: "--serialize-image-pulls", expectedVal: "false"},
{key: "--tls-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.crt")},
{key: "--tls-cipher-suites", expectedVal: kubeletTLSCipherSuites},
{key: "--cloud-provider", expectedVal: "provider"},
{key: "--cluster-dns", expectedVal: "10.152.1.1"},
{key: "--cluster-domain", expectedVal: "test-cluster.local"},
{key: "--node-ip", expectedVal: "192.168.0.1"},
{key: "--tls-private-key", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.key")},
}
for _, tc := range tests {
t.Run(tc.key, func(t *testing.T) {
Expand Down Expand Up @@ -105,8 +105,6 @@ func TestKubelet(t *testing.T) {
}{
{key: "--anonymous-auth", expectedVal: "false"},
{key: "--authentication-token-webhook", expectedVal: "true"},
{key: "--tls-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.crt")},
{key: "--tls-private-key", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.key")},
{key: "--client-ca-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "client-ca.crt")},
{key: "--container-runtime-endpoint", expectedVal: path.Join(s.Mock.ContainerdSocketDir, "containerd.sock")},
{key: "--containerd", expectedVal: path.Join(s.Mock.ContainerdSocketDir, "containerd.sock")},
Expand All @@ -119,7 +117,9 @@ func TestKubelet(t *testing.T) {
{key: "--register-with-taints", expectedVal: ""},
{key: "--root-dir", expectedVal: s.Mock.KubeletRootDir},
{key: "--serialize-image-pulls", expectedVal: "false"},
{key: "--tls-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.crt")},
{key: "--tls-cipher-suites", expectedVal: kubeletTLSCipherSuites},
{key: "--tls-private-key", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.key")},
}
for _, tc := range tests {
t.Run(tc.key, func(t *testing.T) {
Expand Down Expand Up @@ -152,25 +152,25 @@ func TestKubelet(t *testing.T) {
}{
{key: "--anonymous-auth", expectedVal: "false"},
{key: "--authentication-token-webhook", expectedVal: "true"},
{key: "--tls-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.crt")},
{key: "--tls-private-key", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.key")},
{key: "--client-ca-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "client-ca.crt")},
{key: "--cloud-provider", expectedVal: "provider"},
{key: "--cluster-dns", expectedVal: "10.152.1.1"},
{key: "--cluster-domain", expectedVal: "test-cluster.local"},
{key: "--container-runtime-endpoint", expectedVal: path.Join(s.Mock.ContainerdSocketDir, "containerd.sock")},
{key: "--containerd", expectedVal: path.Join(s.Mock.ContainerdSocketDir, "containerd.sock")},
{key: "--eviction-hard", expectedVal: "'memory.available<100Mi,nodefs.available<1Gi,imagefs.available<1Gi'"},
{key: "--fail-swap-on", expectedVal: "false"},
{key: "--hostname-override", expectedVal: "dev"},
{key: "--kubeconfig", expectedVal: path.Join(s.Mock.KubernetesConfigDir, "kubelet.conf")},
{key: "--node-ip", expectedVal: "192.168.0.1"},
{key: "--node-labels", expectedVal: expectedWorkerLabels},
{key: "--read-only-port", expectedVal: "0"},
{key: "--register-with-taints", expectedVal: ""},
{key: "--root-dir", expectedVal: s.Mock.KubeletRootDir},
{key: "--serialize-image-pulls", expectedVal: "false"},
{key: "--tls-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.crt")},
{key: "--tls-cipher-suites", expectedVal: kubeletTLSCipherSuites},
{key: "--cloud-provider", expectedVal: "provider"},
{key: "--cluster-dns", expectedVal: "10.152.1.1"},
{key: "--cluster-domain", expectedVal: "test-cluster.local"},
{key: "--node-ip", expectedVal: "192.168.0.1"},
{key: "--tls-private-key", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.key")},
}
for _, tc := range tests {
t.Run(tc.key, func(t *testing.T) {
Expand Down Expand Up @@ -203,8 +203,6 @@ func TestKubelet(t *testing.T) {
}{
{key: "--anonymous-auth", expectedVal: "false"},
{key: "--authentication-token-webhook", expectedVal: "true"},
{key: "--tls-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.crt")},
{key: "--tls-private-key", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.key")},
{key: "--client-ca-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "client-ca.crt")},
{key: "--container-runtime-endpoint", expectedVal: path.Join(s.Mock.ContainerdSocketDir, "containerd.sock")},
{key: "--containerd", expectedVal: path.Join(s.Mock.ContainerdSocketDir, "containerd.sock")},
Expand All @@ -217,7 +215,9 @@ func TestKubelet(t *testing.T) {
{key: "--register-with-taints", expectedVal: ""},
{key: "--root-dir", expectedVal: s.Mock.KubeletRootDir},
{key: "--serialize-image-pulls", expectedVal: "false"},
{key: "--tls-cert-file", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.crt")},
{key: "--tls-cipher-suites", expectedVal: kubeletTLSCipherSuites},
{key: "--tls-private-key", expectedVal: path.Join(s.Mock.KubernetesPKIDir, "kubelet.key")},
}
for _, tc := range tests {
t.Run(tc.key, func(t *testing.T) {
Expand Down

0 comments on commit de23a5d

Please sign in to comment.