From d7906266e10dc8116a18b4a1dd2b78cdbba4efed Mon Sep 17 00:00:00 2001 From: Elise Gafford Date: Thu, 23 Jan 2020 16:54:09 -0500 Subject: [PATCH] ceph: remove validation on SecurePort for k8s <= 1.13 Versions of k8s prior to 1.14 do not support the nullable field in CRD properties. As k8s 1.13 remains part of our support matrix and as this field must remain nullable, we must remove CRD validation of SecurePort. Range validation of this field has been moved into the logic of rgw.validateStore. Fixes: #4693 Signed-off-by: Elise Gafford --- cluster/charts/rook-ceph/templates/resources.yaml | 6 +----- cluster/examples/kubernetes/ceph/common.yaml | 6 +----- .../examples/kubernetes/ceph/upgrade-from-v1.1-crds.yaml | 6 +----- pkg/operator/ceph/object/rgw.go | 4 ++++ tests/framework/installer/ceph_manifests.go | 6 +----- 5 files changed, 8 insertions(+), 20 deletions(-) diff --git a/cluster/charts/rook-ceph/templates/resources.yaml b/cluster/charts/rook-ceph/templates/resources.yaml index c40f90701..cdcbd582a 100644 --- a/cluster/charts/rook-ceph/templates/resources.yaml +++ b/cluster/charts/rook-ceph/templates/resources.yaml @@ -318,11 +318,7 @@ spec: type: integer minimum: 1 maximum: 65535 - securePort: - type: integer - minimum: 1 - maximum: 65535 - nullable: true + securePort: {} instances: type: integer annotations: {} diff --git a/cluster/examples/kubernetes/ceph/common.yaml b/cluster/examples/kubernetes/ceph/common.yaml index 1731f906a..23b06d6ef 100644 --- a/cluster/examples/kubernetes/ceph/common.yaml +++ b/cluster/examples/kubernetes/ceph/common.yaml @@ -372,11 +372,7 @@ spec: type: integer minimum: 1 maximum: 65535 - securePort: - type: integer - minimum: 1 - maximum: 65535 - nullable: true + securePort: {} 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 58e54d4cf..f06c4308d 100644 --- a/cluster/examples/kubernetes/ceph/upgrade-from-v1.1-crds.yaml +++ b/cluster/examples/kubernetes/ceph/upgrade-from-v1.1-crds.yaml @@ -290,11 +290,7 @@ spec: type: integer minimum: 1 maximum: 65535 - securePort: - type: integer - minimum: 1 - maximum: 65535 - nullable: true + securePort: {} instances: type: integer annotations: {} diff --git a/pkg/operator/ceph/object/rgw.go b/pkg/operator/ceph/object/rgw.go index d658f2ee0..b7ef78749 100644 --- a/pkg/operator/ceph/object/rgw.go +++ b/pkg/operator/ceph/object/rgw.go @@ -342,6 +342,10 @@ func validateStore(context *clusterd.Context, s cephv1.CephObjectStore) error { if s.Namespace == "" { return errors.New("missing namespace") } + securePort := s.Spec.Gateway.SecurePort + if securePort < 0 || securePort > 65535 { + return errors.Errorf("securePort value of %d must be between 0 and 65535", securePort) + } if err := pool.ValidatePoolSpec(context, s.Namespace, &s.Spec.MetadataPool); err != nil { return errors.Wrapf(err, "invalid metadata pool spec") } diff --git a/tests/framework/installer/ceph_manifests.go b/tests/framework/installer/ceph_manifests.go index 82fa26942..188a5151c 100644 --- a/tests/framework/installer/ceph_manifests.go +++ b/tests/framework/installer/ceph_manifests.go @@ -391,11 +391,7 @@ spec: type: integer minimum: 1 maximum: 65535 - securePort: - type: integer - minimum: 1 - maximum: 65535 - nullable: true + securePort: {} instances: type: integer annotations: {}