diff --git a/apis/core/v1alpha1/zz_generated.deepcopy.go b/apis/core/v1alpha1/zz_generated.deepcopy.go index f7b596305..c6672a102 100644 --- a/apis/core/v1alpha1/zz_generated.deepcopy.go +++ b/apis/core/v1alpha1/zz_generated.deepcopy.go @@ -22,14 +22,15 @@ limitations under the License. package v1alpha1 import ( + apiv1 "kmodules.xyz/client-go/api/v1" + shared "kmodules.xyz/resource-metadata/apis/shared" + api "kmodules.xyz/resource-metrics/api" + v1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" version "k8s.io/apimachinery/pkg/version" - apiv1 "kmodules.xyz/client-go/api/v1" - shared "kmodules.xyz/resource-metadata/apis/shared" - api "kmodules.xyz/resource-metrics/api" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/apis/management/v1alpha1/openapi_generated.go b/apis/management/v1alpha1/openapi_generated.go index 1aa66837b..63830c301 100644 --- a/apis/management/v1alpha1/openapi_generated.go +++ b/apis/management/v1alpha1/openapi_generated.go @@ -301,7 +301,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/management/v1alpha1.ProjectQuotaList": schema_resource_metadata_apis_management_v1alpha1_ProjectQuotaList(ref), "kmodules.xyz/resource-metadata/apis/management/v1alpha1.ProjectQuotaSpec": schema_resource_metadata_apis_management_v1alpha1_ProjectQuotaSpec(ref), "kmodules.xyz/resource-metadata/apis/management/v1alpha1.ProjectQuotaStatus": schema_resource_metadata_apis_management_v1alpha1_ProjectQuotaStatus(ref), - "kmodules.xyz/resource-metadata/apis/management/v1alpha1.QuotaStatus": schema_resource_metadata_apis_management_v1alpha1_QuotaStatus(ref), "kmodules.xyz/resource-metadata/apis/management/v1alpha1.ResourceQuotaSpec": schema_resource_metadata_apis_management_v1alpha1_ResourceQuotaSpec(ref), "kmodules.xyz/resource-metadata/apis/management/v1alpha1.ResourceQuotaStatus": schema_resource_metadata_apis_management_v1alpha1_ResourceQuotaStatus(ref), "kmodules.xyz/resource-metadata/apis/shared.Action": schema_kmodulesxyz_resource_metadata_apis_shared_Action(ref), @@ -14733,32 +14732,6 @@ func schema_resource_metadata_apis_management_v1alpha1_ProjectQuotaStatus(ref co } } -func schema_resource_metadata_apis_management_v1alpha1_QuotaStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "result": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"result"}, - }, - }, - } -} - func schema_resource_metadata_apis_management_v1alpha1_ResourceQuotaSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -14833,10 +14806,17 @@ func schema_resource_metadata_apis_management_v1alpha1_ResourceQuotaStatus(ref c }, }, }, - "quotaStatus": { + "result": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/resource-metadata/apis/management/v1alpha1.QuotaStatus"), + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", }, }, "used": { @@ -14855,11 +14835,11 @@ func schema_resource_metadata_apis_management_v1alpha1_ResourceQuotaStatus(ref c }, }, }, - Required: []string{"quotaStatus"}, + Required: []string{"result"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", "kmodules.xyz/resource-metadata/apis/management/v1alpha1.QuotaStatus"}, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } diff --git a/apis/management/v1alpha1/projectquota_types.go b/apis/management/v1alpha1/projectquota_types.go index b82b13558..b9d08ae26 100644 --- a/apis/management/v1alpha1/projectquota_types.go +++ b/apis/management/v1alpha1/projectquota_types.go @@ -65,18 +65,15 @@ type ProjectQuotaStatus struct { type ResourceQuotaStatus struct { ResourceQuotaSpec `json:",inline"` - QuotaStatus QuotaStatus `json:"quotaStatus"` + Result QuotaResult `json:"result"` + // +optional + Reason string `json:"reason,omitempty"` // Used is the current observed total usage of the resource in the namespace. // +optional Used core.ResourceList `json:"used,omitempty"` } -type QuotaStatus struct { - Result QuotaResult `json:"result"` - Reason string `json:"reason,omitempty"` -} - // +kubebuilder:validation:Enum=Success;Error type QuotaResult string diff --git a/apis/management/v1alpha1/zz_generated.deepcopy.go b/apis/management/v1alpha1/zz_generated.deepcopy.go index 6351d9926..c085f7439 100644 --- a/apis/management/v1alpha1/zz_generated.deepcopy.go +++ b/apis/management/v1alpha1/zz_generated.deepcopy.go @@ -133,22 +133,6 @@ func (in *ProjectQuotaStatus) DeepCopy() *ProjectQuotaStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *QuotaStatus) DeepCopyInto(out *QuotaStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QuotaStatus. -func (in *QuotaStatus) DeepCopy() *QuotaStatus { - if in == nil { - return nil - } - out := new(QuotaStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceQuotaSpec) DeepCopyInto(out *ResourceQuotaSpec) { *out = *in @@ -176,7 +160,6 @@ func (in *ResourceQuotaSpec) DeepCopy() *ResourceQuotaSpec { func (in *ResourceQuotaStatus) DeepCopyInto(out *ResourceQuotaStatus) { *out = *in in.ResourceQuotaSpec.DeepCopyInto(&out.ResourceQuotaSpec) - out.QuotaStatus = in.QuotaStatus if in.Used != nil { in, out := &in.Used, &out.Used *out = make(v1.ResourceList, len(*in)) diff --git a/apis/meta/v1alpha1/zz_generated.deepcopy.go b/apis/meta/v1alpha1/zz_generated.deepcopy.go index e74b1e168..33ebeddbb 100644 --- a/apis/meta/v1alpha1/zz_generated.deepcopy.go +++ b/apis/meta/v1alpha1/zz_generated.deepcopy.go @@ -22,15 +22,16 @@ limitations under the License. package v1alpha1 import ( + apiv1 "kmodules.xyz/client-go/api/v1" + shared "kmodules.xyz/resource-metadata/apis/shared" + api "kmodules.xyz/resource-metrics/api" + corev1 "k8s.io/api/core/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" - apiv1 "kmodules.xyz/client-go/api/v1" - shared "kmodules.xyz/resource-metadata/apis/shared" - api "kmodules.xyz/resource-metrics/api" chartsv1alpha1 "x-helm.dev/apimachinery/apis/charts/v1alpha1" apisshared "x-helm.dev/apimachinery/apis/shared" ) diff --git a/apis/ui/v1alpha1/zz_generated.deepcopy.go b/apis/ui/v1alpha1/zz_generated.deepcopy.go index 230009269..84acea50b 100644 --- a/apis/ui/v1alpha1/zz_generated.deepcopy.go +++ b/apis/ui/v1alpha1/zz_generated.deepcopy.go @@ -22,10 +22,11 @@ limitations under the License. package v1alpha1 import ( + apisshared "kmodules.xyz/resource-metadata/apis/shared" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" - apisshared "kmodules.xyz/resource-metadata/apis/shared" releasesv1alpha1 "x-helm.dev/apimachinery/apis/releases/v1alpha1" shared "x-helm.dev/apimachinery/apis/shared" ) diff --git a/crds/management.k8s.appscode.com_projectquotas.yaml b/crds/management.k8s.appscode.com_projectquotas.yaml index a2eec65e4..d516eaf66 100644 --- a/crds/management.k8s.appscode.com_projectquotas.yaml +++ b/crds/management.k8s.appscode.com_projectquotas.yaml @@ -81,18 +81,13 @@ spec: type: object kind: type: string - quotaStatus: - properties: - reason: - type: string - result: - enum: - - Success - - Error - type: string - required: - - result - type: object + reason: + type: string + result: + enum: + - Success + - Error + type: string used: additionalProperties: anyOf: @@ -104,7 +99,7 @@ spec: resource in the namespace. type: object required: - - quotaStatus + - result type: object type: array required: