Skip to content

Commit

Permalink
add default values for minReplicas and replicas (streamnative#582)
Browse files Browse the repository at this point in the history
* add default value to minReplicas and replicas

Signed-off-by: laminar <[email protected]>

* change docker command to get image digest

Signed-off-by: laminar <[email protected]>

---------

Signed-off-by: laminar <[email protected]>
  • Loading branch information
tpiperatgod authored and jiangpengcheng committed Mar 3, 2023
1 parent 4f5f71b commit c7dfcf2
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/compute/v1alpha1/function_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ type FunctionSpec struct {
Namespace string `json:"namespace,omitempty"`
ClusterName string `json:"clusterName,omitempty"`
// +kubebuilder:validation:Minimum=1
// +kubebuilder:default=1
Replicas *int32 `json:"replicas,omitempty"`
// +kubebuilder:validation:Minimum=1
// +kubebuilder:default=1
MinReplicas *int32 `json:"minReplicas,omitempty"`

DownloaderImage string `json:"downloaderImage,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions api/compute/v1alpha1/sink_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ type SinkSpec struct {
Namespace string `json:"namespace,omitempty"`
SinkType string `json:"sinkType,omitempty"` // refer to `--sink-type` as builtin connector
// +kubebuilder:validation:Minimum=1
// +kubebuilder:default=1
Replicas *int32 `json:"replicas,omitempty"`
// +kubebuilder:validation:Minimum=1
// +kubebuilder:default=1
MinReplicas *int32 `json:"minReplicas,omitempty"`

DownloaderImage string `json:"downloaderImage,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions api/compute/v1alpha1/source_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ type SourceSpec struct {
ClusterName string `json:"clusterName,omitempty"`
SourceType string `json:"sourceType,omitempty"` // refer to `--source-type` as builtin connector
// +kubebuilder:validation:Minimum=1
// +kubebuilder:default=1
Replicas *int32 `json:"replicas,omitempty"`
// +kubebuilder:validation:Minimum=1
// +kubebuilder:default=1
MinReplicas *int32 `json:"minReplicas,omitempty"`

DownloaderImage string `json:"downloaderImage,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -3190,6 +3191,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -3499,6 +3501,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -6407,6 +6410,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -6621,6 +6625,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -9585,6 +9590,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -3209,6 +3210,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -3143,6 +3144,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -3130,6 +3131,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/compute.functionmesh.io_functionmeshes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -3191,6 +3192,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -3500,6 +3502,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -6408,6 +6411,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -6622,6 +6626,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -9586,6 +9591,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/compute.functionmesh.io_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -3188,6 +3189,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/compute.functionmesh.io_sinks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -3122,6 +3123,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/compute.functionmesh.io_sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ spec:
format: int32
type: integer
minReplicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down Expand Up @@ -3109,6 +3110,7 @@ spec:
- py
type: object
replicas:
default: 1
format: int32
minimum: 1
type: integer
Expand Down

0 comments on commit c7dfcf2

Please sign in to comment.