Skip to content

fix(cli): provider get/list read correct scope and status paths - #57

Merged
atbagan merged 1 commit into
mainfrom
fix/provider-display-paths
Jun 11, 2026
Merged

atbagan merged 1 commit into
mainfrom
fix/provider-display-paths

Conversation

@atbagan

@atbagan atbagan commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Provider display-path bug (the field-path class found via live E2E)

Live-checking provider get against a real provider (the E2E bar #5 shipped without, the same one that caught the idp get bug) surfaced a display-path mismatch: the display code reads paths the ProviderConfig CRD does not store data at, rendering wrong or blank silently.

Bugs

  1. Scope shows the wrong value. provider get (detail) and provider list -o wide (SCOPE column) read spec.scope as a string, but the CRD stores scope as an object (spec.scope.type, per the CRD's own printcolumn JSONPath=".spec.scope.type"). The string read is always blank, so the "platform" fallback fires, and a team-scoped provider displays as "platform" (a silently wrong value, not just blank). Now read spec.scope.type.
  2. Validation error never shows. extractProviderInfo read status.validationError, which the CRD has no such field; a failed validation is recorded as the Ready condition's message. Now derived from the Ready condition when it is not True.
  3. Last-validation timestamp. Read from status.lastValidatedAt; the CRD field is status.lastValidationTime. Fixed.

The endpoint, network mode, credentials ref, provider, and validated paths were checked against the CRD and are correct.

Validation (live)

Reproduced on butler-beta with a throwaway team-scoped provider: provider get and list -o wide showed platform while the object was actually scope.type=team (confirmed by kubectl and get -o json). After the fix both show team, and a genuinely unscoped provider still shows platform. Throwaway cleaned up to pre-state, real harvester provider untouched.

Tests

  • printProviderDetail renders team for a team-scoped provider and platform for an unscoped one (mutation-checked: the old spec.scope path renders platform for a team-scoped provider and fails).
  • providerValidationError reads the Ready condition message when not True, empty otherwise.
  • build (both binaries) + vet + provider pkg tests green.

Retroactively brings #5 (provider get/update) to the live-E2E bar #6/#7 shipped with.

The provider detail view and list wide column read spec.scope as a string,
but the CRD stores scope as an object (spec.scope.type), so a team-scoped
provider rendered as "platform" via the absent-scope fallback. They now read
spec.scope.type.

Two status paths were also wrong: the validation error was read from a
non-existent status.validationError field, and the last-validation timestamp
from status.lastValidatedAt. The error is recorded as the Ready condition's
message, and the timestamp field is status.lastValidationTime; both are now
read correctly.

Found by exercising provider get against a real team-scoped provider, the
same display-path class of bug fixed for idp get earlier.
@atbagan
atbagan merged commit aa2777b into main Jun 11, 2026
1 check passed
@atbagan
atbagan deleted the fix/provider-display-paths branch June 11, 2026 13:23
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