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:
Niels de Vos
2021-08-26 13:15:47 +02:00
committed by mergify[bot]
parent 2cc96dc539
commit 778b5e86de
8 changed files with 22 additions and 11 deletions

View File

@ -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,
}