Repository navigation
fix: remove unused bsl parameter (golangci-lint unparam) - #1
Merged
Merged
Conversation
…int unparam) golangci-lint's unparam check flagged buildTLSConfig's bsl parameter as unused -- CA cert data is already passed separately via caCertData ([]byte), so bsl was never read in the function body. Removing it cascaded: buildHTTPClientWithTLS and buildAWSSessionWithTLS only forwarded bsl to buildTLSConfig, so once removed there they also became unparam violations, requiring the same removal all the way up through their 2 real callers and 3 test call sites. Verified: go build ./..., go vet ./internal/controller/..., golangci-lint run ./internal/controller/... (0 issues), and go test ./internal/controller/... -run 'TestBuild|TLS|DataProtectionTest' (all pass, including the BSL-CA-cert test cases -- confirming bsl truly carried no behavior). Co-authored-by: Hermes Agent <noreply@hermes-agent> Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The signature cleanup is behavior-preserving and all call sites are updated; only a minor comment typo remains.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Removes an unused BSL parameter from TLS helper functions to satisfy unparam linting without changing behavior.
Changes:
- Simplifies three TLS helper signatures.
- Updates controller and unit-test call sites.
- Clarifies TLS certificate comments.
| File | Description |
|---|---|
internal/controller/tls_config.go |
Removes unused BSL parameters. |
internal/controller/dataprotectiontest_controller.go |
Updates production call sites. |
internal/controller/dataprotectiontest_controller_test.go |
Updates test call sites. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot review finding on msfrucht#1: the comment wrote 'CaCertRef' but the actual DataProtectionApplication API field is CACertRef (json tag caCertRef). Comment-only fix, no behavior change. Co-authored-by: Hermes Agent <noreply@hermes-agent> Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
msfrucht
approved these changes
Oct 5, 2026
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.

Fixes the
golangci-lint unparamfinding currently blocking CI on openshift#2443:buildTLSConfig'sbsl *velerov1.BackupStorageLocationSpecparameter was never read in the function body -- CA cert data is already passed separately viacaCertData []byte. Removing it cascaded:buildHTTPClientWithTLSandbuildAWSSessionWithTLSonly forwardedbsltobuildTLSConfig, so removing it there surfaced the same lint violation one level up. Removedbslfrom all 3 functions and updated the 2 real call sites plus 3 test call sites accordingly.Verified locally:
go build ./...go vet ./internal/controller/...golangci-lint run ./internal/controller/...→ 0 issuesgo test ./internal/controller/... -run 'TestBuild|TLS|DataProtectionTest'→ all pass, including the BSL-CA-cert test cases (confirms behavior is unchanged --bsltruly carried no logic)Feel free to squash into your own commits, or merge as-is.