ceph: relax pre-requisite for external cluster

We now differentiate the cases where:

* we only consume the external cluster
* we consume the external cluster as well as creating stateless
resources in Kubernetes (bootstrap mds,rgw, nfs)

This is mostly controlled via the image property spec. If not defined,
not extra CRs won't be able to be created.

Now the external cluster feature supports Ceph cluster as of Luminous 12.2.

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han committed 2019-10-08 10:52:01 +02:00
1 parent 233df963e7
commit 148f8da1fb
15 files changed
+148 -64

No files matched your search

+15
View File
@@ -96,6 +96,11 @@ func (c *ObjectStoreController) StartWatch(namespace string, stopCh chan struct{
}
func (c *ObjectStoreController) onAdd(obj interface{}) {
if c.clusterSpec.External.Enable && c.clusterSpec.CephVersion.Image == "" {
logger.Warningf("Creating object store for an external ceph cluster is disabled because no Ceph image is specified")
return
}
objectstore, err := getObjectStoreObject(obj)
if err != nil {
logger.Errorf("failed to get objectstore object: %+v", err)
@@ -118,6 +123,11 @@ func (c *ObjectStoreController) onAdd(obj interface{}) {
}
func (c *ObjectStoreController) onUpdate(oldObj, newObj interface{}) {
if c.clusterSpec.External.Enable && c.clusterSpec.CephVersion.Image == "" {
logger.Warningf("Updating object store for an external ceph cluster is disabled because no Ceph image is specified")
return
}
// if the object store spec is modified, update the object store
oldStore, err := getObjectStoreObject(oldObj)
if err != nil {
@@ -159,6 +169,11 @@ func (c *ObjectStoreController) createOrUpdateStore(objectstore *cephv1.CephObje
}
func (c *ObjectStoreController) onDelete(obj interface{}) {
if c.clusterSpec.External.Enable && c.clusterSpec.CephVersion.Image == "" {
logger.Warningf("Deleting object store for an external ceph cluster is disabled because no Ceph image is specified")
return
}
objectstore, err := getObjectStoreObject(obj)
if err != nil {
logger.Errorf("failed to get objectstore object: %+v", err)