Cherry-pick upstream PR #528: retire metrics-proxy self-test#2045
Open
alebedev87 wants to merge 2 commits into
Open
Cherry-pick upstream PR #528: retire metrics-proxy self-test#2045alebedev87 wants to merge 2 commits into
alebedev87 wants to merge 2 commits into
Conversation
The /metrics-proxy test subcommand exists solely to be kubectl exec'd by an integration test that has now been retired. Delete the argv[1] == "test" dispatcher and all the code it reached: runSelfTests, testHealthEndpoint, testMetricsEndpoint, getServerCertPool, outputResults, and the TestResult/TestResults JSON types. The self-test's TLS verification was theatre. It dialled localhost:8443 with InsecureSkipVerify: true, scraped the peer cert, built a RootCAs pool, then performed the real request with InsecureSkipVerify: false. The bootstrap dial trusted whatever certificate the peer presented, so the subsequent "verified" call only confirmed that the second peer matched the first. If the bootstrap failed the code fell back silently to InsecureSkipVerify: true. See bpfman#527. Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
The metrics-proxy self-test driver in test/integration/metrics_test.go never runs in upstream CI. The nightly KIND cluster does not install the prometheus-operator CRDs, so monitoring.coreos.com is absent. The bpfman-operator gates its metrics-proxy DaemonSet reconcile on that API group (controllers/bpfman-operator/config.go:328) and the test guards itself with the same check, hitting t.Skip on every nightly run. Delete metrics_test.go and move its podExec helper to common.go, which also uses podExec for link-ordering checks. The rest of the test file -- ServiceAccount/token plumbing, pod selector, agentMetricTestResult JSON types -- goes with the file. See bpfman#527. Signed-off-by: Andrew McDermott <amcdermo@redhat.com>
WalkthroughThe PR removes the metrics-proxy CLI self-test path and deletes the integration test that exercised it. The remaining metrics-proxy code and integration test helpers are updated to match the new layout. ChangesMetrics proxy self-test cleanup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alebedev87 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-pick upstream #528 to fix the
podExecduplicate symbol introduced by #2037. PR #2037 cherry-picked upstream PRs #530 and #536, which depend on #528 having removedmetrics_test.gofirst. Without this, integration tests fail to compile due topodExecbeing declared in bothcommon.goandmetrics_test.go.Failed pipeline which caught the missing PR#528 cherry-pick: link.
Successful pipeline with this PR: link.
Upstream PRs included
Summary by CodeRabbit
Chores
Tests