diff --git a/Makefile b/Makefile index 4b5a8225b..d52f380c5 100644 --- a/Makefile +++ b/Makefile @@ -267,14 +267,14 @@ endef .PHONY: redhat-certificated-bundle redhat-certificated-bundle: yq kustomize manifests operator-sdk generate kustomize manifests -q - cd config/manager && $(KUSTOMIZE) edit set image controller=$(shell docker images --digests --format "{{.Repository}}@{{.Digest}}" $(OPERATOR_IMG)) + cd config/manager && $(KUSTOMIZE) edit set image controller=$(shell docker inspect --format='{{json .RepoDigests}}' $(OPERATOR_IMG) | jq --arg IMAGE_TAG_BASE "$(IMAGE_TAG_BASE)" -c '.[] | select(index($$IMAGE_TAG_BASE))' -r) $(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) $(YQ) eval -i ".metadata.annotations.\"olm.skipRange\" = \"<$(VERSION)\"" bundle/manifests/function-mesh.clusterserviceversion.yaml $(YQ) eval -i ".metadata.annotations.\"olm.properties\" = ([{\"type\": \"olm.maxOpenShiftVersion\", \"value\": \"4.11\"}] | @json)" bundle/manifests/function-mesh.clusterserviceversion.yaml $(YQ) eval -i ".metadata.annotations.createdAt = \"$(BUILD_DATETIME)\"" bundle/manifests/function-mesh.clusterserviceversion.yaml - $(YQ) eval -i ".metadata.annotations.containerImage = \"$(shell docker images --digests --format "{{.Repository}}@{{.Digest}}" $(OPERATOR_IMG))\"" bundle/manifests/function-mesh.clusterserviceversion.yaml + $(YQ) eval -i ".metadata.annotations.containerImage = \"$(shell docker inspect --format='{{json .RepoDigests}}' $(OPERATOR_IMG) | jq --arg IMAGE_TAG_BASE "$(IMAGE_TAG_BASE)" -c '.[] | select(index($$IMAGE_TAG_BASE))' -r)\"" bundle/manifests/function-mesh.clusterserviceversion.yaml $(YQ) eval -i '.annotations += {"operators.operatorframework.io.bundle.channel.default.v1":"alpha"}' bundle/metadata/annotations.yaml - IMG_DIGIEST=$(shell docker images --digests --format "{{.Repository}}@{{.Digest}}" $(OPERATOR_IMG)) hack/postprocess-bundle.sh + IMG_DIGIEST=$(shell docker inspect --format='{{json .RepoDigests}}' $(OPERATOR_IMG) | jq --arg IMAGE_TAG_BASE "$(IMAGE_TAG_BASE)" -c '.[] | select(index($$IMAGE_TAG_BASE))' -r) hack/postprocess-bundle.sh operator-sdk bundle validate ./bundle --select-optional name=operatorhub operator-sdk bundle validate ./bundle --select-optional suite=operatorframework diff --git a/api/compute/v1alpha1/function_types.go b/api/compute/v1alpha1/function_types.go index 19fe70a8e..998f1bb9d 100644 --- a/api/compute/v1alpha1/function_types.go +++ b/api/compute/v1alpha1/function_types.go @@ -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"` diff --git a/api/compute/v1alpha1/sink_types.go b/api/compute/v1alpha1/sink_types.go index 9c73b54bd..8ce4a79ee 100644 --- a/api/compute/v1alpha1/sink_types.go +++ b/api/compute/v1alpha1/sink_types.go @@ -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"` diff --git a/api/compute/v1alpha1/source_types.go b/api/compute/v1alpha1/source_types.go index ea5ce7aed..89478237f 100644 --- a/api/compute/v1alpha1/source_types.go +++ b/api/compute/v1alpha1/source_types.go @@ -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"` diff --git a/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functionmeshes.yaml b/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functionmeshes.yaml index b14fe376c..5c7ef4778 100644 --- a/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functionmeshes.yaml +++ b/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functionmeshes.yaml @@ -226,6 +226,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -3190,6 +3191,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer @@ -3499,6 +3501,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -6407,6 +6410,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer @@ -6621,6 +6625,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -9585,6 +9590,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer diff --git a/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functions.yaml b/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functions.yaml index 2ab2006a9..0fc5c4afc 100644 --- a/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functions.yaml +++ b/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functions.yaml @@ -245,6 +245,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -3209,6 +3210,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer diff --git a/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sinks.yaml b/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sinks.yaml index a74583f8f..e25bbb279 100644 --- a/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sinks.yaml +++ b/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sinks.yaml @@ -235,6 +235,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -3143,6 +3144,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer diff --git a/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sources.yaml b/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sources.yaml index 00a82ec51..4680fe1fc 100644 --- a/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sources.yaml +++ b/charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sources.yaml @@ -166,6 +166,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -3130,6 +3131,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer diff --git a/config/crd/bases/compute.functionmesh.io_functionmeshes.yaml b/config/crd/bases/compute.functionmesh.io_functionmeshes.yaml index c9ea92549..8ce5ff112 100644 --- a/config/crd/bases/compute.functionmesh.io_functionmeshes.yaml +++ b/config/crd/bases/compute.functionmesh.io_functionmeshes.yaml @@ -227,6 +227,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -3191,6 +3192,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer @@ -3500,6 +3502,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -6408,6 +6411,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer @@ -6622,6 +6626,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -9586,6 +9591,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer diff --git a/config/crd/bases/compute.functionmesh.io_functions.yaml b/config/crd/bases/compute.functionmesh.io_functions.yaml index a99332e64..e4f32277d 100644 --- a/config/crd/bases/compute.functionmesh.io_functions.yaml +++ b/config/crd/bases/compute.functionmesh.io_functions.yaml @@ -224,6 +224,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -3188,6 +3189,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer diff --git a/config/crd/bases/compute.functionmesh.io_sinks.yaml b/config/crd/bases/compute.functionmesh.io_sinks.yaml index c64d2aad1..303c8d708 100644 --- a/config/crd/bases/compute.functionmesh.io_sinks.yaml +++ b/config/crd/bases/compute.functionmesh.io_sinks.yaml @@ -214,6 +214,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -3122,6 +3123,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer diff --git a/config/crd/bases/compute.functionmesh.io_sources.yaml b/config/crd/bases/compute.functionmesh.io_sources.yaml index bbd844253..5e39c5bb5 100644 --- a/config/crd/bases/compute.functionmesh.io_sources.yaml +++ b/config/crd/bases/compute.functionmesh.io_sources.yaml @@ -145,6 +145,7 @@ spec: format: int32 type: integer minReplicas: + default: 1 format: int32 minimum: 1 type: integer @@ -3109,6 +3110,7 @@ spec: - py type: object replicas: + default: 1 format: int32 minimum: 1 type: integer