Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for preflight check configuration #900

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

tmshort
Copy link
Contributor

@tmshort tmshort commented Mar 12, 2024

What this PR does / why we need it:

This adds configuration file support (preflightRules) for preflight checks. Each preflight check must add a SetConfig() method to accept configuration from the Preflight registry.

Which issue(s) this PR fixes:

Fixes #899

Does this PR introduce a user-facing change?

Add support for preflightRules configuration

Additional Notes for your reviewer:

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:

Proposal carvel-dev/carvel#729

Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me apart from Bryce's comment.
Should we add/update the preflight permissions e2e tests with a config example? (I am okay with just the unit tests as well)

Would would also have to add the preflight option in the configuration docs.

pkg/kapp/preflight/registry.go Outdated Show resolved Hide resolved
@tmshort
Copy link
Contributor Author

tmshort commented Mar 26, 2024

Looks good to me apart from Bryce's comment. Should we add/update the preflight permissions e2e tests with a config example? (I am okay with just the unit tests as well)

Would would also have to add the preflight option in the configuration docs.

I'll create a new PR for the docs.

The unit tests cover the code as written. IMHO, an e2e would be more appropriate once a preflight check adds configuration settings; otherwise, the e2e would effectively be a duplicate test.

This adds configuration file support (`preflightRules`) for preflight
checks. Each preflight check must add a `SetConfig()` method to
accept configuration from the Preflight registry.

Signed-off-by: Todd Short <[email protected]>
@tmshort
Copy link
Contributor Author

tmshort commented Mar 26, 2024

Documentation PR: carvel-dev/carvel#740

Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you so much for the contribution ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add configuration support to kapp for preflight checks
3 participants