feature(lint): Add linter to priorityClassName #926
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 pull request introduces a new check for validating priority class names in Kubernetes objects. The changes include the addition of a new template, corresponding parameters, and test cases. The most important changes are summarized below:
Issues:
New Template and Parameters:
pkg/templates/priorityclassname/template.go
: Added a new templatepriority-class-name
to flag applications running with invalid priority class names.pkg/templates/priorityclassname/internal/params/gen-params.go
: Generated code for handling parameters related to the new template.pkg/templates/priorityclassname/internal/params/params.go
: Defined theParams
struct to hold the accepted priority class names.Test Cases:
pkg/templates/priorityclassname/template_test.go
: Added test cases to validate the new template for different scenarios, including valid, invalid, and empty priority class names.Configuration and Integration:
pkg/builtinchecks/yamls/priority-class-name.yaml
: Added a new check configuration forpriority-class-name
.pkg/templates/all/all.go
: Imported the new template to ensure it is included in the build.E2E Tests:
e2etests/bats-tests.sh
: Added an end-to-end test for the newpriority-class-name
check.tests/checks/priority-class-name.yaml
: Added YAML configurations for testing the new check.