From 4e044602f4f2b7bdf61c7d6503cdf44cdd957c0b Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Thu, 17 Dec 2020 16:29:49 -0500 Subject: [PATCH] change how controller checks are handled (#454) * change how controller checks are handled * add changelog * simpler fix --- checks/multipleReplicasForDeployment.yaml | 19 +++++++------------ docs-md/changelog.md | 6 ++++++ pkg/kube/workload.go | 3 ++- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/checks/multipleReplicasForDeployment.yaml b/checks/multipleReplicasForDeployment.yaml index b2836fda..6c2a921d 100644 --- a/checks/multipleReplicasForDeployment.yaml +++ b/checks/multipleReplicasForDeployment.yaml @@ -8,19 +8,14 @@ controllers: schema: '$schema': http://json-schema.org/draft-07/schema type: object - required: - - Object + required: + - spec properties: - Object: + spec: type: object required: - - spec + - replicas properties: - spec: - type: object - required: - - replicas - properties: - replicas: - type: integer - minimum: 2 + replicas: + type: integer + minimum: 2 diff --git a/docs-md/changelog.md b/docs-md/changelog.md index 85cf8d62..c7485c8f 100644 --- a/docs-md/changelog.md +++ b/docs-md/changelog.md @@ -1,6 +1,12 @@ --- sidebarDepth: 0 --- +## Upcoming +* **Breaking** - fixed inconsistency in how controller-level checks are handled + +## 2.0.1 +* Fixed Polaris deployment process + ## 2.0.0 * Standardize categories of checks into Security, Reliability, and Efficiency * Changes to the dashboard UI diff --git a/pkg/kube/workload.go b/pkg/kube/workload.go index f4fe5e19..ad4b4149 100644 --- a/pkg/kube/workload.go +++ b/pkg/kube/workload.go @@ -136,7 +136,8 @@ func newGenericWorkload(ctx context.Context, podResource kubeAPICoreV1.Pod, dyna } if lastKey != "" { - bytes, err := json.Marshal(objectCache[lastKey]) + unst := objectCache[lastKey] + bytes, err := json.Marshal(&unst) if err != nil { return workload, err }