From 1f73d59dea583f9360beaeb5d2f9c337c691e7c8 Mon Sep 17 00:00:00 2001 From: Yu Chih Date: Sat, 4 Jan 2020 02:35:45 +0800 Subject: [PATCH] ceph: Add validation to cluster spec rgw port range When creating a CephObjectStore object, operator will use .Gateway.Port or .Gateway.SecurePort to create k8s Service object, if the port is invalid, the Service will not be created. Note .Gateway.Port/.Gateway.SecurePort should in 1~65535, however .Dashboard.Port is 0~65535 because 0 will use default setting for .Dashboard.Port and there is no such mechanism for .Gateway.Port/.Gateway.SecurePort Closes: https://github.com/rook/rook/issues/4574 Signed-off-by: Yu Chih --- cluster/charts/rook-ceph/templates/resources.yaml | 8 +++++++- cluster/examples/kubernetes/ceph/common.yaml | 8 +++++++- .../examples/kubernetes/ceph/upgrade-from-v1.1-crds.yaml | 8 +++++++- tests/framework/installer/ceph_manifests.go | 8 +++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/cluster/charts/rook-ceph/templates/resources.yaml b/cluster/charts/rook-ceph/templates/resources.yaml index b63838e64..c40f90701 100644 --- a/cluster/charts/rook-ceph/templates/resources.yaml +++ b/cluster/charts/rook-ceph/templates/resources.yaml @@ -316,7 +316,13 @@ spec: sslCertificateRef: {} port: type: integer - securePort: {} + minimum: 1 + maximum: 65535 + securePort: + type: integer + minimum: 1 + maximum: 65535 + nullable: true instances: type: integer annotations: {} diff --git a/cluster/examples/kubernetes/ceph/common.yaml b/cluster/examples/kubernetes/ceph/common.yaml index 57b18c491..1731f906a 100644 --- a/cluster/examples/kubernetes/ceph/common.yaml +++ b/cluster/examples/kubernetes/ceph/common.yaml @@ -370,7 +370,13 @@ spec: sslCertificateRef: {} port: type: integer - securePort: {} + minimum: 1 + maximum: 65535 + securePort: + type: integer + minimum: 1 + maximum: 65535 + nullable: true instances: type: integer annotations: {} diff --git a/cluster/examples/kubernetes/ceph/upgrade-from-v1.1-crds.yaml b/cluster/examples/kubernetes/ceph/upgrade-from-v1.1-crds.yaml index a2e03e82a..58e54d4cf 100644 --- a/cluster/examples/kubernetes/ceph/upgrade-from-v1.1-crds.yaml +++ b/cluster/examples/kubernetes/ceph/upgrade-from-v1.1-crds.yaml @@ -288,7 +288,13 @@ spec: sslCertificateRef: {} port: type: integer - securePort: {} + minimum: 1 + maximum: 65535 + securePort: + type: integer + minimum: 1 + maximum: 65535 + nullable: true instances: type: integer annotations: {} diff --git a/tests/framework/installer/ceph_manifests.go b/tests/framework/installer/ceph_manifests.go index 6e4106c11..82fa26942 100644 --- a/tests/framework/installer/ceph_manifests.go +++ b/tests/framework/installer/ceph_manifests.go @@ -389,7 +389,13 @@ spec: sslCertificateRef: {} port: type: integer - securePort: {} + minimum: 1 + maximum: 65535 + securePort: + type: integer + minimum: 1 + maximum: 65535 + nullable: true instances: type: integer annotations: {}