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

INSIGHTS-156 - Fix typo and improve failure message #1055

Merged
merged 8 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ meta:

---

## unreleased
## 9.1.1
* Fix `hpaMinAvailability` failure message
* Fix `missingPodDisruptionBudget` typo
* Rewrite `hpaMaxAvailability` check to use go-template

## 9.1.0
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/checks/hpaMinAvailability.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
successMessage: HPA has a valid min replica configuration
failureMessage: HPA maxReplicas should be greater than minReplicas
failureMessage: HPA minReplicas should be 2 or more
category: Reliability
target: autoscaling/HorizontalPodAutoscaler
schema:
Expand Down
14 changes: 11 additions & 3 deletions pkg/config/checks/missingPodDisruptionBudget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,31 @@ category: Reliability
target: Controller
controllers:
include:
- Deployment
- Deployment
schema:
'$schema': http://json-schema.org/draft-07/schema
"$schema": http://json-schema.org/draft-07/schema#
type: object
properties:
spec:
type: object
properties:
template:
type: object
properites:
properties:
metadata:
type: object
properties:
labels:
type: object
minProperties: 1
required:
- labels
required:
- metadata
required:
- template
required:
- spec
additionalSchemaStrings:
policy/PodDisruptionBudget: |
type: object
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: zookeeper
spec:
template:
metadata:
labels: {} # empty labels
spec:
containers:
- name: zookeeper
image: zookeeper
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: zookeeper-pdb
spec:
minAvailable: 2
selector:
matchLabels:
app.kubernetes.io/name: zookeeper
21 changes: 21 additions & 0 deletions test/checks/missingPodDisruptionBudget/failure.no-labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: zookeeper
spec:
template:
metadata: {} # missing labels
spec:
containers:
- name: zookeeper
image: zookeeper
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: zookeeper-pdb
spec:
minAvailable: 2
selector:
matchLabels:
app.kubernetes.io/name: zookeeper
20 changes: 20 additions & 0 deletions test/checks/missingPodDisruptionBudget/failure.no-metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: zookeeper
spec:
template: # missing metadata
spec:
containers:
- name: zookeeper
image: zookeeper
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: zookeeper-pdb
spec:
minAvailable: 2
selector:
matchLabels:
app.kubernetes.io/name: zookeeper
Loading