From 5f1ef29f38175de9154b04e9ec0199b5133598fb Mon Sep 17 00:00:00 2001 From: Matheus Moraes Date: Tue, 28 Mar 2023 11:28:36 -0300 Subject: [PATCH 1/7] remove unnecessary ignored from addlicense cmd --- hack/make/misc.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/hack/make/misc.mk b/hack/make/misc.mk index bb2e421b..27a1096a 100644 --- a/hack/make/misc.mk +++ b/hack/make/misc.mk @@ -58,8 +58,6 @@ define addlicense-tool $(ADDLICENSE) \ -c "Undistro Authors" \ -l "apache" \ - -ignore "**/*.png" \ - -ignore "**/*.md" \ -ignore "**/*.css" \ -ignore "**/*.html" \ -ignore ".github/**" \ From af1d90fb57f0e6527c92826db83d5ab283a780ce Mon Sep 17 00:00:00 2001 From: Matheus Moraes Date: Tue, 28 Mar 2023 11:29:07 -0300 Subject: [PATCH 2/7] update docker-build-worker description from Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 789fb410..3d63482f 100644 --- a/Makefile +++ b/Makefile @@ -74,9 +74,9 @@ build: generate fmt vet ## Build manager binary. run: install manifests generate ## Run a controller from your host. go run ./main.go -default-plugins-names ${PLUGINS} -worker-image ${WORKER_IMG} -docker-build: test ## Build manager docker image. +docker-build: test ## Build manager Docker image. docker build -t ${IMG} -f ${DOCKERFILE} . -docker-build-worker: docker-build ## Build Docker images for all components. +docker-build-worker: ## Build worker Docker image. ${MAKE} IMG=${WORKER_IMG} DOCKERFILE=cmd/worker/Dockerfile docker-build From 50033a317b9279de87ea4d54c7e11ee2f3409c50 Mon Sep 17 00:00:00 2001 From: Matheus Moraes Date: Tue, 28 Mar 2023 11:29:55 -0300 Subject: [PATCH 3/7] reporting popeye cluster-scoped issues with no resources --- pkg/worker/report/popeye/parse.go | 30 ++++++++++----- pkg/worker/report/popeye/parse_test.go | 24 ++++++++++++ .../report/popeye/testdata/test_report_7.json | 37 +++++++++++++++++++ 3 files changed, 81 insertions(+), 10 deletions(-) create mode 100644 pkg/worker/report/popeye/testdata/test_report_7.json diff --git a/pkg/worker/report/popeye/parse.go b/pkg/worker/report/popeye/parse.go index d80292e4..08b0bab0 100644 --- a/pkg/worker/report/popeye/parse.go +++ b/pkg/worker/report/popeye/parse.go @@ -26,7 +26,13 @@ import ( zorav1a1 "github.com/undistro/zora/apis/zora/v1alpha1" ) -var msgre = regexp.MustCompile(`^\[(POP-\d+)\]\s*(.*)$`) +var ( + msgre = regexp.MustCompile(`^\[(POP-\d+)\]\s*(.*)$`) + clusterScopedTypes = map[string]bool{ + "Metrics": true, + "Version": true, + } +) // Extracts Popeye's issue code and description from the original issue // message, ensuring the returned description doesn't contain specific data @@ -61,6 +67,7 @@ func Parse(log logr.Logger, popr []byte) ([]*zorav1a1.ClusterIssueSpec, error) { } continue } + clusterScoped := clusterScopedTypes[typ] for _, iss := range issues { id, msg, err := prepareIdAndMsg(iss.Message) if err != nil { @@ -74,17 +81,20 @@ func Parse(log logr.Logger, popr []byte) ([]*zorav1a1.ClusterIssueSpec, error) { ci.Resources[san.GVR] = append(ci.Resources[san.GVR], typ) ci.TotalResources++ } else { - issuesmap[id] = &zorav1a1.ClusterIssueSpec{ - ID: id, - Message: msg, - Severity: LevelToIssueSeverity[iss.Level], - Category: IssueIDtoCategory[id], - Resources: map[string][]string{ - san.GVR: {typ}, - }, - TotalResources: 1, + spec := &zorav1a1.ClusterIssueSpec{ + ID: id, + Message: msg, + Severity: LevelToIssueSeverity[iss.Level], + Category: IssueIDtoCategory[id], Url: IssueIDtoUrl[id], + Resources: map[string][]string{}, + TotalResources: 0, + } + if !clusterScoped { + spec.TotalResources = 1 + spec.Resources = map[string][]string{san.GVR: {typ}} } + issuesmap[id] = spec } } } diff --git a/pkg/worker/report/popeye/parse_test.go b/pkg/worker/report/popeye/parse_test.go index 0788aa6a..0df05ab7 100644 --- a/pkg/worker/report/popeye/parse_test.go +++ b/pkg/worker/report/popeye/parse_test.go @@ -226,6 +226,30 @@ func TestParse(t *testing.T) { testrepname: "testdata/test_report_6.json", toerr: true, }, + { + description: "metrics-server issue", + testrepname: "testdata/test_report_7.json", + cispecs: []*zorav1a1.ClusterIssueSpec{ + { + ID: "POP-402", + Message: "No metrics-server detected", + Severity: "Low", + Category: "General", + Resources: map[string][]string{}, + TotalResources: 0, + Url: "https://kubernetes.io/docs/tasks/debug/debug-cluster/resource-metrics-pipeline/#metrics-server", + }, + { + ID: "POP-405", + Message: "Is this a jurassic cluster? Might want to upgrade K8s a bit", + Severity: "Medium", + Category: "General", + Resources: map[string][]string{}, + TotalResources: 0, + Url: "https://kubernetes.io/docs/tasks/administer-cluster/cluster-upgrade/", + }, + }, + }, } sfun := func(cis []*zorav1a1.ClusterIssueSpec) { diff --git a/pkg/worker/report/popeye/testdata/test_report_7.json b/pkg/worker/report/popeye/testdata/test_report_7.json new file mode 100644 index 00000000..a34e0a25 --- /dev/null +++ b/pkg/worker/report/popeye/testdata/test_report_7.json @@ -0,0 +1,37 @@ +{ + "popeye": { + "score": 13, + "grade": "F", + "sanitizers": [ + { + "sanitizer": "cluster", + "gvr": "cluster", + "tally": { + "ok": 1, + "info": 0, + "warning": 0, + "error": 0, + "score": 100 + }, + "issues": { + "Metrics": [ + { + "group": "__root__", + "gvr": "cluster", + "level": 1, + "message": "[POP-402] No metrics-server detected" + } + ], + "Version": [ + { + "group": "__root__", + "gvr": "cluster", + "level": 2, + "message": "[POP-405] Is this a jurassic cluster? Might want to upgrade K8s a bit" + } + ] + } + } + ] + } +} \ No newline at end of file From ae5d93a8bb5b17b2b41e375dd3327a05390c2db0 Mon Sep 17 00:00:00 2001 From: Matheus Moraes Date: Tue, 28 Mar 2023 14:39:20 -0300 Subject: [PATCH 4/7] add `clusterScoped` field on Issue, and remove unused code --- pkg/payloads/v1alpha1/clusters.go | 59 +---- pkg/payloads/v1alpha1/clusters_test.go | 127 +++------- pkg/payloads/v1alpha1/issues.go | 87 ++++--- pkg/payloads/v1alpha1/issues_test.go | 232 +++++++----------- .../clusterscan/all_plugins_active.yml | 75 ------ .../clusterscan/all_plugins_active_1st.yml | 59 ----- .../clusterscan/all_plugins_failed.yml | 71 ------ .../v1alpha1/testdata/clusterscan/next.yml | 49 ---- .../v1alpha1/testdata/clusterscan/ok.yml | 74 ------ .../plugins_active_and_complete.yml | 77 ------ .../clusterscan/plugins_active_and_failed.yml | 79 ------ .../plugins_complete_and_failed.yml | 68 ----- .../v1alpha1/testdata/clusterscan/suspend.yml | 77 ------ pkg/payloads/v1alpha1/testdata/payload/1.json | 27 +- .../v1alpha1/testdata/payload/10.json | 29 +-- pkg/payloads/v1alpha1/testdata/payload/2.json | 27 +- pkg/payloads/v1alpha1/testdata/payload/3.json | 27 +- pkg/payloads/v1alpha1/testdata/payload/4.json | 27 +- pkg/payloads/v1alpha1/testdata/payload/5.json | 27 +- pkg/payloads/v1alpha1/testdata/payload/6.json | 27 +- pkg/payloads/v1alpha1/testdata/payload/7.json | 27 +- pkg/payloads/v1alpha1/testdata/payload/8.json | 4 +- pkg/payloads/v1alpha1/testdata/payload/9.json | 27 +- 23 files changed, 181 insertions(+), 1202 deletions(-) delete mode 100644 pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_active.yml delete mode 100644 pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_active_1st.yml delete mode 100644 pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_failed.yml delete mode 100644 pkg/payloads/v1alpha1/testdata/clusterscan/next.yml delete mode 100644 pkg/payloads/v1alpha1/testdata/clusterscan/ok.yml delete mode 100644 pkg/payloads/v1alpha1/testdata/clusterscan/plugins_active_and_complete.yml delete mode 100644 pkg/payloads/v1alpha1/testdata/clusterscan/plugins_active_and_failed.yml delete mode 100644 pkg/payloads/v1alpha1/testdata/clusterscan/plugins_complete_and_failed.yml delete mode 100644 pkg/payloads/v1alpha1/testdata/clusterscan/suspend.yml diff --git a/pkg/payloads/v1alpha1/clusters.go b/pkg/payloads/v1alpha1/clusters.go index e862c96c..914189de 100644 --- a/pkg/payloads/v1alpha1/clusters.go +++ b/pkg/payloads/v1alpha1/clusters.go @@ -15,8 +15,6 @@ package v1alpha1 import ( - "strings" - batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -59,16 +57,11 @@ type PluginStatus struct { Schedule string `json:"schedule"` } -type NsName struct { +type NamespacedName struct { Name string `json:"name"` Namespace string `json:"namespace"` } -type ResourcedIssue struct { - Issue `json:",inline"` - Resources map[string][]NsName `json:"resources"` -} - type Resources struct { Discovered bool `json:"discovered"` Message string `json:"message"` @@ -138,27 +131,6 @@ func NewCluster(cluster v1alpha1.Cluster) Cluster { return cl } -//NewClusterWithScans returns a Cluster with pluginStatus and without issues -func NewClusterWithScans(cluster v1alpha1.Cluster, scans []v1alpha1.ClusterScan) Cluster { - cl := NewCluster(cluster) - ps, totalIssues := NewScanStatus(scans) - cl.PluginStatus = ps - cl.TotalIssues = totalIssues - return cl -} - -//NewClusterWithIssues returns a Cluster with pluginStatus and their issues -func NewClusterWithIssues(cluster v1alpha1.Cluster, scans []v1alpha1.ClusterScan, issues []v1alpha1.ClusterIssue) Cluster { - c := NewClusterWithScans(cluster, scans) - for _, i := range issues { - c.PluginStatus[i.Labels[v1alpha1.LabelPlugin]].Issues = append( - c.PluginStatus[i.Labels[v1alpha1.LabelPlugin]].Issues, - NewResourcedIssue(i), - ) - } - return c -} - func NewScanStatus(scans []v1alpha1.ClusterScan) (map[string]*PluginStatus, *int) { var pluginStatus map[string]*PluginStatus var totalIssues *int @@ -233,32 +205,3 @@ func NewScanStatusWithIssues(scans []v1alpha1.ClusterScan, issues []v1alpha1.Clu } return pluginStatus } - -func NewResourcedIssue(i v1alpha1.ClusterIssue) ResourcedIssue { - ri := ResourcedIssue{} - ri.Issue = NewIssue(i) - for r, narr := range i.Spec.Resources { - for _, nspacedn := range narr { - ns := strings.Split(nspacedn, "/") - if len(ns) == 1 { - ns = append([]string{""}, ns[0]) - } - if ri.Resources == nil { - ri.Resources = map[string][]NsName{ - r: {{ - Name: ns[1], - Namespace: ns[0], - }}, - } - } else { - ri.Resources[r] = append(ri.Resources[r], - NsName{ - Name: ns[1], - Namespace: ns[0], - }, - ) - } - } - } - return ri -} diff --git a/pkg/payloads/v1alpha1/clusters_test.go b/pkg/payloads/v1alpha1/clusters_test.go index 5aa0e222..665a2af9 100644 --- a/pkg/payloads/v1alpha1/clusters_test.go +++ b/pkg/payloads/v1alpha1/clusters_test.go @@ -21,120 +21,79 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/undistro/zora/apis/zora/v1alpha1" "sigs.k8s.io/yaml" + + "github.com/undistro/zora/apis/zora/v1alpha1" ) func TestNewCluster(t *testing.T) { - type args struct { - cluster string - scans []string - } tests := []struct { - name string - args args - want string + name string + cluster string + want string }{ { - name: "Cluster and ClusterScan OK", - args: args{ - cluster: "ok.yml", - scans: []string{"all_plugins_active.yml"}, - }, - want: "1.json", + name: "Cluster and ClusterScan OK", + cluster: "ok.yml", + want: "1.json", }, { - name: "Cluster disconnected since before and ClusterScan with all plugins failed", - args: args{ - cluster: "always_disconnected.yml", - scans: []string{"all_plugins_failed.yml"}, - }, - want: "2.json", + name: "Cluster disconnected since before and ClusterScan with all plugins failed", + cluster: "always_disconnected.yml", + want: "2.json", }, { - name: "Cluster without metrics and ClusterScan with all plugins active in the 1st scan", - args: args{ - cluster: "always_without_metrics.yml", - scans: []string{"all_plugins_active_1st.yml"}, - }, - want: "3.json", + name: "Cluster without metrics and ClusterScan with all plugins active in the 1st scan", + cluster: "always_without_metrics.yml", + want: "3.json", }, { - name: "Cluster currently disconnected and ClusterScan with Active and Failed plugins", - args: args{ - cluster: "disconnected.yml", - scans: []string{"plugins_active_and_failed.yml"}, - }, - want: "4.json", + name: "Cluster currently disconnected and ClusterScan with Active and Failed plugins", + cluster: "disconnected.yml", + want: "4.json", }, { - name: "Cluster currently without metrics and ClusterScan with Active and Complete plugins", - args: args{ - cluster: "without_metrics.yml", - scans: []string{"plugins_active_and_complete.yml"}, - }, - want: "5.json", + name: "Cluster currently without metrics and ClusterScan with Active and Complete plugins", + cluster: "without_metrics.yml", + want: "5.json", }, { - name: "Cluster without provider/region and ClusterScan OK", - args: args{ - cluster: "without_provider.yml", - scans: []string{"ok.yml"}, - }, - want: "6.json", + name: "Cluster without provider/region and ClusterScan OK", + cluster: "without_provider.yml", + want: "6.json", }, { - name: "Cluster currently without metrics and two ClusterScans", - args: args{ - cluster: "without_metrics.yml", - scans: []string{"plugins_complete_and_failed.yml", "next.yml"}, - }, - want: "7.json", + name: "Cluster currently without metrics and two ClusterScans", + cluster: "without_metrics.yml", + want: "7.json", }, { - name: "Cluster currently without metrics, provider, region and ClusterScan", - args: args{ - cluster: "without_provider_and_metrics.yml", - scans: []string{}, - }, - want: "8.json", + name: "Cluster currently without metrics, provider, region and ClusterScan", + cluster: "without_provider_and_metrics.yml", + want: "8.json", }, { - name: "Cluster currently without metrics and two ClusterScans with issues", - args: args{ - cluster: "without_metrics.yml", - scans: []string{"ok.yml", "plugins_active_and_complete.yml"}, - }, - want: "9.json", + name: "Cluster currently without metrics and two ClusterScans with issues", + cluster: "without_metrics.yml", + want: "9.json", }, { - name: "Cluster without provider/region and ClusterScan suspended", - args: args{ - cluster: "without_provider.yml", - scans: []string{"suspend.yml"}, - }, - want: "10.json", + name: "Cluster without provider/region and ClusterScan suspended", + cluster: "without_provider.yml", + want: "10.json", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - cluster, err := readCluster(tt.args.cluster) + cluster, err := readCluster(tt.cluster) if err != nil { t.Errorf("failed to load Cluster testdata: %v", err) } - scans := make([]v1alpha1.ClusterScan, 0, len(tt.args.scans)) - for _, s := range tt.args.scans { - if cs, err := readClusterScan(s); err != nil { - t.Errorf("failed to load ClusterScan testdata: %v", err) - } else { - scans = append(scans, cs) - } - } payload, err := readClusterPayload(tt.want) if err != nil { t.Errorf("failed to load Cluster payload testdata: %v", err) } - if got := NewClusterWithScans(cluster, scans); !reflect.DeepEqual(got, payload) { + if got := NewCluster(cluster); !reflect.DeepEqual(got, payload) { t.Errorf("NewCluster() = %s", cmp.Diff(got, payload)) } }) @@ -153,18 +112,6 @@ func readCluster(filename string) (v1alpha1.Cluster, error) { return c, err } -func readClusterScan(filename string) (v1alpha1.ClusterScan, error) { - b, err := os.ReadFile("testdata/clusterscan/" + filename) - var cs v1alpha1.ClusterScan - if err != nil { - return cs, err - } - if err := yaml.Unmarshal(b, &cs); err != nil { - return cs, err - } - return cs, err -} - func readClusterPayload(filename string) (Cluster, error) { b, err := os.ReadFile("testdata/payload/" + filename) var cp Cluster diff --git a/pkg/payloads/v1alpha1/issues.go b/pkg/payloads/v1alpha1/issues.go index 8e59e5f9..95a1e9b6 100644 --- a/pkg/payloads/v1alpha1/issues.go +++ b/pkg/payloads/v1alpha1/issues.go @@ -15,18 +15,25 @@ package v1alpha1 import ( + "strings" + "github.com/undistro/zora/apis/zora/v1alpha1" ) type Issue struct { - ApiVersion string `json:"apiVersion"` - ID string `json:"id"` - Message string `json:"message"` - Severity string `json:"severity"` - Category string `json:"category"` - Plugin string `json:"plugin"` - Clusters []ClusterReference `json:"clusters"` - Url string `json:"url"` + ApiVersion string `json:"apiVersion"` + ID string `json:"id"` + Message string `json:"message"` + Severity string `json:"severity"` + Category string `json:"category"` + Plugin string `json:"plugin"` + Url string `json:"url"` + ClusterScoped bool `json:"clusterScoped"` +} + +type ResourcedIssue struct { + Issue `json:",inline"` + Resources map[string][]NamespacedName `json:"resources"` } type ClusterReference struct { @@ -37,40 +44,42 @@ type ClusterReference struct { func NewIssue(clusterIssue v1alpha1.ClusterIssue) Issue { return Issue{ - ApiVersion: "v1alpha1", - ID: clusterIssue.Spec.ID, - Message: clusterIssue.Spec.Message, - Severity: string(clusterIssue.Spec.Severity), - Category: clusterIssue.Spec.Category, - Plugin: clusterIssue.Labels[v1alpha1.LabelPlugin], - Url: clusterIssue.Spec.Url, + ApiVersion: "v1alpha1", + ID: clusterIssue.Spec.ID, + Message: clusterIssue.Spec.Message, + Severity: string(clusterIssue.Spec.Severity), + Category: clusterIssue.Spec.Category, + Plugin: clusterIssue.Labels[v1alpha1.LabelPlugin], + Url: clusterIssue.Spec.Url, + ClusterScoped: len(clusterIssue.Spec.Resources) <= 0, } } -func NewIssues(clusterIssues []v1alpha1.ClusterIssue) []Issue { - issuesByID := make(map[string]*Issue) - clustersByIssue := make(map[string]map[string]*ClusterReference) - for _, clusterIssue := range clusterIssues { - clusterRef := &ClusterReference{ - Name: clusterIssue.Spec.Cluster, - Namespace: clusterIssue.Namespace, - TotalResources: clusterIssue.Spec.TotalResources, - } - newIssue := NewIssue(clusterIssue) - issueID := clusterIssue.Spec.ID - issuesByID[issueID] = &newIssue - if _, ok := clustersByIssue[issueID]; !ok { - clustersByIssue[issueID] = make(map[string]*ClusterReference) +func NewResourcedIssue(i v1alpha1.ClusterIssue) ResourcedIssue { + ri := ResourcedIssue{} + ri.Issue = NewIssue(i) + for r, narr := range i.Spec.Resources { + for _, nspacedn := range narr { + ns := strings.Split(nspacedn, "/") + if len(ns) == 1 { + ns = append([]string{""}, ns[0]) + } + if ri.Resources == nil { + ri.Resources = map[string][]NamespacedName{ + r: {{ + Name: ns[1], + Namespace: ns[0], + }}, + } + } else { + ri.Resources[r] = append(ri.Resources[r], + NamespacedName{ + Name: ns[1], + Namespace: ns[0], + }, + ) + } } - clustersByIssue[issueID][clusterRef.Name] = clusterRef - } - res := make([]Issue, 0, len(issuesByID)) - for id, i := range issuesByID { - for _, ref := range clustersByIssue[id] { - i.Clusters = append(i.Clusters, *ref) - } - - res = append(res, *i) } - return res + return ri } diff --git a/pkg/payloads/v1alpha1/issues_test.go b/pkg/payloads/v1alpha1/issues_test.go index 139df76e..2e8e9d93 100644 --- a/pkg/payloads/v1alpha1/issues_test.go +++ b/pkg/payloads/v1alpha1/issues_test.go @@ -16,162 +16,108 @@ package v1alpha1 import ( "reflect" - "sort" "testing" "github.com/google/go-cmp/cmp" - "github.com/undistro/zora/apis/zora/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/undistro/zora/apis/zora/v1alpha1" ) -func TestNewIssues(t *testing.T) { - type args struct { - issues []v1alpha1.ClusterIssue - } +func TestNewResourcedIssue(t *testing.T) { tests := []struct { - name string - args args - want []Issue + name string + clusterIssue v1alpha1.ClusterIssue + want ResourcedIssue }{ { - name: "OK", - args: args{ - issues: []v1alpha1.ClusterIssue{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: "prd1-pop-106-123", - Namespace: "prd", - Labels: map[string]string{ - v1alpha1.LabelScanID: "123", - }, - }, - Spec: v1alpha1.ClusterIssueSpec{ - Cluster: "prd1", - ID: "POP-106", - Message: "No resources requests/limits defined", - Severity: "Medium", - Category: "Category", - TotalResources: 10, - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Name: "prd1-pop-106-456", - Namespace: "prd", - Labels: map[string]string{ - v1alpha1.LabelScanID: "456", - }, - }, - Spec: v1alpha1.ClusterIssueSpec{ - Cluster: "prd1", - ID: "POP-106", - Message: "No resources requests/limits defined", - Severity: "Medium", - Category: "Category", - TotalResources: 10, - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Name: "prd2-pop-777-123", - Namespace: "prd", - }, - Spec: v1alpha1.ClusterIssueSpec{ - Cluster: "prd2", - ID: "POP-777", - Message: "Message", - Severity: "Medium", - Category: "Category", - TotalResources: 7, - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Name: "hml1-pop-106-123", - Namespace: "hml", - }, - Spec: v1alpha1.ClusterIssueSpec{ - Cluster: "hml1", - ID: "POP-106", - Message: "No resources requests/limits defined", - Severity: "Medium", - Category: "Category", - TotalResources: 17, - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Name: "dev1-pop-106-123", - Namespace: "dev", - }, - Spec: v1alpha1.ClusterIssueSpec{ - Cluster: "dev1", - ID: "POP-106", - Message: "No resources requests/limits defined", - Severity: "Medium", - Category: "Category", - TotalResources: 71, - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Name: "dev2-pop-777-123", - Namespace: "dev", - }, - Spec: v1alpha1.ClusterIssueSpec{ - Cluster: "dev2", - ID: "POP-777", - Message: "Message", - Severity: "Medium", - Category: "Category", - TotalResources: 27, - }, + name: "POP-402", + clusterIssue: v1alpha1.ClusterIssue{ + ObjectMeta: metav1.ObjectMeta{ + Name: "prd-pop-402-123", + Namespace: "prd", + }, + Spec: v1alpha1.ClusterIssueSpec{ + Cluster: "prd", + ID: "POP-402", + Message: "No metrics-server detected", + Severity: "Low", + Category: "General", + TotalResources: 0, + Resources: nil, + }, + }, + want: ResourcedIssue{ + Issue: Issue{ + ApiVersion: "v1alpha1", + ID: "POP-402", + Message: "No metrics-server detected", + Severity: "Low", + Category: "General", + ClusterScoped: true, + }, + }, + }, + { + name: "POP-405", + clusterIssue: v1alpha1.ClusterIssue{ + ObjectMeta: metav1.ObjectMeta{ + Name: "prd-pop-405-123", + Namespace: "prd", + }, + Spec: v1alpha1.ClusterIssueSpec{ + Cluster: "prd", + ID: "POP-405", + Message: "Is this a jurassic cluster? Might want to upgrade K8s a bit", + Severity: "Medium", + Category: "General", + TotalResources: 0, + Resources: map[string][]string{}, + }, + }, + want: ResourcedIssue{ + Issue: Issue{ + ApiVersion: "v1alpha1", + ID: "POP-405", + Message: "Is this a jurassic cluster? Might want to upgrade K8s a bit", + Severity: "Medium", + Category: "General", + ClusterScoped: true, + }, + }, + }, + { + name: "POP-106", + clusterIssue: v1alpha1.ClusterIssue{ + ObjectMeta: metav1.ObjectMeta{ + Name: "prd-pop-106-123", + Namespace: "prd", + Labels: map[string]string{v1alpha1.LabelScanID: "123"}, + }, + Spec: v1alpha1.ClusterIssueSpec{ + Cluster: "prd", + ID: "POP-106", + Message: "No resources requests/limits defined", + Severity: "Medium", + Category: "Category", + Url: "https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", + TotalResources: 1, + Resources: map[string][]string{ + "apps/v1/deployments": {"ns/dep1"}, }, }, }, - want: []Issue{ - { + want: ResourcedIssue{ + Issue: Issue{ ApiVersion: "v1alpha1", ID: "POP-106", Message: "No resources requests/limits defined", Severity: "Medium", Category: "Category", - Clusters: []ClusterReference{ - { - Name: "dev1", - Namespace: "dev", - TotalResources: 71, - }, - { - Name: "hml1", - Namespace: "hml", - TotalResources: 17, - }, - { - Name: "prd1", - Namespace: "prd", - TotalResources: 10, - }, - }, + Url: "https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", }, - { - ApiVersion: "v1alpha1", - ID: "POP-777", - Message: "Message", - Severity: "Medium", - Category: "Category", - Clusters: []ClusterReference{ - { - Name: "dev2", - Namespace: "dev", - TotalResources: 27, - }, - { - Name: "prd2", - Namespace: "prd", - TotalResources: 7, - }, - }, + Resources: map[string][]NamespacedName{ + "apps/v1/deployments": {NamespacedName{Name: "dep1", Namespace: "ns"}}, }, }, }, @@ -179,15 +125,7 @@ func TestNewIssues(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got := NewIssues(tt.args.issues) - sort.Slice(got, func(i, j int) bool { - return got[i].ID < got[j].ID - }) - for _, issue := range got { - sort.Slice(issue.Clusters, func(i, j int) bool { - return issue.Clusters[i].Name < issue.Clusters[j].Name - }) - } + got := NewResourcedIssue(tt.clusterIssue) if !reflect.DeepEqual(got, tt.want) { t.Errorf("NewIssues() = %s", cmp.Diff(got, tt.want)) } diff --git a/pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_active.yml b/pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_active.yml deleted file mode 100644 index 5cfec6d9..00000000 --- a/pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_active.yml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 2022 Undistro Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ClusterScan with all plugins currently Active and last successful scan -# 21:45 -> Complete (all plugins) -# 22:45 -> Active (NOW) -# 23:45 -> Next - -apiVersion: zora.undistro.io/v1alpha1 -kind: ClusterScan -metadata: - name: myclusterscan - namespace: ns - labels: - cluster: mycluster - ownerReferences: - - apiVersion: zora.undistro.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: Cluster - name: mycluster - uid: 9f8832e8-d20f-4f39-a4e3-c2a2d6e9e114 -spec: - clusterRef: - name: mycluster - schedule: "45 * * * *" -status: - conditions: - - type: Ready - status: "True" - reason: 'ClusterScanReconciled' - lastTransitionTime: '2022-07-05T12:02:54Z' - message: 'cluster scan successfully configured for plugins: plugin2,popeye' - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T21:47:00Z" - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Active - lastSuccessfulTime: "2022-08-04T21:47:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - observedGeneration: 3 - pluginNames: plugin2,popeye - plugins: - popeye: - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T21:46:00Z" - lastScanID: af8fc113-8b95-4cec-8f6b-b22472652d7b - lastSuccessfulScanID: af8fc113-8b95-4cec-8f6b-b22472652d7b - lastSuccessfulTime: "2022-08-04T21:46:00Z" - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Active - nextScheduleTime: "2022-08-04T23:45:00Z" - issueCount: 32 - plugin2: - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T21:47:00Z" - lastScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastSuccessfulScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastSuccessfulTime: "2022-08-04T21:47:00Z" - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Active - nextScheduleTime: "2022-08-04T23:45:00Z" - issueCount: 30 - suspend: false - totalIssues: 62 diff --git a/pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_active_1st.yml b/pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_active_1st.yml deleted file mode 100644 index c37aea89..00000000 --- a/pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_active_1st.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2022 Undistro Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ClusterScan with all plugins Active on the first scan -# 22:30 -> Create ClusterScan (every 45 minutes) -# 22:45 -> Active (NOW) -# 23:45 -> Next - -apiVersion: zora.undistro.io/v1alpha1 -kind: ClusterScan -metadata: - name: myclusterscan - namespace: ns - labels: - cluster: mycluster - ownerReferences: - - apiVersion: zora.undistro.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: Cluster - name: mycluster - uid: 9f8832e8-d20f-4f39-a4e3-c2a2d6e9e114 -spec: - clusterRef: - name: mycluster - schedule: "45 * * * *" -status: - conditions: - - type: Ready - status: "True" - reason: 'ClusterScanReconciled' - lastTransitionTime: '2022-07-05T12:02:54Z' - message: 'cluster scan successfully configured for plugins: plugin2,popeye' - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Active - nextScheduleTime: "2022-08-04T23:45:00Z" - observedGeneration: 3 - pluginNames: plugin2,popeye - plugins: - popeye: - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Active - nextScheduleTime: "2022-08-04T23:45:00Z" - plugin2: - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Active - nextScheduleTime: "2022-08-04T23:45:00Z" - suspend: false diff --git a/pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_failed.yml b/pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_failed.yml deleted file mode 100644 index 0db049ba..00000000 --- a/pkg/payloads/v1alpha1/testdata/clusterscan/all_plugins_failed.yml +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2022 Undistro Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ClusterScan with all plugins Failed -# 21:45 -> Failed (all) -# 22:45 -> -# 22:46 -> popeye -> Failed -# 22:47 -> plugin2 -> Failed (LAST FINISHED SCAN + NOW) -# 23:45 -> Next - -apiVersion: zora.undistro.io/v1alpha1 -kind: ClusterScan -metadata: - name: myclusterscan - namespace: ns - labels: - cluster: mycluster - ownerReferences: - - apiVersion: zora.undistro.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: Cluster - name: mycluster - uid: 9f8832e8-d20f-4f39-a4e3-c2a2d6e9e114 -spec: - clusterRef: - name: mycluster - schedule: "45 * * * *" -status: - conditions: - - type: Ready - status: "True" - reason: 'ClusterScanReconciled' - lastTransitionTime: '2022-07-05T12:02:54Z' - message: 'cluster scan successfully configured for plugins: plugin2,popeye' - lastFinishedStatus: Failed - lastFinishedTime: "2022-08-04T22:47:00Z" - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Failed - nextScheduleTime: "2022-08-04T23:45:00Z" - observedGeneration: 3 - pluginNames: plugin2,popeye - plugins: - popeye: - lastFinishedStatus: Failed - lastFinishedTime: "2022-08-04T22:46:00Z" - lastScanID: af8fc113-8b95-4cec-8f6b-b22472652d7b - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Failed - nextScheduleTime: "2022-08-04T23:45:00Z" - lastErrorMsg: 'Get "http://localhost:8081/version?timeout=30s": dial tcp 127.0.0.1:8081: connect: connection refused' - plugin2: - lastFinishedStatus: Failed - lastFinishedTime: "2022-08-04T22:47:00Z" - lastScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Failed - nextScheduleTime: "2022-08-04T23:45:00Z" - lastErrorMsg: 'failed to discover API server information. error: Get "https://35.236.51.220/version?timeout=32s": x509: certificate signed by unknown authority' - suspend: false diff --git a/pkg/payloads/v1alpha1/testdata/clusterscan/next.yml b/pkg/payloads/v1alpha1/testdata/clusterscan/next.yml deleted file mode 100644 index e95c7815..00000000 --- a/pkg/payloads/v1alpha1/testdata/clusterscan/next.yml +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2022 Undistro Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ClusterScan never executed before -# 00:45 -> Next - -apiVersion: zora.undistro.io/v1alpha1 -kind: ClusterScan -metadata: - name: myclusterscan - namespace: ns - labels: - cluster: mycluster - ownerReferences: - - apiVersion: zora.undistro.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: Cluster - name: mycluster - uid: 9f8832e8-d20f-4f39-a4e3-c2a2d6e9e114 -spec: - clusterRef: - name: mycluster - schedule: "45 * * * *" -status: - conditions: - - type: Ready - status: "True" - reason: 'ClusterScanReconciled' - lastTransitionTime: '2022-07-05T12:02:54Z' - message: 'cluster scan successfully configured for plugins: popeye' - nextScheduleTime: "2024-08-05T00:45:00Z" - observedGeneration: 1 - pluginNames: popeye - plugins: - popeye: - nextScheduleTime: "2024-08-05T00:45:00Z" - suspend: false diff --git a/pkg/payloads/v1alpha1/testdata/clusterscan/ok.yml b/pkg/payloads/v1alpha1/testdata/clusterscan/ok.yml deleted file mode 100644 index adfb9d4f..00000000 --- a/pkg/payloads/v1alpha1/testdata/clusterscan/ok.yml +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 2022 Undistro Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ClusterScan OK -# 22:45 -> Complete (NOW) -# 23:45 -> Next - -apiVersion: zora.undistro.io/v1alpha1 -kind: ClusterScan -metadata: - name: myclusterscan - namespace: ns - labels: - cluster: mycluster - ownerReferences: - - apiVersion: zora.undistro.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: Cluster - name: mycluster - uid: 9f8832e8-d20f-4f39-a4e3-c2a2d6e9e114 -spec: - clusterRef: - name: mycluster - schedule: "45 * * * *" -status: - conditions: - - type: Ready - status: "True" - reason: 'ClusterScanReconciled' - lastTransitionTime: '2022-07-05T12:02:54Z' - message: 'cluster scan successfully configured for plugins: plugin2,popeye' - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T22:47:00Z" - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Complete - lastSuccessfulTime: "2022-08-04T22:47:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - observedGeneration: 3 - pluginNames: plugin2,popeye - plugins: - popeye: - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T22:46:00Z" - lastScanID: af8fc113-8b95-4cec-8f6b-b22472652d7b - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Complete - lastSuccessfulScanID: af8fc113-8b95-4cec-8f6b-b22472652d7b - lastSuccessfulTime: "2022-08-04T22:46:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - issueCount: 32 - plugin2: - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T22:47:00Z" - lastScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Complete - lastSuccessfulScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastSuccessfulTime: "2022-08-04T22:47:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - issueCount: 30 - suspend: false - totalIssues: 62 diff --git a/pkg/payloads/v1alpha1/testdata/clusterscan/plugins_active_and_complete.yml b/pkg/payloads/v1alpha1/testdata/clusterscan/plugins_active_and_complete.yml deleted file mode 100644 index 172eb561..00000000 --- a/pkg/payloads/v1alpha1/testdata/clusterscan/plugins_active_and_complete.yml +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2022 Undistro Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ClusterScan with Active and Complete plugins -# 21:45 -> Complete (all plugins) -# 22:45 -> -# 22:46 -> popeye -> Complete -# 22:47 -> plugin2 -> Active (NOW) -# 23:45 -> Next - -apiVersion: zora.undistro.io/v1alpha1 -kind: ClusterScan -metadata: - name: myclusterscan - namespace: ns - labels: - cluster: mycluster - ownerReferences: - - apiVersion: zora.undistro.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: Cluster - name: mycluster - uid: 9f8832e8-d20f-4f39-a4e3-c2a2d6e9e114 -spec: - clusterRef: - name: mycluster - schedule: "45 * * * *" -status: - conditions: - - type: Ready - status: "True" - reason: 'ClusterScanReconciled' - lastTransitionTime: '2022-07-05T12:02:54Z' - message: 'cluster scan successfully configured for plugins: plugin2,popeye' - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T22:46:00Z" - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Active - lastSuccessfulTime: "2022-08-04T22:46:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - observedGeneration: 3 - pluginNames: plugin2,popeye - plugins: - popeye: - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T22:46:00Z" - lastScanID: af8fc113-8b95-4cec-8f6b-b22472652d7b - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Complete - lastSuccessfulScanID: af8fc113-8b95-4cec-8f6b-b22472652d7b - lastSuccessfulTime: "2022-08-04T22:46:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - issueCount: 32 - plugin2: - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T21:47:00Z" - lastScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Active - lastSuccessfulScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastSuccessfulTime: "2022-08-04T21:47:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - issueCount: 30 - suspend: false - totalIssues: 62 diff --git a/pkg/payloads/v1alpha1/testdata/clusterscan/plugins_active_and_failed.yml b/pkg/payloads/v1alpha1/testdata/clusterscan/plugins_active_and_failed.yml deleted file mode 100644 index 6bd41e08..00000000 --- a/pkg/payloads/v1alpha1/testdata/clusterscan/plugins_active_and_failed.yml +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright 2022 Undistro Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ClusterScan with Active and Failed plugins -# 21:45 -> -# 21:46 -> popeye -> Failed -# 21:47 -> plugin2 -> Complete (LAST SUCCESSFUL SCAN) -# 22:45 -> -# 22:46 -> popeye -> Failed (LAST FINISHED SCAN) -# 22:47 -> plugin2 -> Active (NOW) -# 23:45 -> Next - -apiVersion: zora.undistro.io/v1alpha1 -kind: ClusterScan -metadata: - name: myclusterscan - namespace: ns - labels: - cluster: mycluster - ownerReferences: - - apiVersion: zora.undistro.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: Cluster - name: mycluster - uid: 9f8832e8-d20f-4f39-a4e3-c2a2d6e9e114 -spec: - clusterRef: - name: mycluster - schedule: "45 * * * *" -status: - conditions: - - type: Ready - status: "True" - reason: 'ClusterScanReconciled' - lastTransitionTime: '2022-07-05T12:02:54Z' - message: 'cluster scan successfully configured for plugins: plugin2,popeye' - lastFinishedStatus: Failed - lastFinishedTime: "2022-08-04T22:46:00Z" - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Active - lastSuccessfulTime: "2022-08-04T21:47:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - observedGeneration: 3 - pluginNames: plugin2,popeye - plugins: - popeye: - lastFinishedStatus: Failed - lastFinishedTime: "2022-08-04T22:46:00Z" - lastScanID: af8fc113-8b95-4cec-8f6b-b22472652d7b - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Failed - lastSuccessfulScanID: 2d129cf8-7516-4f4e-b3f3-eecd57584073 - lastSuccessfulTime: "2022-08-04T20:46:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - lastErrorMsg: 'the server has asked for the client to provide credentials' - plugin2: - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T21:47:00Z" - lastScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Active - lastSuccessfulScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastSuccessfulTime: "2022-08-04T21:47:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - issueCount: 62 - suspend: false - totalIssues: 62 diff --git a/pkg/payloads/v1alpha1/testdata/clusterscan/plugins_complete_and_failed.yml b/pkg/payloads/v1alpha1/testdata/clusterscan/plugins_complete_and_failed.yml deleted file mode 100644 index d7d4aa7c..00000000 --- a/pkg/payloads/v1alpha1/testdata/clusterscan/plugins_complete_and_failed.yml +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 2022 Undistro Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ClusterScan with Complete and Failed plugins -# 21:00 -> -# 21:03 -> popeye -> Complete (LAST SUCCESSFUL SCAN) -# 21:03 -> plugin2 -> Failed (LAST FINISHED SCAN) -# 22:00 -> Next - -apiVersion: zora.undistro.io/v1alpha1 -kind: ClusterScan -metadata: - labels: - cluster: mycluster - name: myclusterscan - namespace: ns -spec: - clusterRef: - name: harbor - schedule: "0 12-22 * * 1-5" -status: - conditions: - - lastTransitionTime: "2022-06-28T12:56:38Z" - message: 'cluster scan successfully configured for plugins: plugin2,popeye' - observedGeneration: 3 - reason: ClusterScanReconciled - status: "True" - type: Ready - lastFinishedStatus: Failed - lastFinishedTime: "2022-08-08T21:00:03Z" - lastScheduleTime: "2022-08-08T21:00:00Z" - lastStatus: Failed - lastSuccessfulTime: "2022-08-08T21:00:03Z" - nextScheduleTime: "2022-08-08T22:00:00Z" - observedGeneration: 3 - pluginNames: plugin2,popeye - plugins: - popeye: - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-08T21:00:03Z" - lastScanID: 9da315be-b5a1-4f1a-952b-915cc19fe446 - lastScheduleTime: "2022-08-08T21:00:00Z" - lastStatus: Complete - lastSuccessfulScanID: 9da315be-b5a1-4f1a-952b-915cc19fe446 - lastSuccessfulTime: "2022-08-08T21:00:03Z" - nextScheduleTime: "2022-08-08T22:00:00Z" - issueCount: 21 - plugin2: - lastFinishedStatus: Failed - lastFinishedTime: "2022-08-08T21:00:03Z" - lastScanID: ce34e6fc-768d-49d0-91b5-65df89ed147d - lastScheduleTime: "2022-08-08T21:00:00Z" - lastStatus: Failed - nextScheduleTime: "2022-08-08T22:00:00Z" - lastErrorMsg: 'failed to discover API server information. error: the server has asked for the client to provide credentials' - suspend: false - totalIssues: 21 diff --git a/pkg/payloads/v1alpha1/testdata/clusterscan/suspend.yml b/pkg/payloads/v1alpha1/testdata/clusterscan/suspend.yml deleted file mode 100644 index 1e8d2af5..00000000 --- a/pkg/payloads/v1alpha1/testdata/clusterscan/suspend.yml +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2022 Undistro Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ClusterScan OK -# 22:45 -> Complete (NOW) -# 23:45 -> Next - -apiVersion: zora.undistro.io/v1alpha1 -kind: ClusterScan -metadata: - name: myclusterscan - namespace: ns - labels: - cluster: mycluster - ownerReferences: - - apiVersion: zora.undistro.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: Cluster - name: mycluster - uid: 9f8832e8-d20f-4f39-a4e3-c2a2d6e9e114 -spec: - clusterRef: - name: mycluster - schedule: "45 * * * *" - suspend: true -status: - conditions: - - type: Ready - status: "True" - reason: 'ClusterScanReconciled' - lastTransitionTime: '2022-07-05T12:02:54Z' - message: 'cluster scan successfully configured for plugins: plugin2,popeye' - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T22:47:00Z" - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Complete - lastSuccessfulTime: "2022-08-04T22:47:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - observedGeneration: 3 - pluginNames: plugin2,popeye - plugins: - popeye: - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T22:46:00Z" - lastScanID: af8fc113-8b95-4cec-8f6b-b22472652d7b - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Complete - lastSuccessfulScanID: af8fc113-8b95-4cec-8f6b-b22472652d7b - lastSuccessfulTime: "2022-08-04T22:46:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - issueCount: 32 - suspend: true - plugin2: - lastFinishedStatus: Complete - lastFinishedTime: "2022-08-04T22:47:00Z" - lastScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastScheduleTime: "2022-08-04T22:45:00Z" - lastStatus: Complete - lastSuccessfulScanID: b08a1ed0-a0e3-43c8-b99c-8378acfb92ec - lastSuccessfulTime: "2022-08-04T22:47:00Z" - nextScheduleTime: "2022-08-04T23:45:00Z" - issueCount: 30 - suspend: true - suspend: false - totalIssues: 62 diff --git a/pkg/payloads/v1alpha1/testdata/payload/1.json b/pkg/payloads/v1alpha1/testdata/payload/1.json index f43bc19b..23827720 100644 --- a/pkg/payloads/v1alpha1/testdata/payload/1.json +++ b/pkg/payloads/v1alpha1/testdata/payload/1.json @@ -25,30 +25,5 @@ "usagePercentage": 3 } }, - "creationTimestamp": "2022-05-02T18:36:36Z", - "totalIssues": 62, - "pluginStatus": { - "plugin2": { - "scan": { - "status": "scanned", - "message": "" - }, - "issueCount": 30, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T21:47:00Z", - "lastFinishedScanTime": "2022-08-04T21:47:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - }, - "popeye": { - "scan": { - "status": "scanned", - "message": "" - }, - "issueCount": 32, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T21:47:00Z", - "lastFinishedScanTime": "2022-08-04T21:47:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - } - } + "creationTimestamp": "2022-05-02T18:36:36Z" } \ No newline at end of file diff --git a/pkg/payloads/v1alpha1/testdata/payload/10.json b/pkg/payloads/v1alpha1/testdata/payload/10.json index e9808e17..7e069c0d 100644 --- a/pkg/payloads/v1alpha1/testdata/payload/10.json +++ b/pkg/payloads/v1alpha1/testdata/payload/10.json @@ -25,32 +25,5 @@ "usagePercentage": 3 } }, - "creationTimestamp": "2022-05-02T18:36:36Z", - "totalIssues": 62, - "pluginStatus": { - "plugin2": { - "scan": { - "status": "scanned", - "message": "", - "suspend": true - }, - "issueCount": 30, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T22:47:00Z", - "lastFinishedScanTime": "2022-08-04T22:47:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - }, - "popeye": { - "scan": { - "status": "scanned", - "message": "", - "suspend": true - }, - "issueCount": 32, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T22:47:00Z", - "lastFinishedScanTime": "2022-08-04T22:47:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - } - } + "creationTimestamp": "2022-05-02T18:36:36Z" } diff --git a/pkg/payloads/v1alpha1/testdata/payload/2.json b/pkg/payloads/v1alpha1/testdata/payload/2.json index 5bcc5037..76c51ca0 100644 --- a/pkg/payloads/v1alpha1/testdata/payload/2.json +++ b/pkg/payloads/v1alpha1/testdata/payload/2.json @@ -17,30 +17,5 @@ "memory": null, "cpu": null }, - "creationTimestamp": null, - "totalIssues": null, - "pluginStatus": { - "plugin2": { - "scan": { - "status": "failed", - "message": "failed to discover API server information. error: Get \"https://35.236.51.220/version?timeout=32s\": x509: certificate signed by unknown authority" - }, - "issueCount": null, - "issues": null, - "lastSuccessfulScanTime": null, - "lastFinishedScanTime": "2022-08-04T22:47:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - }, - "popeye": { - "scan": { - "status": "failed", - "message": "Get \"http://localhost:8081/version?timeout=30s\": dial tcp 127.0.0.1:8081: connect: connection refused" - }, - "issueCount": null, - "issues": null, - "lastSuccessfulScanTime": null, - "lastFinishedScanTime": "2022-08-04T22:47:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - } - } + "creationTimestamp": null } \ No newline at end of file diff --git a/pkg/payloads/v1alpha1/testdata/payload/3.json b/pkg/payloads/v1alpha1/testdata/payload/3.json index 56112b66..2b6a0174 100644 --- a/pkg/payloads/v1alpha1/testdata/payload/3.json +++ b/pkg/payloads/v1alpha1/testdata/payload/3.json @@ -17,30 +17,5 @@ "memory": null, "cpu": null }, - "creationTimestamp": "2022-05-02T18:36:36Z", - "totalIssues": null, - "pluginStatus": { - "plugin2": { - "scan": { - "status": "unknown", - "message": "Scan not finished" - }, - "issueCount": null, - "issues": null, - "lastSuccessfulScanTime": null, - "lastFinishedScanTime": null, - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - }, - "popeye": { - "scan": { - "status": "unknown", - "message": "Scan not finished" - }, - "issueCount": null, - "issues": null, - "lastSuccessfulScanTime": null, - "lastFinishedScanTime": null, - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - } - } + "creationTimestamp": "2022-05-02T18:36:36Z" } \ No newline at end of file diff --git a/pkg/payloads/v1alpha1/testdata/payload/4.json b/pkg/payloads/v1alpha1/testdata/payload/4.json index 946af8e4..4722bad6 100644 --- a/pkg/payloads/v1alpha1/testdata/payload/4.json +++ b/pkg/payloads/v1alpha1/testdata/payload/4.json @@ -25,30 +25,5 @@ "usagePercentage": 3 } }, - "creationTimestamp": "2022-05-02T18:36:36Z", - "totalIssues": 62, - "pluginStatus": { - "plugin2": { - "scan": { - "status": "scanned", - "message": "" - }, - "issueCount": 62, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T21:47:00Z", - "lastFinishedScanTime": "2022-08-04T22:46:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - }, - "popeye": { - "scan": { - "status": "failed", - "message": "the server has asked for the client to provide credentials" - }, - "issueCount": null, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T21:47:00Z", - "lastFinishedScanTime": "2022-08-04T22:46:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - } - } + "creationTimestamp": "2022-05-02T18:36:36Z" } \ No newline at end of file diff --git a/pkg/payloads/v1alpha1/testdata/payload/5.json b/pkg/payloads/v1alpha1/testdata/payload/5.json index 9b93a3f0..aedba290 100644 --- a/pkg/payloads/v1alpha1/testdata/payload/5.json +++ b/pkg/payloads/v1alpha1/testdata/payload/5.json @@ -25,30 +25,5 @@ "usagePercentage": 3 } }, - "creationTimestamp": "2022-05-02T18:36:36Z", - "totalIssues": 62, - "pluginStatus": { - "plugin2": { - "scan": { - "status": "scanned", - "message": "" - }, - "issueCount": 30, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T22:46:00Z", - "lastFinishedScanTime": "2022-08-04T22:46:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - }, - "popeye": { - "scan": { - "status": "scanned", - "message": "" - }, - "issueCount": 32, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T22:46:00Z", - "lastFinishedScanTime": "2022-08-04T22:46:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - } - } + "creationTimestamp": "2022-05-02T18:36:36Z" } \ No newline at end of file diff --git a/pkg/payloads/v1alpha1/testdata/payload/6.json b/pkg/payloads/v1alpha1/testdata/payload/6.json index 4745dcb9..7e391208 100644 --- a/pkg/payloads/v1alpha1/testdata/payload/6.json +++ b/pkg/payloads/v1alpha1/testdata/payload/6.json @@ -25,30 +25,5 @@ "usagePercentage": 3 } }, - "creationTimestamp": "2022-05-02T18:36:36Z", - "totalIssues": 62, - "pluginStatus": { - "plugin2": { - "scan": { - "status": "scanned", - "message": "" - }, - "issueCount": 30, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T22:47:00Z", - "lastFinishedScanTime": "2022-08-04T22:47:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - }, - "popeye": { - "scan": { - "status": "scanned", - "message": "" - }, - "issueCount": 32, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T22:47:00Z", - "lastFinishedScanTime": "2022-08-04T22:47:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - } - } + "creationTimestamp": "2022-05-02T18:36:36Z" } \ No newline at end of file diff --git a/pkg/payloads/v1alpha1/testdata/payload/7.json b/pkg/payloads/v1alpha1/testdata/payload/7.json index f5997188..aedba290 100644 --- a/pkg/payloads/v1alpha1/testdata/payload/7.json +++ b/pkg/payloads/v1alpha1/testdata/payload/7.json @@ -25,30 +25,5 @@ "usagePercentage": 3 } }, - "creationTimestamp": "2022-05-02T18:36:36Z", - "totalIssues": 21, - "pluginStatus": { - "plugin2": { - "scan": { - "status": "failed", - "message": "failed to discover API server information. error: the server has asked for the client to provide credentials" - }, - "issueCount": null, - "issues": null, - "lastSuccessfulScanTime": "2022-08-08T21:00:03Z", - "lastFinishedScanTime": "2022-08-08T21:00:03Z", - "nextScheduleScanTime": "2022-08-08T22:00:00Z" - }, - "popeye": { - "scan": { - "status": "scanned", - "message": "Scan not finished" - }, - "issueCount": 21, - "issues": null, - "lastSuccessfulScanTime": "2022-08-08T21:00:03Z", - "lastFinishedScanTime": "2022-08-08T21:00:03Z", - "nextScheduleScanTime": "2022-08-08T22:00:00Z" - } - } + "creationTimestamp": "2022-05-02T18:36:36Z" } \ No newline at end of file diff --git a/pkg/payloads/v1alpha1/testdata/payload/8.json b/pkg/payloads/v1alpha1/testdata/payload/8.json index 13c1b986..691187fa 100644 --- a/pkg/payloads/v1alpha1/testdata/payload/8.json +++ b/pkg/payloads/v1alpha1/testdata/payload/8.json @@ -13,7 +13,5 @@ "resources": { "discovered": false, "message": "metrics API not available" - }, - "totalIssues": null, - "pluginStatus": null + } } diff --git a/pkg/payloads/v1alpha1/testdata/payload/9.json b/pkg/payloads/v1alpha1/testdata/payload/9.json index 87add4b7..aedba290 100644 --- a/pkg/payloads/v1alpha1/testdata/payload/9.json +++ b/pkg/payloads/v1alpha1/testdata/payload/9.json @@ -25,30 +25,5 @@ "usagePercentage": 3 } }, - "creationTimestamp": "2022-05-02T18:36:36Z", - "totalIssues": 124, - "pluginStatus": { - "plugin2": { - "scan": { - "status": "scanned", - "message": "" - }, - "issueCount": 60, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T22:47:00Z", - "lastFinishedScanTime": "2022-08-04T22:47:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - }, - "popeye": { - "scan": { - "status": "scanned", - "message": "" - }, - "issueCount": 64, - "issues": null, - "lastSuccessfulScanTime": "2022-08-04T22:47:00Z", - "lastFinishedScanTime": "2022-08-04T22:47:00Z", - "nextScheduleScanTime": "2022-08-04T23:45:00Z" - } - } + "creationTimestamp": "2022-05-02T18:36:36Z" } \ No newline at end of file From 77e462911e5b8c62620f16487b87eebb231c4a6c Mon Sep 17 00:00:00 2001 From: Matheus Moraes Date: Tue, 28 Mar 2023 14:42:09 -0300 Subject: [PATCH 5/7] update popeye image tag --- charts/zora/README.md | 2 +- charts/zora/values.yaml | 2 +- config/samples/zora_v1alpha1_plugin_popeye.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/zora/README.md b/charts/zora/README.md index 1b5d11e2..30cb0ffa 100644 --- a/charts/zora/README.md +++ b/charts/zora/README.md @@ -98,7 +98,7 @@ The following table lists the configurable parameters of the Zora chart and thei | scan.plugins.popeye.skipInternalResources | bool | `false` | Specifies whether the following resources should be skipped by `popeye` scans. 1. resources from `kube-system`, `kube-public` and `kube-node-lease` namespaces; 2. kubernetes system reserved RBAC (prefixed with `system:`); 3. `kube-root-ca.crt` configmaps; 4. `default` namespace; 5. `default` serviceaccounts; 6. Helm secrets (prefixed with `sh.helm.release`); 7. Zora components. See `popeye` configuration file that is used for this case: https://github.com/undistro/zora/blob/main/charts/zora/templates/plugins/popeye-config.yaml | | scan.plugins.popeye.resources | object | `{"limits":{"cpu":"500m","memory":"500Mi"},"requests":{"cpu":"250m","memory":"256Mi"}}` | [Resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers) to add to `popeye` container | | scan.plugins.popeye.image.repository | string | `"ghcr.io/undistro/popeye"` | popeye plugin image repository | -| scan.plugins.popeye.image.tag | string | `"v0.11.1-cross"` | popeye plugin image tag | +| scan.plugins.popeye.image.tag | string | `"pr252"` | popeye plugin image tag | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/charts/zora/values.yaml b/charts/zora/values.yaml index 01e455db..19e70b95 100644 --- a/charts/zora/values.yaml +++ b/charts/zora/values.yaml @@ -165,4 +165,4 @@ scan: # -- popeye plugin image repository repository: ghcr.io/undistro/popeye # -- popeye plugin image tag - tag: v0.11.1-cross + tag: pr252 diff --git a/config/samples/zora_v1alpha1_plugin_popeye.yaml b/config/samples/zora_v1alpha1_plugin_popeye.yaml index 45dd0235..ab6ee643 100644 --- a/config/samples/zora_v1alpha1_plugin_popeye.yaml +++ b/config/samples/zora_v1alpha1_plugin_popeye.yaml @@ -17,7 +17,7 @@ kind: Plugin metadata: name: popeye spec: - image: ghcr.io/undistro/popeye:v0.11.1-cross + image: ghcr.io/undistro/popeye:pr252 resources: limits: cpu: 500m From ec6413848de8cda76ce411825ff7bba559654689 Mon Sep 17 00:00:00 2001 From: Matheus Moraes Date: Mon, 10 Apr 2023 09:24:03 -0300 Subject: [PATCH 6/7] 0.5.1-rc1 --- charts/zora/Chart.yaml | 4 ++-- charts/zora/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/zora/Chart.yaml b/charts/zora/Chart.yaml index 2d483f2b..295524d8 100644 --- a/charts/zora/Chart.yaml +++ b/charts/zora/Chart.yaml @@ -17,7 +17,7 @@ name: zora description: Zora scans multiple Kubernetes clusters and reports potential issues. icon: https://zora-docs.undistro.io/assets/logo.png type: application -version: 0.5.0 -appVersion: "v0.5.0" +version: 0.5.1-rc1 +appVersion: "v0.5.1-rc1" sources: - https://github.com/undistro/zora diff --git a/charts/zora/README.md b/charts/zora/README.md index 2d9da145..c5e41f8f 100644 --- a/charts/zora/README.md +++ b/charts/zora/README.md @@ -1,6 +1,6 @@ # Zora Helm Chart -![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square&color=3CA9DD) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square&color=3CA9DD) ![AppVersion: v0.5.0](https://img.shields.io/badge/AppVersion-v0.5.0-informational?style=flat-square&color=3CA9DD) +![Version: 0.5.1-rc1](https://img.shields.io/badge/Version-0.5.1--rc1-informational?style=flat-square&color=3CA9DD) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square&color=3CA9DD) ![AppVersion: v0.5.1-rc1](https://img.shields.io/badge/AppVersion-v0.5.1--rc1-informational?style=flat-square&color=3CA9DD) Zora scans multiple Kubernetes clusters and reports potential issues. @@ -12,7 +12,7 @@ To install the chart with the release name `zora`: helm repo add undistro https://charts.undistro.io --force-update helm upgrade --install zora undistro/zora \ -n zora-system \ - --version 0.5.0 \ + --version 0.5.1-rc1 \ --create-namespace --wait ``` From 34172572ffece365b9890de9bb7275f2a1b61e47 Mon Sep 17 00:00:00 2001 From: Matheus Moraes Date: Wed, 12 Apr 2023 16:35:11 -0300 Subject: [PATCH 7/7] 0.5.1 --- charts/zora/Chart.yaml | 4 ++-- charts/zora/README.md | 4 ++-- main.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/zora/Chart.yaml b/charts/zora/Chart.yaml index 295524d8..0f4e5e5c 100644 --- a/charts/zora/Chart.yaml +++ b/charts/zora/Chart.yaml @@ -17,7 +17,7 @@ name: zora description: Zora scans multiple Kubernetes clusters and reports potential issues. icon: https://zora-docs.undistro.io/assets/logo.png type: application -version: 0.5.1-rc1 -appVersion: "v0.5.1-rc1" +version: 0.5.1 +appVersion: "v0.5.1" sources: - https://github.com/undistro/zora diff --git a/charts/zora/README.md b/charts/zora/README.md index c5e41f8f..a7a14f96 100644 --- a/charts/zora/README.md +++ b/charts/zora/README.md @@ -1,6 +1,6 @@ # Zora Helm Chart -![Version: 0.5.1-rc1](https://img.shields.io/badge/Version-0.5.1--rc1-informational?style=flat-square&color=3CA9DD) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square&color=3CA9DD) ![AppVersion: v0.5.1-rc1](https://img.shields.io/badge/AppVersion-v0.5.1--rc1-informational?style=flat-square&color=3CA9DD) +![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-informational?style=flat-square&color=3CA9DD) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square&color=3CA9DD) ![AppVersion: v0.5.1](https://img.shields.io/badge/AppVersion-v0.5.1-informational?style=flat-square&color=3CA9DD) Zora scans multiple Kubernetes clusters and reports potential issues. @@ -12,7 +12,7 @@ To install the chart with the release name `zora`: helm repo add undistro https://charts.undistro.io --force-update helm upgrade --install zora undistro/zora \ -n zora-system \ - --version 0.5.1-rc1 \ + --version 0.5.1 \ --create-namespace --wait ``` diff --git a/main.go b/main.go index 3c1c30b2..0d12fe64 100644 --- a/main.go +++ b/main.go @@ -76,7 +76,7 @@ func main() { flag.StringVar(&cronJobServiceAccount, "cronjob-serviceaccount-name", "zora-plugins", "Name of ServiceAccount to be configured, appended to ClusterRoleBinding and used by CronJobs") flag.StringVar(&saasWorkspaceID, "saas-workspace-id", "", "Your workspace ID in Zora SaaS") flag.StringVar(&saasServer, "saas-server", "http://localhost:3003", "Address for Zora's saas server") - flag.StringVar(&version, "version", "0.5.0", "Zora version") + flag.StringVar(&version, "version", "0.5.1", "Zora version") opts := zap.Options{ Development: true,