Skip to content

Commit

Permalink
Add status in project quota api type
Browse files Browse the repository at this point in the history
Signed-off-by: Imtiaz Uddin <[email protected]>
  • Loading branch information
Imtiaz246 committed Oct 4, 2023
1 parent 6d9f8c1 commit 55c8c0d
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 23 deletions.
7 changes: 3 additions & 4 deletions apis/core/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 32 additions & 6 deletions apis/management/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion apis/management/v1alpha1/projectquota_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,18 @@ type ProjectQuotaStatus struct {

type ResourceQuotaStatus struct {
ResourceQuotaSpec `json:",inline"`
Result QuotaResult `json:"result"`
QuotaStatus QuotaStatus `json:"quotaStatus"`

// 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

Expand Down
17 changes: 17 additions & 0 deletions apis/management/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions apis/meta/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions apis/ui/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions crds/management.k8s.appscode.com_projectquotas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,18 @@ spec:
type: object
kind:
type: string
result:
enum:
- Success
- Error
type: string
quotaStatus:
properties:
reason:
type: string
result:
enum:
- Success
- Error
type: string
required:
- result
type: object
used:
additionalProperties:
anyOf:
Expand All @@ -97,7 +104,7 @@ spec:
resource in the namespace.
type: object
required:
- result
- quotaStatus
type: object
type: array
required:
Expand Down

0 comments on commit 55c8c0d

Please sign in to comment.