Skip to content

Commit 41619ac

Browse files
committed
stop using deprecated klog flags
Some scripts and tools still relied on the deprecated flags, the ones which are about to be removed. This is intentionally not a complete removal of all those flags in the entire repo. This would lead to much more code churn also in places where commands still accept the flags because they use klog directly.
1 parent 6e3d62c commit 41619ac

File tree

11 files changed

+15
-16
lines changed

11 files changed

+15
-16
lines changed

hack/jenkins/benchmark-dockerized.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ cd "${GOPATH}/src/k8s.io/kubernetes"
6666
./hack/install-etcd.sh
6767

6868
# Run the benchmark tests and pretty-print the results into a separate file.
69-
make test-integration WHAT="$*" KUBE_TEST_ARGS="-run='XXX' -bench=${TEST_PREFIX:-.} -benchtime=${BENCHTIME:-1s} -benchmem -alsologtostderr=false -logtostderr=false -data-items-dir=${ARTIFACTS}" \
69+
# Log output of the tests go to stderr.
70+
make test-integration WHAT="$*" KUBE_TEST_ARGS="-run='XXX' -bench=${TEST_PREFIX:-.} -benchtime=${BENCHTIME:-1s} -benchmem -data-items-dir=${ARTIFACTS}" \
7071
| (go run test/integration/benchmark/extractlog/main.go) \
7172
| tee \
7273
>(prettybench -no-passthrough > "${ARTIFACTS}/BenchmarkResults.txt") \

hack/make-rules/test-e2e-node.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if [ "${remote}" = true ] && [ "${remote_mode}" = gce ] ; then
162162
echo "Kubelet Config File: ${kubelet_config_file}"
163163

164164
# Invoke the runner
165-
go run test/e2e_node/runner/remote/run_remote.go --logtostderr --vmodule=*=4 --ssh-env="gce" \
165+
go run test/e2e_node/runner/remote/run_remote.go --vmodule=*=4 --ssh-env="gce" \
166166
--zone="${zone}" --project="${project}" --gubernator="${gubernator}" \
167167
--hosts="${hosts}" --images="${images}" --cleanup="${cleanup}" \
168168
--results-dir="${artifacts}" --ginkgo-flags="${ginkgoflags}" --runtime-config="${runtime_config}" \
@@ -189,7 +189,7 @@ elif [ "${remote}" = true ] && [ "${remote_mode}" = ssh ] ; then
189189
test_args='--kubelet-flags="--cluster-domain='${KUBE_DNS_DOMAIN:-cluster.local}'" '${test_args}
190190

191191
# Invoke the runner
192-
go run test/e2e_node/runner/remote/run_remote.go --mode="ssh" --logtostderr --vmodule=*=4 \
192+
go run test/e2e_node/runner/remote/run_remote.go --mode="ssh" --vmodule=*=4 \
193193
--hosts="${hosts}" --results-dir="${artifacts}" --ginkgo-flags="${ginkgoflags}" \
194194
--test_args="${test_args}" --system-spec-name="${system_spec_name}" \
195195
--runtime-config="${runtime_config}" \
@@ -222,7 +222,7 @@ else
222222
go run test/e2e_node/runner/local/run_local.go \
223223
--system-spec-name="${system_spec_name}" --extra-envs="${extra_envs}" \
224224
--ginkgo-flags="${ginkgoflags}" \
225-
--test-flags="--alsologtostderr --v 4 --report-dir=${artifacts} --node-name $(hostname) ${test_args}" \
225+
--test-flags="--v 4 --report-dir=${artifacts} --node-name $(hostname) ${test_args}" \
226226
--runtime-config="${runtime_config}" \
227227
--kubelet-config-file="${kubelet_config_file}" \
228228
--build-dependencies=true 2>&1 | tee -i "${artifacts}/build-log.txt"

hack/make-rules/test-integration.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ runTests() {
7878
make -C "${KUBE_ROOT}" test \
7979
WHAT="${WHAT:-$(kube::test::find_integration_test_dirs | paste -sd' ' -)}" \
8080
GOFLAGS="${GOFLAGS:-}" \
81-
KUBE_TEST_ARGS="--alsologtostderr=true ${SHORT:--short=true} --vmodule=${KUBE_TEST_VMODULE} ${KUBE_TEST_ARGS:-}" \
81+
KUBE_TEST_ARGS="${SHORT:--short=true} --vmodule=${KUBE_TEST_VMODULE} ${KUBE_TEST_ARGS:-}" \
8282
KUBE_TIMEOUT="${KUBE_TIMEOUT}" \
8383
KUBE_RACE=""
8484

hack/update-openapi-spec.sh

-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ kube::log::status "Starting kube-apiserver"
8484
--service-account-lookup="${SERVICE_ACCOUNT_LOOKUP}" \
8585
--service-account-issuer="https://kubernetes.default.svc" \
8686
--service-account-signing-key-file="${SERVICE_ACCOUNT_KEY}" \
87-
--logtostderr \
8887
--v=2 \
8988
--service-cluster-ip-range="10.0.0.0/24" >"${API_LOGFILE}" 2>&1 &
9089
APISERVER_PID=$!

test/e2e_node/conformance/run_test.sh

-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ start_kubelet --kubeconfig "${KUBELET_KUBECONFIG}" \
201201
--system-cgroups=/system \
202202
--cgroup-root=/ \
203203
--v=$log_level \
204-
--logtostderr
205204

206205
wait_kubelet
207206

test/e2e_node/jenkins/conformance/conformance-jenkins.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ TIMEOUT=${TIMEOUT:-"45m"}
3333
mkdir -p "${ARTIFACTS}"
3434

3535
go run test/e2e_node/runner/remote/run_remote.go --test-suite=conformance \
36-
--logtostderr --vmodule=*=4 --ssh-env="gce" --ssh-user="$GCE_USER" \
36+
--vmodule=*=4 --ssh-env="gce" --ssh-user="$GCE_USER" \
3737
--zone="$GCE_ZONE" --project="$GCE_PROJECT" --hosts="$GCE_HOSTS" \
3838
--images="$GCE_IMAGES" --image-project="$GCE_IMAGE_PROJECT" \
3939
--image-config-file="$GCE_IMAGE_CONFIG_PATH" --cleanup="$CLEANUP" \

test/e2e_node/remote/node_conformance.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func launchKubelet(host, workspace, results, testArgs, bearerToken string) error
181181
return fmt.Errorf("failed to create kubelet pod manifest path %q: error - %v output - %q",
182182
podManifestPath, err, output)
183183
}
184-
startKubeletCmd := fmt.Sprintf("./%s --run-kubelet-mode --logtostderr --node-name=%s"+
184+
startKubeletCmd := fmt.Sprintf("./%s --run-kubelet-mode --node-name=%s"+
185185
" --bearer-token=%s"+
186186
" --report-dir=%s %s --kubelet-flags=--pod-manifest-path=%s > %s 2>&1",
187187
conformanceTestBinary, host, bearerToken, results, testArgs, podManifestPath, filepath.Join(results, kubeletLauncherLog))

test/e2e_node/remote/node_e2e.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func (n *NodeE2ERemote) RunTest(host, workspace, results, imageDesc, junitFilePr
200200
klog.V(2).Infof("Starting tests on %q", host)
201201
cmd := getSSHCommand(" && ",
202202
fmt.Sprintf("cd %s", workspace),
203-
fmt.Sprintf("timeout -k 30s %fs ./ginkgo %s ./e2e_node.test -- --system-spec-name=%s --system-spec-file=%s --extra-envs=%s --runtime-config=%s --logtostderr --v 4 --node-name=%s --report-dir=%s --report-prefix=%s --image-description=\"%s\" %s",
203+
fmt.Sprintf("timeout -k 30s %fs ./ginkgo %s ./e2e_node.test -- --system-spec-name=%s --system-spec-file=%s --extra-envs=%s --runtime-config=%s --v 4 --node-name=%s --report-dir=%s --report-prefix=%s --image-description=\"%s\" %s",
204204
timeout.Seconds(), ginkgoArgs, systemSpecName, systemSpecFile, extraEnvs, runtimeConfig, host, results, junitFilePrefix, imageDesc, testArgs),
205205
)
206206
return SSH(host, "sh", "-c", cmd)

test/e2e_node/runner/remote/run_remote.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ limitations under the License.
1515
*/
1616

1717
// To run the node e2e tests remotely against one or more hosts on gce:
18-
// $ go run run_remote.go --logtostderr --v 2 --ssh-env gce --hosts <comma separated hosts>
18+
// $ go run run_remote.go --v 2 --ssh-env gce --hosts <comma separated hosts>
1919
// To run the node e2e tests remotely against one or more images on gce and provision them:
20-
// $ go run run_remote.go --logtostderr --v 2 --project <project> --zone <zone> --ssh-env gce --images <comma separated images>
20+
// $ go run run_remote.go --v 2 --project <project> --zone <zone> --ssh-env gce --images <comma separated images>
2121
package main
2222

2323
import (

test/e2e_node/services/kubelet.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func (e *E2EServices) startKubelet(featureGates map[string]bool) (*server, error
252252
cmdArgs = append(cmdArgs,
253253
"--kubeconfig", kubeconfigPath,
254254
"--root-dir", KubeletRootDirectory,
255-
"--v", LogVerbosityLevel, "--logtostderr",
255+
"--v", LogVerbosityLevel,
256256
)
257257

258258
// Apply test framework feature gates by default. This could also be overridden

test/integration/scheduler_perf/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ How To Run
3232

3333
```shell
3434
# In Kubernetes root path
35-
make test-integration WHAT=./test/integration/scheduler_perf ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=false -logtostderr=false -run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling"
35+
make test-integration WHAT=./test/integration/scheduler_perf ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling"
3636
```
3737

3838
The benchmark suite runs all the tests specified under config/performance-config.yaml.
@@ -47,14 +47,14 @@ Otherwise, the golang benchmark framework will try to run a test more than once
4747

4848
```shell
4949
# In Kubernetes root path
50-
make test-integration WHAT=./test/integration/scheduler_perf ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=false -logtostderr=false -run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling/SchedulingBasic/5000Nodes/5000InitPods/1000PodsToSchedule"
50+
make test-integration WHAT=./test/integration/scheduler_perf ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling/SchedulingBasic/5000Nodes/5000InitPods/1000PodsToSchedule"
5151
```
5252

5353
To produce a cpu profile:
5454

5555
```shell
5656
# In Kubernetes root path
57-
make test-integration WHAT=./test/integration/scheduler_perf KUBE_TIMEOUT="-timeout=3600s" ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=false -logtostderr=false -run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling -cpuprofile ~/cpu-profile.out"
57+
make test-integration WHAT=./test/integration/scheduler_perf KUBE_TIMEOUT="-timeout=3600s" ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling -cpuprofile ~/cpu-profile.out"
5858
```
5959

6060
### How to configure benchmark tests

0 commit comments

Comments
 (0)