From 4d03281d7a121eb64a67e7ee0a71f32073b17f6e Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Fri, 29 Sep 2023 01:27:35 -0700 Subject: [PATCH] Rename preset to variant Signed-off-by: Tamal Saha --- apis/management/v1alpha1/openapi_generated.go | 8 ++++++++ apis/management/v1alpha1/projectquota_types.go | 9 +++++++++ apis/meta/v1alpha1/openapi_generated.go | 2 +- apis/meta/v1alpha1/ui_menu_types.go | 2 +- crds/management.k8s.appscode.com_projectquotas.yaml | 7 +++++++ go.mod | 2 +- go.sum | 4 ++-- vendor/modules.txt | 2 +- .../apis/charts/v1alpha1/interface_types.go | 10 +++++----- 9 files changed, 35 insertions(+), 11 deletions(-) diff --git a/apis/management/v1alpha1/openapi_generated.go b/apis/management/v1alpha1/openapi_generated.go index a9407fc93..c7f2ee926 100644 --- a/apis/management/v1alpha1/openapi_generated.go +++ b/apis/management/v1alpha1/openapi_generated.go @@ -14806,6 +14806,13 @@ func schema_resource_metadata_apis_management_v1alpha1_ResourceQuotaStatus(ref c }, }, }, + "result": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, "used": { SchemaProps: spec.SchemaProps{ Description: "Used is the current observed total usage of the resource in the namespace.", @@ -14822,6 +14829,7 @@ func schema_resource_metadata_apis_management_v1alpha1_ResourceQuotaStatus(ref c }, }, }, + Required: []string{"result"}, }, }, Dependencies: []string{ diff --git a/apis/management/v1alpha1/projectquota_types.go b/apis/management/v1alpha1/projectquota_types.go index ddf62dd0e..97aa5cb7a 100644 --- a/apis/management/v1alpha1/projectquota_types.go +++ b/apis/management/v1alpha1/projectquota_types.go @@ -65,11 +65,20 @@ type ProjectQuotaStatus struct { type ResourceQuotaStatus struct { ResourceQuotaSpec `json:",inline"` + Result QuotaResult `json:"result"` // Used is the current observed total usage of the resource in the namespace. // +optional Used core.ResourceList `json:"used,omitempty"` } +// +kubebuilder:validation:Enum=Success;Error +type QuotaResult string + +const ( + ResultSuccess QuotaResult = "Success" + ResultError QuotaResult = "Error" +) + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:object:root=true diff --git a/apis/meta/v1alpha1/openapi_generated.go b/apis/meta/v1alpha1/openapi_generated.go index 56578dd4a..c599b237f 100644 --- a/apis/meta/v1alpha1/openapi_generated.go +++ b/apis/meta/v1alpha1/openapi_generated.go @@ -15163,7 +15163,7 @@ func schema_resource_metadata_apis_meta_v1alpha1_MenuItem(ref common.ReferenceCa Ref: ref("kmodules.xyz/resource-metadata/apis/shared.DeploymentParameters"), }, }, - "preset": { + "variant": { SchemaProps: spec.SchemaProps{ Type: []string{"string"}, Format: "", diff --git a/apis/meta/v1alpha1/ui_menu_types.go b/apis/meta/v1alpha1/ui_menu_types.go index 4957b94a6..58753ab15 100644 --- a/apis/meta/v1alpha1/ui_menu_types.go +++ b/apis/meta/v1alpha1/ui_menu_types.go @@ -84,7 +84,7 @@ type MenuItem struct { Icons []helmshared.ImageSpec `json:"icons,omitempty"` Installer *shared.DeploymentParameters `json:"installer,omitempty"` // +optional - Preset string `json:"preset,omitempty"` + Variant string `json:"variant,omitempty"` // +optional AvailableVariants int `json:"availableVariants,omitempty"` // +optional diff --git a/crds/management.k8s.appscode.com_projectquotas.yaml b/crds/management.k8s.appscode.com_projectquotas.yaml index 4a2c85bc9..e1a3fc7f5 100644 --- a/crds/management.k8s.appscode.com_projectquotas.yaml +++ b/crds/management.k8s.appscode.com_projectquotas.yaml @@ -81,6 +81,11 @@ spec: type: object kind: type: string + result: + enum: + - Success + - Error + type: string used: additionalProperties: anyOf: @@ -91,6 +96,8 @@ spec: description: Used is the current observed total usage of the resource in the namespace. type: object + required: + - result type: object type: array required: diff --git a/go.mod b/go.mod index 48aa23e69..2fb46adbe 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( sigs.k8s.io/cli-utils v0.34.0 sigs.k8s.io/controller-runtime v0.13.1 sigs.k8s.io/yaml v1.3.0 - x-helm.dev/apimachinery v0.0.11 + x-helm.dev/apimachinery v0.0.12 ) require ( diff --git a/go.sum b/go.sum index 74954ff9e..087b83f45 100644 --- a/go.sum +++ b/go.sum @@ -754,5 +754,5 @@ sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kF sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -x-helm.dev/apimachinery v0.0.11 h1:tUrxsKeRT84UCw+hHuV7isheWCv9yoS8m8lwWacVkZ4= -x-helm.dev/apimachinery v0.0.11/go.mod h1:jjkebU6uv/cS/8pQGE8tbgK/rB39yh4ETiAglPbDWZc= +x-helm.dev/apimachinery v0.0.12 h1:lEuGH5F+6xqL7/uL+SsoOUXeJZFgC8c2OQgtMMj/fQM= +x-helm.dev/apimachinery v0.0.12/go.mod h1:jjkebU6uv/cS/8pQGE8tbgK/rB39yh4ETiAglPbDWZc= diff --git a/vendor/modules.txt b/vendor/modules.txt index 4d8f9e62b..eb84fecbf 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -768,7 +768,7 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# x-helm.dev/apimachinery v0.0.11 +# x-helm.dev/apimachinery v0.0.12 ## explicit; go 1.19 x-helm.dev/apimachinery/apis/charts/v1alpha1 x-helm.dev/apimachinery/apis/releases/v1alpha1 diff --git a/vendor/x-helm.dev/apimachinery/apis/charts/v1alpha1/interface_types.go b/vendor/x-helm.dev/apimachinery/apis/charts/v1alpha1/interface_types.go index c56ba7289..7920bb21a 100644 --- a/vendor/x-helm.dev/apimachinery/apis/charts/v1alpha1/interface_types.go +++ b/vendor/x-helm.dev/apimachinery/apis/charts/v1alpha1/interface_types.go @@ -47,11 +47,11 @@ type ChartPresetFlatRef struct { releasesv1alpha1.ChartSourceFlatRef `json:",inline"` // Editor GVR - Group string `json:"group,omitempty"` - Resource string `json:"resource,omitempty"` - Kind string `json:"kind,omitempty"` - PresetName string `json:"presetName,omitempty"` - Namespace string `json:"namespace,omitempty"` + Group string `json:"group,omitempty"` + Resource string `json:"resource,omitempty"` + Kind string `json:"kind,omitempty"` + Variant string `json:"variant,omitempty"` + Namespace string `json:"namespace,omitempty"` } type ChartPresetValues struct {