Skip to content

Commit

Permalink
fix: don't use pointers to resourcequota and limitrange
Browse files Browse the repository at this point in the history
  • Loading branch information
waveywaves committed Jul 25, 2023
1 parent c786df8 commit 229a2fb
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 87 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.0.38
VERSION ?= 0.0.39

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand Down
70 changes: 35 additions & 35 deletions api/v1alpha1/uffizzicluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,88 +72,88 @@ type UffizziClusterIngress struct {
// quota of resources a namespace has access to
type UffizziClusterResourceQuota struct {
//+kubebuilder:default:=true
Enabled bool `json:"enabled,omitempty"`
Requests UffizziClusterRequestsQuota `json:"requests,omitempty"`
Limits UffizziClusterResourceQuotaLimits `json:"limits,omitempty"`
Services UffizziClusterServicesQuota `json:"services,omitempty"`
Count UffizziClusterResourceCount `json:"count,omitempty"`
Enabled bool `json:"enabled"`
Requests UffizziClusterRequestsQuota `json:"requests"`
Limits UffizziClusterResourceQuotaLimits `json:"limits"`
Services UffizziClusterServicesQuota `json:"services"`
Count UffizziClusterResourceCount `json:"count"`
}

type UffizziClusterLimitRange struct {
//+kubebuilder:default:=true
Enabled bool `json:"enabled,omitempty"`
Default UffizziClusterLimitRangeDefault `json:"default,omitempty"`
DefaultRequest UffizziClusterLimitRangeDefaultRequest `json:"defaultRequest,omitempty"`
Enabled bool `json:"enabled"`
Default UffizziClusterLimitRangeDefault `json:"default"`
DefaultRequest UffizziClusterLimitRangeDefaultRequest `json:"defaultRequest"`
}

type UffizziClusterRequestsQuota struct {
//+kubebuilder:default:="0.5"
CPU string `json:"cpu,omitempty"`
CPU string `json:"cpu"`
//+kubebuilder:default:="1Gi"
Memory string `json:"memory,omitempty"`
Memory string `json:"memory"`
//+kubebuilder:default:="5Gi"
EphemeralStorage string `json:"ephemeralStorage,omitempty"`
EphemeralStorage string `json:"ephemeralStorage"`
//+kubebuilder:default:="5Gi"
Storage string `json:"storage,omitempty"`
Storage string `json:"storage"`
}

type UffizziClusterResourceQuotaLimits struct {
//+kubebuilder:default:="0.5"
CPU string `json:"cpu,omitempty"`
CPU string `json:"cpu"`
//+kubebuilder:default:="8Gi"
Memory string `json:"memory,omitempty"`
Memory string `json:"memory"`
//+kubebuilder:default:="5Gi"
EphemeralStorage string `json:"ephemeralStorage,omitempty"`
EphemeralStorage string `json:"ephemeralStorage"`
}

type UffizziClusterLimitRangeDefault struct {
//+kubebuilder:default:="0.5"
CPU string `json:"cpu,omitempty"`
CPU string `json:"cpu"`
//+kubebuilder:default:="1Gi"
Memory string `json:"memory,omitempty"`
Memory string `json:"memory"`
//+kubebuilder:default:="8Gi"
EphemeralStorage string `json:"ephemeralStorage,omitempty"`
EphemeralStorage string `json:"ephemeralStorage"`
}

type UffizziClusterLimitRangeDefaultRequest struct {
//+kubebuilder:default:="0.1"
CPU string `json:"cpu,omitempty"`
CPU string `json:"cpu"`
//+kubebuilder:default:="128Mi"
Memory string `json:"memory,omitempty"`
Memory string `json:"memory"`
//+kubebuilder:default:="1Gi"
EphemeralStorage string `json:"ephemeralStorage,omitempty"`
EphemeralStorage string `json:"ephemeralStorage"`
}

type UffizziClusterServicesQuota struct {
//+kubebuilder:default:=0
NodePorts int `json:"nodePorts,omitempty"`
NodePorts int `json:"nodePorts"`
//+kubebuilder:default:=3
LoadBalancers int `json:"loadBalancers,omitempty"`
LoadBalancers int `json:"loadBalancers"`
}

type UffizziClusterResourceCount struct {
//+kubebuilder:default:=20
Pods int `json:"pods,omitempty"`
Pods int `json:"pods"`
//+kubebuilder:default:=10
Services int `json:"services,omitempty"`
Services int `json:"services"`
//+kubebuilder:default:=4
ConfigMaps int `json:"configMaps,omitempty"`
ConfigMaps int `json:"configMaps"`
//+kubebuilder:default:=20
Secrets int `json:"secrets,omitempty"`
Secrets int `json:"secrets"`
//+kubebuilder:default:=10
PersistentVolumeClaims int `json:"persistentVolumeClaims,omitempty"`
PersistentVolumeClaims int `json:"persistentVolumeClaims"`
//+kubebuilder:default:=10
Endpoints int `json:"endpoints,omitempty"`
Endpoints int `json:"endpoints"`
}

// UffizziClusterSpec defines the desired state of UffizziCluster
type UffizziClusterSpec struct {
Ingress UffizziClusterIngress `json:"ingress,omitempty"`
TTL string `json:"ttl,omitempty"`
Helm []HelmChart `json:"helm,omitempty"`
Manifests *string `json:"manifests,omitempty"`
ResourceQuota *UffizziClusterResourceQuota `json:"resourceQuota,omitempty"`
LimitRange *UffizziClusterLimitRange `json:"limitRange,omitempty"`
Ingress UffizziClusterIngress `json:"ingress,omitempty"`
TTL string `json:"ttl,omitempty"`
Helm []HelmChart `json:"helm,omitempty"`
Manifests *string `json:"manifests,omitempty"`
ResourceQuota UffizziClusterResourceQuota `json:"resourceQuota,omitempty"`
LimitRange UffizziClusterLimitRange `json:"limitRange,omitempty"`
}

// UffizziClusterStatus defines the observed state of UffizziCluster
Expand Down
12 changes: 2 additions & 10 deletions api/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version: 0.1.8
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v0.0.38"
appVersion: "v0.0.39"
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ spec:
memory:
default: 1Gi
type: string
required:
- cpu
- ephemeralStorage
- memory
type: object
defaultRequest:
properties:
Expand All @@ -140,10 +144,18 @@ spec:
memory:
default: 128Mi
type: string
required:
- cpu
- ephemeralStorage
- memory
type: object
enabled:
default: true
type: boolean
required:
- default
- defaultRequest
- enabled
type: object
manifests:
type: string
Expand All @@ -170,6 +182,13 @@ spec:
services:
default: 10
type: integer
required:
- configMaps
- endpoints
- persistentVolumeClaims
- pods
- secrets
- services
type: object
enabled:
default: true
Expand All @@ -185,6 +204,10 @@ spec:
memory:
default: 8Gi
type: string
required:
- cpu
- ephemeralStorage
- memory
type: object
requests:
properties:
Expand All @@ -200,6 +223,11 @@ spec:
storage:
default: 5Gi
type: string
required:
- cpu
- ephemeralStorage
- memory
- storage
type: object
services:
properties:
Expand All @@ -209,7 +237,16 @@ spec:
nodePorts:
default: 0
type: integer
required:
- loadBalancers
- nodePorts
type: object
required:
- count
- enabled
- limits
- requests
- services
type: object
ttl:
type: string
Expand Down
37 changes: 37 additions & 0 deletions config/crd/bases/uffizzi.com_uffizziclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ spec:
memory:
default: 1Gi
type: string
required:
- cpu
- ephemeralStorage
- memory
type: object
defaultRequest:
properties:
Expand All @@ -145,10 +149,18 @@ spec:
memory:
default: 128Mi
type: string
required:
- cpu
- ephemeralStorage
- memory
type: object
enabled:
default: true
type: boolean
required:
- default
- defaultRequest
- enabled
type: object
manifests:
type: string
Expand Down Expand Up @@ -176,6 +188,13 @@ spec:
services:
default: 10
type: integer
required:
- configMaps
- endpoints
- persistentVolumeClaims
- pods
- secrets
- services
type: object
enabled:
default: true
Expand All @@ -191,6 +210,10 @@ spec:
memory:
default: 8Gi
type: string
required:
- cpu
- ephemeralStorage
- memory
type: object
requests:
properties:
Expand All @@ -206,6 +229,11 @@ spec:
storage:
default: 5Gi
type: string
required:
- cpu
- ephemeralStorage
- memory
- storage
type: object
services:
properties:
Expand All @@ -215,7 +243,16 @@ spec:
nodePorts:
default: 0
type: integer
required:
- loadBalancers
- nodePorts
type: object
required:
- count
- enabled
- limits
- requests
- services
type: object
ttl:
type: string
Expand Down
Loading

0 comments on commit 229a2fb

Please sign in to comment.