Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit 6db3b91

Browse files
authored
Merge pull request #2223 from tylerslaton/no-omitempty-resources
Don't set omitempty for fields in the Resources struct
2 parents b84de2b + f6cc4ca commit 6db3b91

File tree

3 files changed

+45
-32
lines changed

3 files changed

+45
-32
lines changed

pkg/apis/internal.admin.acorn.io/v1/baseresources.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import (
1010
// BaseResources defines resources that should be tracked at any scoped. The two main exclusions
1111
// currently are Secrets and Projects as they have situations they should be not be tracked.
1212
type BaseResources struct {
13-
Apps int `json:"apps,omitempty"`
14-
Containers int `json:"containers,omitempty"`
15-
Jobs int `json:"jobs,omitempty"`
16-
Volumes int `json:"volumes,omitempty"`
17-
Images int `json:"images,omitempty"`
18-
19-
VolumeStorage resource.Quantity `json:"volumeStorage,omitempty"`
20-
Memory resource.Quantity `json:"memory,omitempty"`
21-
CPU resource.Quantity `json:"cpu,omitempty"`
13+
Apps int `json:"apps"`
14+
Containers int `json:"containers"`
15+
Jobs int `json:"jobs"`
16+
Volumes int `json:"volumes"`
17+
Images int `json:"images"`
18+
19+
VolumeStorage resource.Quantity `json:"volumeStorage"`
20+
Memory resource.Quantity `json:"memory"`
21+
CPU resource.Quantity `json:"cpu"`
2222
}
2323

2424
// Add will add the BaseResources of another BaseResources struct into the current one.

pkg/apis/internal.admin.acorn.io/v1/quotarequests.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type QuotaRequestInstanceList struct {
7777
// QuotaRequestResources defines resources that should can be created by an AppInstance.
7878
type QuotaRequestResources struct {
7979
BaseResources `json:",inline"`
80-
Secrets int `json:"secrets,omitempty"`
80+
Secrets int `json:"secrets"`
8181
}
8282

8383
// Add will add the QuotaRequestResources of another QuotaRequestResources struct into the current one.

pkg/openapi/generated/openapi_generated.go

Lines changed: 35 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)