Skip to content

[Bugfix] explain: REASON text masks real rejection cause - #761

Merged
slin1237 merged 1 commit into
mainfrom
explain-reason-fixes
Aug 12, 2026
Merged

[Bugfix] explain: REASON text masks real rejection cause#761
slin1237 merged 1 commit into
mainfrom
explain-reason-fixes

Conversation

@pallasathena92

Copy link
Copy Markdown
Collaborator

What this PR does

Post-merge review of #759 confirmed two defects in kubectl ome runtime explain's REASON column (COMPATIBLE verdicts were always correct):

  • A non-matched runtime that passes ValidateRuntime got a hardcoded "no autoSelect entry" reason — factually wrong when the real cause is a non-auto-selectable matching format or an explicit priority-0 (zero score) drop. The reason is now recomputed from the actual per-format auto-select/score semantics.
  • ValidateRuntime resolves by name only (namespaced shadows cluster), so a cluster-scoped candidate sharing a name with a namespaced runtime had its rejection reason computed against the wrong object. Same-name rows are now evaluated against the correct scope's spec.

Why we need it

The whole point of runtime explain is trustworthy "why" output; a wrong reason is worse than none. Follow-up to #759 (OEP-0011).

How to test

go test ./pkg/cli/cmd/runtime/...

Checklist

  • Tests added/updated
  • Docs updated (N/A)
  • Scoped test suite passes locally (go test ./pkg/cli/... — full make test requires the Rust xet toolchain, unaffected by this PR)

Signed-off-by: yifeng liu <31553858+pallasathena92@users.noreply.github.com>
@github-actions github-actions Bot added the tests Test changes label Aug 12, 2026
@slin1237
slin1237 merged commit 53cc00a into main Aug 12, 2026
15 checks passed
@slin1237
slin1237 deleted the explain-reason-fixes branch August 12, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants