ceph: correctly return if multus was applied

We must only return if multus got configured successfully.

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han
2020-08-25 09:54:18 +02:00
parent 06ab07be8b
commit 8668e1f69c
+3 -1
View File
@@ -523,6 +523,7 @@ func deleteCSIDriverResources(
}
func applyCephClusterNetworkConfig(objectMeta *metav1.ObjectMeta, rookclientset rookclient.Interface) (bool, error) {
var isMultusApplied bool
cephClusters, err := rookclientset.CephV1().CephClusters(objectMeta.Namespace).List(metav1.ListOptions{})
if err != nil {
return false, errors.Errorf("failed to find CephClusters in namespace %q", objectMeta.Namespace)
@@ -533,10 +534,11 @@ func applyCephClusterNetworkConfig(objectMeta *metav1.ObjectMeta, rookclientset
if err != nil {
return false, errors.Wrapf(err, "failed to apply multus configuration to CephCluster %q", cephCluster.Name)
}
isMultusApplied = true
}
}
return true, nil
return isMultusApplied, nil
}
// createCSIDriverInfo Registers CSI driver by creating a CSIDriver object