From 7b8d3fd27bd37f2a671406a9cf33f87979fb1dcd Mon Sep 17 00:00:00 2001 From: Ali Maredia Date: Fri, 6 Aug 2021 13:17:24 -0400 Subject: [PATCH] ceph: change required pattern for pull realm endpoint Ensure that the endpoint for the pull realm spec starts with "http" or "https". Also update object-multisite-pull-realm(-test).yaml with updated comments. Signed-off-by: Ali Maredia --- .../kubernetes/ceph/object-multisite-pull-realm-test.yaml | 6 +++++- .../kubernetes/ceph/object-multisite-pull-realm.yaml | 6 +++++- pkg/apis/ceph.rook.io/v1/types.go | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cluster/examples/kubernetes/ceph/object-multisite-pull-realm-test.yaml b/cluster/examples/kubernetes/ceph/object-multisite-pull-realm-test.yaml index a11e6072a..f16ca586c 100644 --- a/cluster/examples/kubernetes/ceph/object-multisite-pull-realm-test.yaml +++ b/cluster/examples/kubernetes/ceph/object-multisite-pull-realm-test.yaml @@ -20,8 +20,12 @@ metadata: namespace: rook-ceph-secondary spec: # This endpoint in this section needs is an endpoint from the master zone in the master zone group of realm-a. See object-multisite.md for more details. + # This value must include http(s):// at the beginning + # ex: + # pull: + # endpoint: http://10.103.133.16:80 pull: - endpoint: http://10.103.133.16:80 + endpoint: --- apiVersion: ceph.rook.io/v1 kind: CephObjectZoneGroup diff --git a/cluster/examples/kubernetes/ceph/object-multisite-pull-realm.yaml b/cluster/examples/kubernetes/ceph/object-multisite-pull-realm.yaml index ed6cd786e..4bd8d0689 100644 --- a/cluster/examples/kubernetes/ceph/object-multisite-pull-realm.yaml +++ b/cluster/examples/kubernetes/ceph/object-multisite-pull-realm.yaml @@ -21,8 +21,12 @@ metadata: namespace: rook-ceph-secondary spec: # This endpoint in this section needs is an endpoint from the master zone in the master zone group of realm-a. See object-multisite.md for more details. + # This value must include http(s):// at the beginning + # ex: + # pull: + # endpoint: http://10.103.133.16:80 pull: - endpoint: http://10.103.133.16:80 + endpoint: --- apiVersion: ceph.rook.io/v1 kind: CephObjectZoneGroup diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go index 6bb4b7950..7d82bbacd 100755 --- a/pkg/apis/ceph.rook.io/v1/types.go +++ b/pkg/apis/ceph.rook.io/v1/types.go @@ -1469,6 +1469,7 @@ type ObjectRealmSpec struct { // PullSpec represents the pulling specification of a Ceph Object Storage Gateway Realm type PullSpec struct { + // +kubebuilder:validation:Pattern=`^https*://` Endpoint string `json:"endpoint"` }