From 5436aa34de8fe5e480bde31f65a39125bfcb661d Mon Sep 17 00:00:00 2001 From: elan-devops <51135346+elan-devops@users.noreply.github.com> Date: Tue, 10 Sep 2024 01:37:35 -0700 Subject: [PATCH] Bqu cr (#241) * Create ci.yaml * Add new field in CR schema for BQU --------- Co-authored-by: Elanthenral Elangovan --- .github/workflows/ci.yaml | 4 ++++ .../registry.ethos.adobe.com_clusters.yaml | 9 +++++++++ .../registry.ethos.adobe.com_clusters.yaml | 9 +++++++++ pkg/api/registry/v1/cluster_types.go | 3 +++ pkg/apiserver/docs/docs.go | 15 ++++++++++++--- pkg/apiserver/docs/swagger.json | 15 ++++++++++++--- pkg/apiserver/docs/swagger.yaml | 18 +++++++++--------- 7 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..c00ddca0 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,4 @@ +- name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/charts/cluster-registry-client/crds/registry.ethos.adobe.com_clusters.yaml b/charts/cluster-registry-client/crds/registry.ethos.adobe.com_clusters.yaml index aee61b22..ec91595c 100644 --- a/charts/cluster-registry-client/crds/registry.ethos.adobe.com_clusters.yaml +++ b/charts/cluster-registry-client/crds/registry.ethos.adobe.com_clusters.yaml @@ -107,14 +107,23 @@ spec: properties: clusterCapacity: type: integer + clusterCurrentBqu: + type: integer + clusterMaxBqu: + type: integer clusterProvisioning: type: integer lastUpdated: type: string + maxBquPerRequest: + type: integer required: - clusterCapacity + - clusterCurrentBqu + - clusterMaxBqu - clusterProvisioning - lastUpdated + - maxBquPerRequest type: object chargebackBusinessUnit: description: The BU responsible for paying for the cluster. diff --git a/config/crd/bases/registry.ethos.adobe.com_clusters.yaml b/config/crd/bases/registry.ethos.adobe.com_clusters.yaml index aee61b22..ec91595c 100644 --- a/config/crd/bases/registry.ethos.adobe.com_clusters.yaml +++ b/config/crd/bases/registry.ethos.adobe.com_clusters.yaml @@ -107,14 +107,23 @@ spec: properties: clusterCapacity: type: integer + clusterCurrentBqu: + type: integer + clusterMaxBqu: + type: integer clusterProvisioning: type: integer lastUpdated: type: string + maxBquPerRequest: + type: integer required: - clusterCapacity + - clusterCurrentBqu + - clusterMaxBqu - clusterProvisioning - lastUpdated + - maxBquPerRequest type: object chargebackBusinessUnit: description: The BU responsible for paying for the cluster. diff --git a/pkg/api/registry/v1/cluster_types.go b/pkg/api/registry/v1/cluster_types.go index 650e3c09..95c04b8e 100644 --- a/pkg/api/registry/v1/cluster_types.go +++ b/pkg/api/registry/v1/cluster_types.go @@ -260,6 +260,9 @@ type Capacity struct { LastUpdated string `json:"lastUpdated"` ClusterCapacity int `json:"clusterCapacity"` ClusterProvisioning int `json:"clusterProvisioning"` + MaxBQUPerRequest int `json:"maxBquPerRequest"` + ClusterMaxBQU int `json:"clusterMaxBqu"` + ClusterCurrentBQU int `json:"clusterCurrentBqu"` } type ServiceMetadata map[string]ServiceMetadataItem diff --git a/pkg/apiserver/docs/docs.go b/pkg/apiserver/docs/docs.go index 3a9873b8..a6f2325b 100644 --- a/pkg/apiserver/docs/docs.go +++ b/pkg/apiserver/docs/docs.go @@ -497,11 +497,20 @@ const docTemplate = `{ "clusterCapacity": { "type": "integer" }, + "clusterCurrentBqu": { + "type": "integer" + }, + "clusterMaxBqu": { + "type": "integer" + }, "clusterProvisioning": { "type": "integer" }, "lastUpdated": { "type": "string" + }, + "maxBquPerRequest": { + "type": "integer" } } }, @@ -674,7 +683,7 @@ const docTemplate = `{ "type": "object", "properties": { "domainName": { - "description": "Name of the domain\n+kubebuilder:validation:Required", + "description": "Name of the domain", "type": "string" }, "ecrIamArns": { @@ -696,14 +705,14 @@ const docTemplate = `{ "type": "string" }, "lbEndpoints": { - "description": "Load balancer endpoints\n+kubebuilder:validation:Required", + "description": "Load balancer endpoints", "type": "object", "additionalProperties": { "type": "string" } }, "loggingEndpoints": { - "description": "Logging endpoints\n+kubebuilder:validation:Required", + "description": "Logging endpoints", "type": "array", "items": { "type": "object", diff --git a/pkg/apiserver/docs/swagger.json b/pkg/apiserver/docs/swagger.json index d63d0078..582d0261 100644 --- a/pkg/apiserver/docs/swagger.json +++ b/pkg/apiserver/docs/swagger.json @@ -483,11 +483,20 @@ "clusterCapacity": { "type": "integer" }, + "clusterCurrentBqu": { + "type": "integer" + }, + "clusterMaxBqu": { + "type": "integer" + }, "clusterProvisioning": { "type": "integer" }, "lastUpdated": { "type": "string" + }, + "maxBquPerRequest": { + "type": "integer" } } }, @@ -660,7 +669,7 @@ "type": "object", "properties": { "domainName": { - "description": "Name of the domain\n+kubebuilder:validation:Required", + "description": "Name of the domain", "type": "string" }, "ecrIamArns": { @@ -682,14 +691,14 @@ "type": "string" }, "lbEndpoints": { - "description": "Load balancer endpoints\n+kubebuilder:validation:Required", + "description": "Load balancer endpoints", "type": "object", "additionalProperties": { "type": "string" } }, "loggingEndpoints": { - "description": "Logging endpoints\n+kubebuilder:validation:Required", + "description": "Logging endpoints", "type": "array", "items": { "type": "object", diff --git a/pkg/apiserver/docs/swagger.yaml b/pkg/apiserver/docs/swagger.yaml index 21dd5a47..b2a63bcf 100644 --- a/pkg/apiserver/docs/swagger.yaml +++ b/pkg/apiserver/docs/swagger.yaml @@ -40,10 +40,16 @@ definitions: properties: clusterCapacity: type: integer + clusterCurrentBqu: + type: integer + clusterMaxBqu: + type: integer clusterProvisioning: type: integer lastUpdated: type: string + maxBquPerRequest: + type: integer type: object github_com_adobe_cluster-registry_pkg_api_registry_v1.ClusterSpec: properties: @@ -204,9 +210,7 @@ definitions: github_com_adobe_cluster-registry_pkg_api_registry_v1.Extra: properties: domainName: - description: |- - Name of the domain - +kubebuilder:validation:Required + description: Name of the domain type: string ecrIamArns: additionalProperties: @@ -224,14 +228,10 @@ definitions: lbEndpoints: additionalProperties: type: string - description: |- - Load balancer endpoints - +kubebuilder:validation:Required + description: Load balancer endpoints type: object loggingEndpoints: - description: |- - Logging endpoints - +kubebuilder:validation:Required + description: Logging endpoints items: additionalProperties: type: string