From 8f9f9bceab723fba97edebebf33a45562920c270 Mon Sep 17 00:00:00 2001 From: Scott Trent Date: Mon, 2 Sep 2024 14:43:21 +0900 Subject: [PATCH] address scorecard tests Signed-off-by: Scott Trent --- api/v1/labelgroup_types.go | 2 +- .../susql-operator.clusterserviceversion.yaml | 11 ++++++++--- bundle/manifests/susql.ibm.com_labelgroups.yaml | 7 +++---- config/samples/susql_v1_labelgroup.yaml | 4 +++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/api/v1/labelgroup_types.go b/api/v1/labelgroup_types.go index 2e2214c..62d93bd 100644 --- a/api/v1/labelgroup_types.go +++ b/api/v1/labelgroup_types.go @@ -79,7 +79,7 @@ const ( //+kubebuilder:object:root=true //+kubebuilder:subresource:status -// LabelGroup is the Schema for the labelgroups API +// LabelGroup is the Schema for the LabelGroups API type LabelGroup struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/bundle/manifests/susql-operator.clusterserviceversion.yaml b/bundle/manifests/susql-operator.clusterserviceversion.yaml index 09000ef..d0a8945 100644 --- a/bundle/manifests/susql-operator.clusterserviceversion.yaml +++ b/bundle/manifests/susql-operator.clusterserviceversion.yaml @@ -17,13 +17,18 @@ metadata: }, "name": "labelgroup-sample" }, - "spec": null + "spec": { + "labels": [ + "labelgroup-sample-1", + "labelgroup-sample-2" + ] + } } ] capabilities: Basic Install categories: Monitoring containerImage: quay.io/sustainable_computing_io/susql_operator:0.0.26 - createdAt: "2024-08-28T12:13:39Z" + createdAt: "2024-09-02T05:32:59Z" description: 'Aggregates energy and CO2 emission data for pods tagged with SusQL labels ' operators.operatorframework.io/builder: operator-sdk-v1.36.1 @@ -36,7 +41,7 @@ spec: apiservicedefinitions: {} customresourcedefinitions: owned: - - description: LabelGroup is the Schema for the labelgroups API + - description: LabelGroup is the Schema for the LabelGroups API displayName: Label Group kind: LabelGroup name: labelgroups.susql.ibm.com diff --git a/bundle/manifests/susql.ibm.com_labelgroups.yaml b/bundle/manifests/susql.ibm.com_labelgroups.yaml index 1ef3556..ec2a4e4 100644 --- a/bundle/manifests/susql.ibm.com_labelgroups.yaml +++ b/bundle/manifests/susql.ibm.com_labelgroups.yaml @@ -17,7 +17,7 @@ spec: - name: v1 schema: openAPIV3Schema: - description: LabelGroup is the Schema for the labelgroups API + description: LabelGroup is the Schema for the LabelGroups API properties: apiVersion: description: |- @@ -63,7 +63,7 @@ spec: description: SusQL Kubernetes labels constructed from the spec type: object phase: - description: Transition phase of the label group + description: Transition phase of the LabelGroup type: string prometheusLabels: additionalProperties: @@ -71,8 +71,7 @@ spec: description: SusQL Prometheus labels constructed from the spec type: object susqlPrometheusQuery: - description: Prometheus query to get the total energy for this label - group + description: Prometheus query to get the total energy for this LabelGroup type: string totalCarbon: description: TotalCarbon keeps track of the accumulated grams of carbon diff --git a/config/samples/susql_v1_labelgroup.yaml b/config/samples/susql_v1_labelgroup.yaml index 424fa1c..27637ca 100644 --- a/config/samples/susql_v1_labelgroup.yaml +++ b/config/samples/susql_v1_labelgroup.yaml @@ -9,4 +9,6 @@ metadata: app.kubernetes.io/created-by: susql-operator name: labelgroup-sample spec: - # TODO(user): Add fields here + labels: + - labelgroup-sample-1 + - labelgroup-sample-2