Allow custom docURL for check documentation links - #1225
Open
ChrisJr404 wants to merge 1 commit into
Open
ChrisJr404 wants to merge 1 commit into
ChrisJr404 wants to merge 1 commit into
Conversation
Custom check categories work, but the dashboard doc links were hardcoded to polaris.docs.fairwinds.com/checks/<category>. A custom category like Business ends up linking to a Fairwinds docs page that doesn't exist. Add an optional docURL field on a check and use it for the check and category doc links when set, falling back to the default Fairwinds link when it's empty. Fixes FairwindsOps#854
ChrisJr404
requested review from
jdesouza,
sudermanjr and
vitorvezani
as code owners
August 18, 2026 00:37
|
|
This branch has not been deployed
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.
This PR fixes #854
Checklist
Description
What's the goal of this PR?
Custom check categories already work, but the "more info" links in the dashboard are still hardcoded to
polaris.docs.fairwinds.com/checks/<category>. So if you make a custom category likeBusiness, every link points at a Fairwinds docs page that doesn't exist. This lets you point those links somewhere real.What changes did you make?
Added an optional
docURLfield to a check. When it's set, the dashboard uses it for that check's more-info link and for the category's "Refer to the Polaris documentation" link. When it's empty you get the existing Fairwinds link, so nothing changes for anyone who doesn't set it.The field lands on
SchemaCheck, flows through toResultMessageinmakeResult, and two small dashboard helpers (getResultDocumentationLink,getCategoryDocumentationLink) fall back to the oldgetCategoryLinkwhen it's unset.Example custom check:
Added helper tests in
pkg/dashboardcovering both paths (custom URL when set, default Fairwinds link when unset), and documented the option indocs/customization/custom-checks.md.go build ./...passes and so do thepkg/config,pkg/validator, andpkg/dashboardtests.What alternative solution should we consider, if any?
Could scope
docURLto the category level instead of the check, but checks are where custom config already lives, so keeping it on the check felt more natural and stays backward compatible.