test: replace curl with wget in exporter metrics conformance test#1045
test: replace curl with wget in exporter metrics conformance test#1045ashokpariya0 wants to merge 1 commit intok8snetworkplumbingwg:masterfrom
Conversation
Signed-off-by: Ashok Pariya <ashok.pariya@ibm.com>
|
Thanks for your PR,
To skip the vendors CIs, Maintainers can use one of:
|
Summary of ChangesHello @ashokpariya0, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a failing conformance test for the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly replaces curl with wget in the exporter metrics conformance test to fix an issue where curl is not available in the sriov-network-metrics-exporter pod. The change is effective and directly addresses the problem. I've added one suggestion to improve maintainability by defining the hardcoded URL as a constant.
| 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"} |
There was a problem hiding this comment.
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.
| 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} |
We need this change to fix below test issue on s390x,
The test at
sriov-network-operator/test/conformance/tests/test_exporter_metrics.go
Line 79 in e4cb25b
is currently failing because curl is not available inside the sriov-network-metrics-exporter pod.
To resolve this, replacing curl with wget, which is available in the container image.