Merge pull request #8638 from leseb/avoid-multiple-reconcile

ceph: avoid multiple reconciles of ceph cluster
This commit is contained in:
Travis Nielsen authored and GitHub committed 2021-09-02 08:28:27 -06:00
commit 790e01b007
4 files changed
+6 -3

No files matched your search

@@ -1244,7 +1244,6 @@ spec:
description: HostNetwork to enable host network
type: boolean
ipFamily:
default: IPv4
description: IPFamily is the single stack IPv6 or IPv4 protocol
enum:
- IPv4
@@ -1244,7 +1244,6 @@ spec:
description: HostNetwork to enable host network
type: boolean
ipFamily:
default: IPv4
description: IPFamily is the single stack IPv6 or IPv4 protocol
enum:
- IPv4
-1
View File
@@ -1644,7 +1644,6 @@ type NetworkSpec struct {
// IPFamily is the single stack IPv6 or IPv4 protocol
// +kubebuilder:validation:Enum=IPv4;IPv6
// +kubebuilder:default=IPv4
// +nullable
// +optional
IPFamily IPFamilyType `json:"ipFamily,omitempty"`
+6
View File
@@ -19,11 +19,13 @@ package cluster
import (
"context"
"strings"
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
"github.com/rook/rook/pkg/clusterd"
cephclient "github.com/rook/rook/pkg/daemon/ceph/client"
discoverDaemon "github.com/rook/rook/pkg/daemon/discover"
opcontroller "github.com/rook/rook/pkg/operator/ceph/controller"
"github.com/rook/rook/pkg/operator/k8sutil"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -107,6 +109,10 @@ func (c *clientCluster) onK8sNode(object runtime.Object) bool {
clusterInfo := cephclient.AdminClusterInfo(cluster.Namespace)
osds, err := cephclient.GetOSDOnHost(c.context, clusterInfo, nodeName)
if err != nil {
if strings.Contains(err.Error(), opcontroller.UninitializedCephConfigError) {
logger.Debug(opcontroller.OperatorNotInitializedMessage)
return false
}
// If it fails, this might be due to the the operator just starting and catching an add event for that node
logger.Debugf("failed to get osds on node %q, assume reconcile is necessary", nodeName)
return true