mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
cleanup: move k8s functions to the util/k8s package
By placing the NewK8sClient() function in its own package, the KMS API can be split from the "internal/util" package. Some of the KMS providers use the NewK8sClient() function, and this causes circular dependencies between "internal/utils" -> "internal/kms" -> "internal/utils", which are not alowed in Go. Updates: #852 Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
2cc96dc539
commit
778b5e86de
@ -21,6 +21,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/ceph/ceph-csi/internal/util"
|
||||
kubeclient "github.com/ceph/ceph-csi/internal/util/k8s"
|
||||
"github.com/ceph/ceph-csi/internal/util/log"
|
||||
|
||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||
@ -128,7 +129,7 @@ func callNodeStageVolume(ns *NodeServer, c *k8s.Clientset, pv *v1.PersistentVolu
|
||||
|
||||
// runVolumeHealer heal the volumes attached on a node.
|
||||
func runVolumeHealer(ns *NodeServer, conf *util.Config) error {
|
||||
c := util.NewK8sClient()
|
||||
c := kubeclient.NewK8sClient()
|
||||
val, err := c.StorageV1().VolumeAttachments().List(context.TODO(), metav1.ListOptions{})
|
||||
if err != nil {
|
||||
log.ErrorLogMsg("list volumeAttachments failed, err: %v", err)
|
||||
|
@ -29,6 +29,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/ceph/ceph-csi/internal/util"
|
||||
"github.com/ceph/ceph-csi/internal/util/k8s"
|
||||
"github.com/ceph/ceph-csi/internal/util/log"
|
||||
|
||||
"github.com/ceph/go-ceph/rados"
|
||||
@ -1063,7 +1064,7 @@ func genVolFromVolID(
|
||||
// be the same in the PV.Spec.CSI.VolumeHandle. Check the PV annotation for
|
||||
// the new volumeHandle. If the new volumeHandle is found, generate the RBD
|
||||
// volume structure from the new volumeHandle.
|
||||
c := util.NewK8sClient()
|
||||
c := k8s.NewK8sClient()
|
||||
listOpt := metav1.ListOptions{
|
||||
LabelSelector: PVReplicatedLabelKey,
|
||||
}
|
||||
|
Reference in New Issue
Block a user