Skip to content

credentials: fix cloudflare test after cfSecretMode refactor - #86

Merged
tamalsaha merged 2 commits into
masterfrom
fix-cloudflare-test
Jul 8, 2026
Merged

credentials: fix cloudflare test after cfSecretMode refactor#86
tamalsaha merged 2 commits into
masterfrom
fix-cloudflare-test

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Problem

The lint/build job failed with:

pkg/credentials/cloudflare_test.go:73:11: undefined: validCFSecret (typecheck)

The validCFSecret boolean helper was replaced by cfSecretMode (returning a cfAuthMode enum) in #80, but the test added in #84 still referenced the removed function, breaking typecheck/lint.

Fix

Rewrote TestValidCFSecretTestCFSecretMode to exercise cfSecretMode and assert the selected auth mode. Also captured the behavior changes the refactor introduced:

  • Added a "token wins over key+email" case.
  • The new cfSecretMode requires a non-empty token value, so a present-but-empty token now yields cfAuthInvalid (previously the boolean helper treated it as valid).

go test ./pkg/credentials/... and go vet pass locally.

tamalsaha added 2 commits July 9, 2026 01:11
Signed-off-by: Tamal Saha <tamal@appscode.com>
The validCFSecret helper was replaced by cfSecretMode (returning a
cfAuthMode enum) in #80, but the test still referenced the removed
function, breaking the lint/typecheck. Rewrite TestValidCFSecret as
TestCFSecretMode to exercise cfSecretMode and assert the selected auth
mode.

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha
tamalsaha merged commit 8b74abf into master Jul 8, 2026
4 checks passed
@tamalsaha
tamalsaha deleted the fix-cloudflare-test branch July 8, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant