Skip to content

Commit

Permalink
Address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
wanlin31 committed Aug 1, 2022
1 parent 408e82a commit 81a181f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ const (
// DriverPortEnv specifies the name of the env variable that contains driver port.
DriverPortEnv = "DRIVER_PORT"

// DisablePrometheusEnv specifies the name of the env variable that indicates
// if the collection of Prometheus data is disabled.
DisablePrometheusEnv = "DISABLE_PROMETHEUS"
// EnablePrometheusEnv specifies the name of the env variable that indicates
// if the collection of Prometheus data is enabled.
EnablePrometheusEnv = "ENABLE_PROMETHEUS"

// PoolLabel is the key for a label which will have the name of a pool as
// the value.
Expand Down
12 changes: 7 additions & 5 deletions containers/runtime/driver/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ if [ -n "${BQ_RESULT_TABLE}" ]; then
fi
if [ -r "${NODE_INFO_OUTPUT_FILE}" ]; then
cp "${NODE_INFO_OUTPUT_FILE}" node_info.json
if [ "$(dig +short -t srv prometheus.test-infra-system.svc.cluster.local)" ] && [ -z "${DISABLE_PROMETHEUS}" ]; then
python3 /src/code/tools/run_tests/performance/prometheus.py \
--url=http://prometheus.test-infra-system.svc.cluster.local:9090 \
--pod_type=clients --container_name=main \
--container_name=sidecar
if [ -z "${SERVER_TARGET_OVERRIDE}" ] || [ -z "${ENABLE_PROMETHEUS}" ]; then
if [ "$(dig +short -t srv prometheus.test-infra-system.svc.cluster.local)" ]; then
python3 /src/code/tools/run_tests/performance/prometheus.py \
--url=http://prometheus.test-infra-system.svc.cluster.local:9090 \
--pod_type=clients --container_name=main \
--container_name=sidecar
fi
fi
fi
python3 /src/code/tools/run_tests/performance/bq_upload_result.py --bq_result_table="${BQ_RESULT_TABLE}"
Expand Down
2 changes: 1 addition & 1 deletion podbuilder/podbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (pb *PodBuilder) PodForDriver(driver *grpcv1.Driver) (*corev1.Pod, error) {
if ok && strings.ToLower(disablePrometheus) == "true" {
runContainer.Env = append(runContainer.Env,
corev1.EnvVar{
Name: config.DisablePrometheusEnv,
Name: config.EnablePrometheusEnv,
Value: "true"})
}

Expand Down
2 changes: 1 addition & 1 deletion status/missing_pods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down

0 comments on commit 81a181f

Please sign in to comment.