From 08944c4e50553403432dff366953a09d85336a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 29 Sep 2020 11:00:09 +0200 Subject: [PATCH] ceph: only support one external cluster secret MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We do not support providing both ROOK_EXTERNAL_USER_SECRET and ROOK_EXTERNAL_ADMIN_SECRET. When both are provided in the mon secret, the operator code will use the client.admin user for all its operations. This will break some of the logic when creating OBC since if client.admin is detected we assume the cluster is converged and thus pass args like this: ``` --rgw-realm=external-store --rgw-zonegroup=external-store --rgw-zone=external-store ``` To the radosgw-admin command, which won't work since Rook has no idea what the external realm/zonegroup/zone are, if any are configured. This fix should be sufficient for now, but moving forward we should probably enhance clusterInfo with an "isExternal" property to make things easier. Also supporting external realm/zonegroup/zone would be nice. This will probanly hit 1.5 once this code is promoted to stable. See: https://github.com/rook/rook/issues/6342 Closes: https://github.com/rook/rook/issues/6329 Signed-off-by: Sébastien Han --- cluster/examples/kubernetes/ceph/import-external-cluster.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cluster/examples/kubernetes/ceph/import-external-cluster.sh b/cluster/examples/kubernetes/ceph/import-external-cluster.sh index 8d65cfbf5..3687ea6b3 100644 --- a/cluster/examples/kubernetes/ceph/import-external-cluster.sh +++ b/cluster/examples/kubernetes/ceph/import-external-cluster.sh @@ -65,6 +65,10 @@ function checkEnvVars() { exit 1 fi fi + if [[ "$ROOK_EXTERNAL_ADMIN_SECRET" != "admin-secret" ]] && [ -n "$ROOK_EXTERNAL_USER_SECRET" ] ; then + echo "Providing both ROOK_EXTERNAL_ADMIN_SECRET and ROOK_EXTERNAL_USER_SECRET is not supported, choose one only." + exit 1 + fi } function importSecret() {