Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/conformance/tests/test_exporter_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func getMetricsForNode(nodeName string) map[string]*dto.MetricFamily {

metricsExporterPod := metricsExporterPods.Items[0]

command := []string{"curl", "http://127.0.0.1:9110/metrics"}
command := []string{"wget", "-qO-", "http://127.0.0.1:9110/metrics"}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The metrics URL is hardcoded. To improve readability and maintainability, it's better to define it as a constant. This avoids using a 'magic string' and makes it easier to find and update if needed.

Suggested change
command := []string{"wget", "-qO-", "http://127.0.0.1:9110/metrics"}
const metricsURL = "http://127.0.0.1:9110/metrics"
command := []string{"wget", "-qO-", metricsURL}

stdout, stderr, err := pod.ExecCommand(clients, &metricsExporterPod, command...)
Expect(err).ToNot(HaveOccurred(),
"pod: [%s/%s] command: [%v]\nstdout: %s\nstderr: %s", metricsExporterPod.Namespace, metricsExporterPod.Name, command, stdout, stderr)
Expand Down
Loading