Update client callers to use explicit versions
This commit is contained in:
@@ -162,13 +162,13 @@ func TestPodDeletionWithDswp(t *testing.T) {
|
||||
pod := fakePodWithVol(namespaceName)
|
||||
podStopCh := make(chan struct{})
|
||||
|
||||
if _, err := testClient.Core().Nodes().Create(node); err != nil {
|
||||
if _, err := testClient.CoreV1().Nodes().Create(node); err != nil {
|
||||
t.Fatalf("Failed to created node : %v", err)
|
||||
}
|
||||
|
||||
go informers.Core().V1().Nodes().Informer().Run(podStopCh)
|
||||
|
||||
if _, err := testClient.Core().Pods(ns.Name).Create(pod); err != nil {
|
||||
if _, err := testClient.CoreV1().Pods(ns.Name).Create(pod); err != nil {
|
||||
t.Errorf("Failed to create pod : %v", err)
|
||||
}
|
||||
|
||||
@@ -229,13 +229,13 @@ func TestPodUpdateWithWithADC(t *testing.T) {
|
||||
pod := fakePodWithVol(namespaceName)
|
||||
podStopCh := make(chan struct{})
|
||||
|
||||
if _, err := testClient.Core().Nodes().Create(node); err != nil {
|
||||
if _, err := testClient.CoreV1().Nodes().Create(node); err != nil {
|
||||
t.Fatalf("Failed to created node : %v", err)
|
||||
}
|
||||
|
||||
go informers.Core().V1().Nodes().Informer().Run(podStopCh)
|
||||
|
||||
if _, err := testClient.Core().Pods(ns.Name).Create(pod); err != nil {
|
||||
if _, err := testClient.CoreV1().Pods(ns.Name).Create(pod); err != nil {
|
||||
t.Errorf("Failed to create pod : %v", err)
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ func TestPodUpdateWithWithADC(t *testing.T) {
|
||||
|
||||
pod.Status.Phase = v1.PodSucceeded
|
||||
|
||||
if _, err := testClient.Core().Pods(ns.Name).UpdateStatus(pod); err != nil {
|
||||
if _, err := testClient.CoreV1().Pods(ns.Name).UpdateStatus(pod); err != nil {
|
||||
t.Errorf("Failed to update pod : %v", err)
|
||||
}
|
||||
|
||||
@@ -297,13 +297,13 @@ func TestPodUpdateWithKeepTerminatedPodVolumes(t *testing.T) {
|
||||
pod := fakePodWithVol(namespaceName)
|
||||
podStopCh := make(chan struct{})
|
||||
|
||||
if _, err := testClient.Core().Nodes().Create(node); err != nil {
|
||||
if _, err := testClient.CoreV1().Nodes().Create(node); err != nil {
|
||||
t.Fatalf("Failed to created node : %v", err)
|
||||
}
|
||||
|
||||
go informers.Core().V1().Nodes().Informer().Run(podStopCh)
|
||||
|
||||
if _, err := testClient.Core().Pods(ns.Name).Create(pod); err != nil {
|
||||
if _, err := testClient.CoreV1().Pods(ns.Name).Create(pod); err != nil {
|
||||
t.Errorf("Failed to create pod : %v", err)
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ func TestPodUpdateWithKeepTerminatedPodVolumes(t *testing.T) {
|
||||
|
||||
pod.Status.Phase = v1.PodSucceeded
|
||||
|
||||
if _, err := testClient.Core().Pods(ns.Name).UpdateStatus(pod); err != nil {
|
||||
if _, err := testClient.CoreV1().Pods(ns.Name).UpdateStatus(pod); err != nil {
|
||||
t.Errorf("Failed to update pod : %v", err)
|
||||
}
|
||||
|
||||
@@ -474,13 +474,13 @@ func TestPodAddedByDswp(t *testing.T) {
|
||||
pod := fakePodWithVol(namespaceName)
|
||||
podStopCh := make(chan struct{})
|
||||
|
||||
if _, err := testClient.Core().Nodes().Create(node); err != nil {
|
||||
if _, err := testClient.CoreV1().Nodes().Create(node); err != nil {
|
||||
t.Fatalf("Failed to created node : %v", err)
|
||||
}
|
||||
|
||||
go informers.Core().V1().Nodes().Informer().Run(podStopCh)
|
||||
|
||||
if _, err := testClient.Core().Pods(ns.Name).Create(pod); err != nil {
|
||||
if _, err := testClient.CoreV1().Pods(ns.Name).Create(pod); err != nil {
|
||||
t.Errorf("Failed to create pod : %v", err)
|
||||
}
|
||||
|
||||
@@ -549,7 +549,7 @@ func TestPVCBoundWithADC(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
if _, err := testClient.Core().Nodes().Create(node); err != nil {
|
||||
if _, err := testClient.CoreV1().Nodes().Create(node); err != nil {
|
||||
t.Fatalf("Failed to created node : %v", err)
|
||||
}
|
||||
|
||||
@@ -557,10 +557,10 @@ func TestPVCBoundWithADC(t *testing.T) {
|
||||
pvcs := []*v1.PersistentVolumeClaim{}
|
||||
for i := 0; i < 3; i++ {
|
||||
pod, pvc := fakePodWithPVC(fmt.Sprintf("fakepod-pvcnotbound-%d", i), fmt.Sprintf("fakepvc-%d", i), namespaceName)
|
||||
if _, err := testClient.Core().Pods(pod.Namespace).Create(pod); err != nil {
|
||||
if _, err := testClient.CoreV1().Pods(pod.Namespace).Create(pod); err != nil {
|
||||
t.Errorf("Failed to create pod : %v", err)
|
||||
}
|
||||
if _, err := testClient.Core().PersistentVolumeClaims(pvc.Namespace).Create(pvc); err != nil {
|
||||
if _, err := testClient.CoreV1().PersistentVolumeClaims(pvc.Namespace).Create(pvc); err != nil {
|
||||
t.Errorf("Failed to create pvc : %v", err)
|
||||
}
|
||||
pvcs = append(pvcs, pvc)
|
||||
@@ -568,7 +568,7 @@ func TestPVCBoundWithADC(t *testing.T) {
|
||||
// pod with no pvc
|
||||
podNew := fakePodWithVol(namespaceName)
|
||||
podNew.SetName("fakepod")
|
||||
if _, err := testClient.Core().Pods(podNew.Namespace).Create(podNew); err != nil {
|
||||
if _, err := testClient.CoreV1().Pods(podNew.Namespace).Create(podNew); err != nil {
|
||||
t.Errorf("Failed to create pod : %v", err)
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ func createPVForPVC(t *testing.T, testClient *clientset.Clientset, pvc *v1.Persi
|
||||
StorageClassName: *pvc.Spec.StorageClassName,
|
||||
},
|
||||
}
|
||||
if _, err := testClient.Core().PersistentVolumes().Create(pv); err != nil {
|
||||
if _, err := testClient.CoreV1().PersistentVolumes().Create(pv); err != nil {
|
||||
t.Errorf("Failed to create pv : %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ func TestPersistentVolumeRecycler(t *testing.T) {
|
||||
|
||||
// NOTE: This test cannot run in parallel, because it is creating and deleting
|
||||
// non-namespaced objects (PersistenceVolumes).
|
||||
defer testClient.Core().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
defer testClient.CoreV1().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
informers.Start(stopCh)
|
||||
@@ -171,7 +171,7 @@ func TestPersistentVolumeDeleter(t *testing.T) {
|
||||
|
||||
// NOTE: This test cannot run in parallel, because it is creating and deleting
|
||||
// non-namespaced objects (PersistenceVolumes).
|
||||
defer testClient.Core().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
defer testClient.CoreV1().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
informers.Start(stopCh)
|
||||
@@ -231,7 +231,7 @@ func TestPersistentVolumeBindRace(t *testing.T) {
|
||||
|
||||
// NOTE: This test cannot run in parallel, because it is creating and deleting
|
||||
// non-namespaced objects (PersistenceVolumes).
|
||||
defer testClient.Core().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
defer testClient.CoreV1().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
informers.Start(stopCh)
|
||||
@@ -301,7 +301,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) {
|
||||
|
||||
// NOTE: This test cannot run in parallel, because it is creating and deleting
|
||||
// non-namespaced objects (PersistenceVolumes).
|
||||
defer testClient.Core().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
defer testClient.CoreV1().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
informers.Start(stopCh)
|
||||
@@ -382,7 +382,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) {
|
||||
|
||||
// NOTE: This test cannot run in parallel, because it is creating and deleting
|
||||
// non-namespaced objects (PersistenceVolumes).
|
||||
defer testClient.Core().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
defer testClient.CoreV1().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
informers.Start(stopCh)
|
||||
@@ -482,7 +482,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) {
|
||||
|
||||
// NOTE: This test cannot run in parallel, because it is creating and deleting
|
||||
// non-namespaced objects (PersistenceVolumes).
|
||||
defer testClient.Core().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
defer testClient.CoreV1().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
informers.Start(stopCh)
|
||||
@@ -572,7 +572,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) {
|
||||
|
||||
// NOTE: This test cannot run in parallel, because it is creating and deleting
|
||||
// non-namespaced objects (PersistenceVolumes).
|
||||
defer testClient.Core().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
defer testClient.CoreV1().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
|
||||
controllerStopCh := make(chan struct{})
|
||||
informers.Start(controllerStopCh)
|
||||
@@ -862,7 +862,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) {
|
||||
|
||||
// NOTE: This test cannot run in parallel, because it is creating and deleting
|
||||
// non-namespaced objects (PersistenceVolumes and StorageClasses).
|
||||
defer testClient.Core().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
defer testClient.CoreV1().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
defer testClient.StorageV1().StorageClasses().DeleteCollection(nil, metav1.ListOptions{})
|
||||
|
||||
storageClass := storage.StorageClass{
|
||||
@@ -957,7 +957,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
|
||||
|
||||
// NOTE: This test cannot run in parallel, because it is creating and deleting
|
||||
// non-namespaced objects (PersistenceVolumes).
|
||||
defer testClient.Core().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
defer testClient.CoreV1().PersistentVolumes().DeleteCollection(nil, metav1.ListOptions{})
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
informers.Start(stopCh)
|
||||
@@ -1025,7 +1025,7 @@ func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) {
|
||||
|
||||
func waitForPersistentVolumePhase(client *clientset.Clientset, pvName string, w watch.Interface, phase v1.PersistentVolumePhase) {
|
||||
// Check if the volume is already in requested phase
|
||||
volume, err := client.Core().PersistentVolumes().Get(pvName, metav1.GetOptions{})
|
||||
volume, err := client.CoreV1().PersistentVolumes().Get(pvName, metav1.GetOptions{})
|
||||
if err == nil && volume.Status.Phase == phase {
|
||||
return
|
||||
}
|
||||
@@ -1046,7 +1046,7 @@ func waitForPersistentVolumePhase(client *clientset.Clientset, pvName string, w
|
||||
|
||||
func waitForPersistentVolumeClaimPhase(client *clientset.Clientset, claimName, namespace string, w watch.Interface, phase v1.PersistentVolumeClaimPhase) {
|
||||
// Check if the claim is already in requested phase
|
||||
claim, err := client.Core().PersistentVolumeClaims(namespace).Get(claimName, metav1.GetOptions{})
|
||||
claim, err := client.CoreV1().PersistentVolumeClaims(namespace).Get(claimName, metav1.GetOptions{})
|
||||
if err == nil && claim.Status.Phase == phase {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user