rbd: do not start the healer for NBD on non-Kubernetes platforms

When running on Docker Swarm, the RBD-healer fails with an error like:

> healer had failures, err failed to get cluster config: unable to load
> in-cluster configuration, KUBERNETES_SERVICE_HOST and
> KUBERNETES_SERVICE_PORT must be defined

Before starting the healer, check if we're running on Kubernetes, so
that non-Kubernetes platforms do not get confusing warnings.

Updates: #3769
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos 2025-03-31 10:40:50 +02:00 committed by mergify[bot]
parent 4b113097be
commit 437d90c84d

View File

@ -201,7 +201,7 @@ func (r *Driver) Run(conf *util.Config) {
r.startProfiling(conf)
if conf.IsNodeServer {
if conf.IsNodeServer && k8s.RunsOnKubernetes() {
go func() {
// TODO: move the healer to csi-addons
err := rbd.RunVolumeHealer(r.ns, conf)