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 the capability for controller level checks #285

Merged
merged 6 commits into from
May 18, 2020

Conversation

baderbuddy
Copy link
Contributor

Brings along the JSON of the top level object. I also added a single check mostly for documentation purposes (but it could be a pretty useful check too)

@@ -1,4 +1,6 @@
checks:
# reliability
multipleReplicasForDeployment: warning
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this to examples/config-full.yaml?

I think there are legitimate reasons to only have 1 replica (e.g. the polaris dashboard itself runs with 1 replica), but we could add this as an "optional check".

I'd love to build up a big community-driven library of checks that people could opt in or out of.

@codecov
Copy link

codecov bot commented May 18, 2020

Codecov Report

Merging #285 into master will decrease coverage by 0.70%.
The diff coverage is 42.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #285      +/-   ##
==========================================
- Coverage   52.73%   52.02%   -0.71%     
==========================================
  Files          12       12              
  Lines         639      690      +51     
==========================================
+ Hits          337      359      +22     
- Misses        269      284      +15     
- Partials       33       47      +14     
Impacted Files Coverage Δ
pkg/config/schema.go 12.79% <0.00%> (-0.47%) ⬇️
pkg/kube/workload.go 27.53% <35.89%> (+4.45%) ⬆️
pkg/kube/resources.go 63.15% <43.47%> (-2.06%) ⬇️
pkg/validator/controller.go 76.66% <50.00%> (-4.82%) ⬇️
pkg/validator/schema.go 76.57% <61.11%> (-3.00%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de98d9f...2bfbf13. Read the comment docs.

Copy link
Contributor

@rbren rbren left a comment

Choose a reason for hiding this comment

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

Aside from one bit of refactoring, LGTM!

Thanks Bader! Excited to get this in for v1

@@ -124,6 +126,17 @@ func applyPodSchemaChecks(conf *config.Configuration, controller kube.GenericWor
if err != nil {
return nil, err
} else if check == nil {
check, err = resolveCheck(conf, checkID, controller, config.TargetController, false)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should go in its own function, applyControllerSchemaChecks, which could get called in pkg/validator/controller.go. That's similar to how we do both pod and container targets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh yeah that makes a lot of sense, I was thinking of it still as controller checks, but it's still explicitly not a podSchemaCheck.

@baderbuddy baderbuddy merged commit d50d9c8 into master May 18, 2020
@baderbuddy baderbuddy deleted the bb/controller-checks branch May 18, 2020 18:57
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.

None yet

2 participants