From 95484ec922ab76569051105b327e08ba766da941 Mon Sep 17 00:00:00 2001 From: idohu Date: Thu, 20 Jun 2024 15:14:12 +0300 Subject: [PATCH 1/2] hotfix - singular to plural error + change service CRD naming Signed-off-by: idohu --- charts/kubescape-operator/Chart.yaml | 6 ++-- .../Chart.yaml | 4 +-- .../crds/service-scan-result.crd.yaml} | 10 +++--- .../values.yaml | 0 .../templates/kubescape/clusterrole.yaml | 2 +- .../templates/operator/clusterrole.yaml | 2 +- .../templates/synchronizer/clusterrole.yaml | 2 +- .../templates/synchronizer/configmap.yaml | 2 +- .../__snapshot__/snapshot_test.yaml.snap | 36 +++++++++---------- charts/kubescape-operator/values.yaml | 2 +- 10 files changed, 33 insertions(+), 33 deletions(-) rename charts/kubescape-operator/charts/{serviceauthentication-crds => servicescanresult-crds}/Chart.yaml (71%) rename charts/kubescape-operator/charts/{serviceauthentication-crds/crds/service-authentication.crd.yaml => servicescanresult-crds/crds/service-scan-result.crd.yaml} (86%) rename charts/kubescape-operator/charts/{serviceauthentication-crds => servicescanresult-crds}/values.yaml (100%) diff --git a/charts/kubescape-operator/Chart.yaml b/charts/kubescape-operator/Chart.yaml index f3e1620f..71809ad4 100644 --- a/charts/kubescape-operator/Chart.yaml +++ b/charts/kubescape-operator/Chart.yaml @@ -46,7 +46,7 @@ dependencies: version: 0.0.2 repository: "file://./charts/namespaced-crds" condition: alertCRD.scopeNamespaced - - name: kubescape-service-crd + - name: kubescape-service-scan-crd version: 0.0.1 - repository: "file://./charts/serviceauthentication-crds" - condition: capabilities.enableServiceAuth + repository: "file://./charts/servicesanresult-crds" + condition: capabilities.enableServiceScanResult diff --git a/charts/kubescape-operator/charts/serviceauthentication-crds/Chart.yaml b/charts/kubescape-operator/charts/servicescanresult-crds/Chart.yaml similarity index 71% rename from charts/kubescape-operator/charts/serviceauthentication-crds/Chart.yaml rename to charts/kubescape-operator/charts/servicescanresult-crds/Chart.yaml index 7adbdfb5..666d5895 100644 --- a/charts/kubescape-operator/charts/serviceauthentication-crds/Chart.yaml +++ b/charts/kubescape-operator/charts/servicescanresult-crds/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: kubescape-service-crd -description: A Helm chart CRDs for Kubescape Operator for service authentication discovery +name: kubescape-service-scan-crd +description: A Helm chart CRDs for Kubescape Operator for service authentication scan type: application diff --git a/charts/kubescape-operator/charts/serviceauthentication-crds/crds/service-authentication.crd.yaml b/charts/kubescape-operator/charts/servicescanresult-crds/crds/service-scan-result.crd.yaml similarity index 86% rename from charts/kubescape-operator/charts/serviceauthentication-crds/crds/service-authentication.crd.yaml rename to charts/kubescape-operator/charts/servicescanresult-crds/crds/service-scan-result.crd.yaml index 8c860133..2fd2b0dc 100644 --- a/charts/kubescape-operator/charts/serviceauthentication-crds/crds/service-authentication.crd.yaml +++ b/charts/kubescape-operator/charts/servicescanresult-crds/crds/service-scan-result.crd.yaml @@ -1,15 +1,15 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: serviceauthentication.kubescape.io + name: servicesscanresults.kubescape.io spec: group: kubescape.io names: - kind: ServiceAuthentication - plural: serviceauthentications + kind: ServiceScanResult + plural: servicesscanresults shortNames: - - ksa - singular: serviceauthentication + - kssa + singular: servicescanresult scope: Namespaced versions: - name: v1 diff --git a/charts/kubescape-operator/charts/serviceauthentication-crds/values.yaml b/charts/kubescape-operator/charts/servicescanresult-crds/values.yaml similarity index 100% rename from charts/kubescape-operator/charts/serviceauthentication-crds/values.yaml rename to charts/kubescape-operator/charts/servicescanresult-crds/values.yaml diff --git a/charts/kubescape-operator/templates/kubescape/clusterrole.yaml b/charts/kubescape-operator/templates/kubescape/clusterrole.yaml index 8a52175d..01b73246 100644 --- a/charts/kubescape-operator/templates/kubescape/clusterrole.yaml +++ b/charts/kubescape-operator/templates/kubescape/clusterrole.yaml @@ -65,6 +65,6 @@ rules: resources: ["workloadconfigurationscans", "workloadconfigurationscansummaries"] verbs: ["create", "update", "patch"] - apiGroups: ["kubescape.io"] - resources: ["serviceauthentication"] + resources: ["servicesscanresults"] verbs: ["get", "watch", "list"] {{ end }} diff --git a/charts/kubescape-operator/templates/operator/clusterrole.yaml b/charts/kubescape-operator/templates/operator/clusterrole.yaml index e9c1a96e..fe27a2b4 100644 --- a/charts/kubescape-operator/templates/operator/clusterrole.yaml +++ b/charts/kubescape-operator/templates/operator/clusterrole.yaml @@ -20,6 +20,6 @@ rules: resources: ["vulnerabilitymanifests", "vulnerabilitymanifestsummaries", "workloadconfigurationscans", "workloadconfigurationscansummaries", "openvulnerabilityexchangecontainers", "sbomsyftfiltereds", "sbomsyfts"] verbs: ["get", "watch", "list", "delete"] - apiGroups: ["kubescape.io"] - resources: ["serviceauthentication"] + resources: ["servicesscanresults"] verbs: ["get", "watch", "list", "create", "update", "delete"] {{- end }} diff --git a/charts/kubescape-operator/templates/synchronizer/clusterrole.yaml b/charts/kubescape-operator/templates/synchronizer/clusterrole.yaml index 0dd421b7..7474064c 100644 --- a/charts/kubescape-operator/templates/synchronizer/clusterrole.yaml +++ b/charts/kubescape-operator/templates/synchronizer/clusterrole.yaml @@ -44,6 +44,6 @@ rules: resources: ["httproutes", "tcproutes","udproutes"] verbs: ["get", "list", "watch"] - apiGroups: ["kubescape.io"] - resources: ["serviceauthentication"] + resources: ["servicesscanresults"] verbs: ["get", "watch", "list"] {{- end }} diff --git a/charts/kubescape-operator/templates/synchronizer/configmap.yaml b/charts/kubescape-operator/templates/synchronizer/configmap.yaml index 8e84a9d3..ceb784fd 100644 --- a/charts/kubescape-operator/templates/synchronizer/configmap.yaml +++ b/charts/kubescape-operator/templates/synchronizer/configmap.yaml @@ -185,7 +185,7 @@ data: { "group": "kubescape.io", "version": "v1", - "resource": "serviceauthentication", + "resource": "servicesscanresults", "strategy": "patch" } ] diff --git a/charts/kubescape-operator/tests/__snapshot__/snapshot_test.yaml.snap b/charts/kubescape-operator/tests/__snapshot__/snapshot_test.yaml.snap index c237f223..8ea33bb5 100644 --- a/charts/kubescape-operator/tests/__snapshot__/snapshot_test.yaml.snap +++ b/charts/kubescape-operator/tests/__snapshot__/snapshot_test.yaml.snap @@ -205,7 +205,7 @@ all capabilities: data: capabilities: | { - "capabilities":{"autoUpgrading":"enable","configurationScan":"enable","continuousScan":"enable","enableServiceAuth":false,"malwareDetection":"enable","networkPolicyService":"enable","nodeProfileService":"enable","nodeScan":"enable","prometheusExporter":"enable","relevancy":"enable","runtimeDetection":"enable","runtimeObservability":"enable","vexGeneration":"enable","vulnerabilityScan":"enable"}, + "capabilities":{"autoUpgrading":"enable","configurationScan":"enable","continuousScan":"enable","enableServiceScanResult":false,"malwareDetection":"enable","networkPolicyService":"enable","nodeProfileService":"enable","nodeScan":"enable","prometheusExporter":"enable","relevancy":"enable","runtimeDetection":"enable","runtimeObservability":"enable","vexGeneration":"enable","vulnerabilityScan":"enable"}, "components":{"autoUpdater":{"enabled":true},"clamAV":{"enabled":true},"cloudSecret":{"create":true,"name":"cloud-secret"},"customCaCertificates":{"name":"custom-ca-certificates"},"gateway":{"enabled":true},"hostScanner":{"enabled":true},"kollector":{"enabled":true},"kubescape":{"enabled":true},"kubescapeScheduler":{"enabled":true},"kubevuln":{"enabled":true},"kubevulnScheduler":{"enabled":true},"nodeAgent":{"enabled":true},"operator":{"enabled":true},"otelCollector":{"enabled":true},"prometheusExporter":{"enabled":true},"serviceDiscovery":{"enabled":true},"storage":{"enabled":true},"synchronizer":{"enabled":true}}, "configurations":{"otelUrl":"otelCollector:4317","persistence":"enable","priorityClass":{"daemonset":100000100,"enabled":true},"prometheusAnnotations":"disable"} } @@ -1139,7 +1139,7 @@ all capabilities: - apiGroups: - kubescape.io resources: - - serviceauthentication + - servicesscanresults verbs: - get - watch @@ -2506,7 +2506,7 @@ all capabilities: - apiGroups: - kubescape.io resources: - - serviceauthentication + - servicesscanresults verbs: - get - watch @@ -2573,7 +2573,7 @@ all capabilities: template: metadata: annotations: - checksum/capabilities-config: ebc5e644c56f3fb9ad7386f4f003b3b50853a3482317d6bf7091a5195efdbe33 + checksum/capabilities-config: ab449458437ca2d45e9d42e2b42edae0bb545a5195e065b5322310e3629f91bd checksum/cloud-config: c4dc912bbe62b0d5fd4734206c3cae52f56d766cbc20024182a2bcef09c0ae8e checksum/cloud-secret: 8665d3f0f7282091716b5fbf7356972eb83a5a9e86eb064218d24e9f66612b99 checksum/matching-rules-config: 9282b3916f506ac98eccbdfe686271420ff520374de611f7efce8235dcdf8809 @@ -3926,7 +3926,7 @@ all capabilities: - apiGroups: - kubescape.io resources: - - serviceauthentication + - servicesscanresults verbs: - get - watch @@ -4124,7 +4124,7 @@ all capabilities: { "group": "kubescape.io", "version": "v1", - "resource": "serviceauthentication", + "resource": "servicesscanresults", "strategy": "patch" } ] @@ -4183,7 +4183,7 @@ all capabilities: checksum/cloud-config: c4dc912bbe62b0d5fd4734206c3cae52f56d766cbc20024182a2bcef09c0ae8e checksum/cloud-secret: 8665d3f0f7282091716b5fbf7356972eb83a5a9e86eb064218d24e9f66612b99 checksum/proxy-config: 30e81a4193016803b4b7985b92028c4797c1e84d317a4b6b3e3a5406139f8847 - checksum/synchronizer-configmap: 7994b77dd8208c231ed88a17aaa48d580663b06e17d2138ed8b4ba1d210ca007 + checksum/synchronizer-configmap: 725f053a0de73319752a57b688b9c47c0064792ed51605ad44404d991b5a1768 labels: app: synchronizer app.kubernetes.io/instance: RELEASE-NAME @@ -4442,7 +4442,7 @@ default capabilities: data: capabilities: | { - "capabilities":{"autoUpgrading":"disable","configurationScan":"enable","continuousScan":"disable","enableServiceAuth":false,"malwareDetection":"disable","networkPolicyService":"enable","nodeProfileService":"disable","nodeScan":"enable","prometheusExporter":"disable","relevancy":"enable","runtimeDetection":"disable","runtimeObservability":"enable","vexGeneration":"disable","vulnerabilityScan":"enable"}, + "capabilities":{"autoUpgrading":"disable","configurationScan":"enable","continuousScan":"disable","enableServiceScanResult":false,"malwareDetection":"disable","networkPolicyService":"enable","nodeProfileService":"disable","nodeScan":"enable","prometheusExporter":"disable","relevancy":"enable","runtimeDetection":"disable","runtimeObservability":"enable","vexGeneration":"disable","vulnerabilityScan":"enable"}, "components":{"autoUpdater":{"enabled":false},"clamAV":{"enabled":false},"cloudSecret":{"create":true,"name":"cloud-secret"},"customCaCertificates":{"name":"custom-ca-certificates"},"gateway":{"enabled":true},"hostScanner":{"enabled":true},"kollector":{"enabled":true},"kubescape":{"enabled":true},"kubescapeScheduler":{"enabled":true},"kubevuln":{"enabled":true},"kubevulnScheduler":{"enabled":true},"nodeAgent":{"enabled":true},"operator":{"enabled":true},"otelCollector":{"enabled":true},"prometheusExporter":{"enabled":false},"serviceDiscovery":{"enabled":true},"storage":{"enabled":true},"synchronizer":{"enabled":true}}, "configurations":{"otelUrl":"otelCollector:4317","persistence":"enable","priorityClass":{"daemonset":100000100,"enabled":true},"prometheusAnnotations":"disable"} } @@ -5324,7 +5324,7 @@ default capabilities: - apiGroups: - kubescape.io resources: - - serviceauthentication + - servicesscanresults verbs: - get - watch @@ -6569,7 +6569,7 @@ default capabilities: - apiGroups: - kubescape.io resources: - - serviceauthentication + - servicesscanresults verbs: - get - watch @@ -6636,7 +6636,7 @@ default capabilities: template: metadata: annotations: - checksum/capabilities-config: 42ca66a929f6066b8ca57ae06fb14dbae3030ccd6bac1e87518373b14eaed76c + checksum/capabilities-config: 105064c9b94c92f3911281b551a69c7d6d9ab7f601b56a7338e22870d21570ee checksum/cloud-config: 98e72a3a1a24264d2cdebc86b61829ee5b941fb590d6ca717ebaa880922046c6 checksum/cloud-secret: 8665d3f0f7282091716b5fbf7356972eb83a5a9e86eb064218d24e9f66612b99 checksum/matching-rules-config: 9282b3916f506ac98eccbdfe686271420ff520374de611f7efce8235dcdf8809 @@ -7769,7 +7769,7 @@ default capabilities: - apiGroups: - kubescape.io resources: - - serviceauthentication + - servicesscanresults verbs: - get - watch @@ -7967,7 +7967,7 @@ default capabilities: { "group": "kubescape.io", "version": "v1", - "resource": "serviceauthentication", + "resource": "servicesscanresults", "strategy": "patch" } ] @@ -8026,7 +8026,7 @@ default capabilities: checksum/cloud-config: 98e72a3a1a24264d2cdebc86b61829ee5b941fb590d6ca717ebaa880922046c6 checksum/cloud-secret: 8665d3f0f7282091716b5fbf7356972eb83a5a9e86eb064218d24e9f66612b99 checksum/proxy-config: 30e81a4193016803b4b7985b92028c4797c1e84d317a4b6b3e3a5406139f8847 - checksum/synchronizer-configmap: 7994b77dd8208c231ed88a17aaa48d580663b06e17d2138ed8b4ba1d210ca007 + checksum/synchronizer-configmap: 725f053a0de73319752a57b688b9c47c0064792ed51605ad44404d991b5a1768 labels: app: synchronizer app.kubernetes.io/instance: RELEASE-NAME @@ -8260,7 +8260,7 @@ minimal capabilities: data: capabilities: | { - "capabilities":{"autoUpgrading":"disable","configurationScan":"enable","continuousScan":"disable","enableServiceAuth":false,"malwareDetection":"disable","networkPolicyService":"enable","nodeProfileService":"disable","nodeScan":"enable","prometheusExporter":"disable","relevancy":"enable","runtimeDetection":"disable","runtimeObservability":"enable","vexGeneration":"disable","vulnerabilityScan":"enable"}, + "capabilities":{"autoUpgrading":"disable","configurationScan":"enable","continuousScan":"disable","enableServiceScanResult":false,"malwareDetection":"disable","networkPolicyService":"enable","nodeProfileService":"disable","nodeScan":"enable","prometheusExporter":"disable","relevancy":"enable","runtimeDetection":"disable","runtimeObservability":"enable","vexGeneration":"disable","vulnerabilityScan":"enable"}, "components":{"autoUpdater":{"enabled":false},"clamAV":{"enabled":false},"cloudSecret":{"create":true,"name":"cloud-secret"},"customCaCertificates":{"name":"custom-ca-certificates"},"gateway":{"enabled":false},"hostScanner":{"enabled":true},"kollector":{"enabled":false},"kubescape":{"enabled":true},"kubescapeScheduler":{"enabled":false},"kubevuln":{"enabled":true},"kubevulnScheduler":{"enabled":false},"nodeAgent":{"enabled":true},"operator":{"enabled":true},"otelCollector":{"enabled":true},"prometheusExporter":{"enabled":false},"serviceDiscovery":{"enabled":false},"storage":{"enabled":true},"synchronizer":{"enabled":false}}, "configurations":{"otelUrl":"otelCollector:4317","persistence":"enable","priorityClass":{"daemonset":100000100,"enabled":true},"prometheusAnnotations":"disable"} } @@ -8491,7 +8491,7 @@ minimal capabilities: - apiGroups: - kubescape.io resources: - - serviceauthentication + - servicesscanresults verbs: - get - watch @@ -9427,7 +9427,7 @@ minimal capabilities: - apiGroups: - kubescape.io resources: - - serviceauthentication + - servicesscanresults verbs: - get - watch @@ -9494,7 +9494,7 @@ minimal capabilities: template: metadata: annotations: - checksum/capabilities-config: 3712097506a8e426352d08719f83902a43c1d72e83b73d88268a320ac022b158 + checksum/capabilities-config: f3a9c35fcb5d8b7292ce877e49416ebdc0fab30b444d3c385b19d3110c845d9d checksum/cloud-config: c8580dbb81fa1c832dc787a966fc068feacfb2ee7f67fdd928c256f4094ad656 checksum/cloud-secret: baefa7c2a6f06e1afdaffb0829d1caf36ff7428773197f1e5ca4731c132ecb78 checksum/matching-rules-config: 9282b3916f506ac98eccbdfe686271420ff520374de611f7efce8235dcdf8809 diff --git a/charts/kubescape-operator/values.yaml b/charts/kubescape-operator/values.yaml index 5abbff98..6445fcaf 100644 --- a/charts/kubescape-operator/values.yaml +++ b/charts/kubescape-operator/values.yaml @@ -90,7 +90,7 @@ capabilities: prometheusExporter: disable # seccompGenerator: disable - enableServiceAuth: false + enableServiceScanResult: false configurations: otelUrl: # default is empty From ddf24ae5c6c8714de850b944691a76729e32d979 Mon Sep 17 00:00:00 2001 From: idohu Date: Thu, 20 Jun 2024 15:16:43 +0300 Subject: [PATCH 2/2] add missing 's' Signed-off-by: idohu --- charts/kubescape-operator/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kubescape-operator/Chart.yaml b/charts/kubescape-operator/Chart.yaml index 71809ad4..dc0df27f 100644 --- a/charts/kubescape-operator/Chart.yaml +++ b/charts/kubescape-operator/Chart.yaml @@ -48,5 +48,5 @@ dependencies: condition: alertCRD.scopeNamespaced - name: kubescape-service-scan-crd version: 0.0.1 - repository: "file://./charts/servicesanresult-crds" + repository: "file://./charts/servicescanresult-crds" condition: capabilities.enableServiceScanResult