Skip to content

Commit

Permalink
Merge pull request rook#13054 from rook/mergify/bp/release-1.12/pr-13046
Browse files Browse the repository at this point in the history
osd: print warning message if no matching node found for osd (backport rook#13046)
  • Loading branch information
travisn authored Oct 18, 2023
2 parents 58cf35a + 959d5de commit 14736d9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/operator/k8sutil/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,18 @@ func GetKubernetesNodesMatchingRookNodes(ctx context.Context, rookNodes []cephv1
if err != nil {
return nodes, fmt.Errorf("failed to list kubernetes nodes. %+v", err)
}
for _, kn := range k8sNodes.Items {
for _, rn := range rookNodes {
for _, rn := range rookNodes {
nodeFound := false
for _, kn := range k8sNodes.Items {
if rookNodeMatchesKubernetesNode(rn, kn) {
nodes = append(nodes, kn)
nodeFound = true
break
}
}
if !nodeFound {
logger.Warningf("failed to find matching kubernetes node for %q. Check the CephCluster's config and confirm each 'name' field in spec.storage.nodes matches their 'kubernetes.io/hostname' label", rn.Name)
}
}
return nodes, nil
}
Expand Down

0 comments on commit 14736d9

Please sign in to comment.