mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
manual changes to let client-gen use versioned options
This commit is contained in:
@@ -45,14 +45,14 @@ import (
|
||||
"k8s.io/kubernetes/test/integration/framework"
|
||||
)
|
||||
|
||||
func getOrphanOptions() *api.DeleteOptions {
|
||||
func getOrphanOptions() *v1.DeleteOptions {
|
||||
var trueVar = true
|
||||
return &api.DeleteOptions{OrphanDependents: &trueVar}
|
||||
return &v1.DeleteOptions{OrphanDependents: &trueVar}
|
||||
}
|
||||
|
||||
func getNonOrphanOptions() *api.DeleteOptions {
|
||||
func getNonOrphanOptions() *v1.DeleteOptions {
|
||||
var falseVar = false
|
||||
return &api.DeleteOptions{OrphanDependents: &falseVar}
|
||||
return &v1.DeleteOptions{OrphanDependents: &falseVar}
|
||||
}
|
||||
|
||||
const garbageCollectedPodName = "test.pod.1"
|
||||
@@ -166,7 +166,7 @@ func TestCascadingDeletion(t *testing.T) {
|
||||
t.Fatalf("Failed to create replication controller: %v", err)
|
||||
}
|
||||
|
||||
rcs, err := rcClient.List(api.ListOptions{})
|
||||
rcs, err := rcClient.List(v1.ListOptions{})
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to list replication controllers: %v", err)
|
||||
}
|
||||
@@ -199,7 +199,7 @@ func TestCascadingDeletion(t *testing.T) {
|
||||
}
|
||||
|
||||
// set up watch
|
||||
pods, err := podClient.List(api.ListOptions{})
|
||||
pods, err := podClient.List(v1.ListOptions{})
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to list pods: %v", err)
|
||||
}
|
||||
@@ -251,7 +251,7 @@ func TestCreateWithNonExistentOwner(t *testing.T) {
|
||||
}
|
||||
|
||||
// set up watch
|
||||
pods, err := podClient.List(api.ListOptions{})
|
||||
pods, err := podClient.List(v1.ListOptions{})
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to list pods: %v", err)
|
||||
}
|
||||
@@ -267,7 +267,7 @@ func TestCreateWithNonExistentOwner(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet clientset.Interface, nameSuffix, namespace string, initialFinalizers []string, options *api.DeleteOptions, wg *sync.WaitGroup, rcUIDs chan types.UID) {
|
||||
func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet clientset.Interface, nameSuffix, namespace string, initialFinalizers []string, options *v1.DeleteOptions, wg *sync.WaitGroup, rcUIDs chan types.UID) {
|
||||
defer wg.Done()
|
||||
rcClient := clientSet.Core().ReplicationControllers(namespace)
|
||||
podClient := clientSet.Core().Pods(namespace)
|
||||
@@ -307,7 +307,7 @@ func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet
|
||||
func verifyRemainingObjects(t *testing.T, clientSet clientset.Interface, namespace string, rcNum, podNum int) (bool, error) {
|
||||
rcClient := clientSet.Core().ReplicationControllers(namespace)
|
||||
podClient := clientSet.Core().Pods(namespace)
|
||||
pods, err := podClient.List(api.ListOptions{})
|
||||
pods, err := podClient.List(v1.ListOptions{})
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("Failed to list pods: %v", err)
|
||||
}
|
||||
@@ -316,7 +316,7 @@ func verifyRemainingObjects(t *testing.T, clientSet clientset.Interface, namespa
|
||||
ret = false
|
||||
t.Logf("expect %d pods, got %d pods", podNum, len(pods.Items))
|
||||
}
|
||||
rcs, err := rcClient.List(api.ListOptions{})
|
||||
rcs, err := rcClient.List(v1.ListOptions{})
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("Failed to list replication controllers: %v", err)
|
||||
}
|
||||
@@ -371,7 +371,7 @@ func TestStressingCascadingDeletion(t *testing.T) {
|
||||
|
||||
// verify the remaining pods all have "orphan" in their names.
|
||||
podClient := clientSet.Core().Pods(ns.Name)
|
||||
pods, err := podClient.List(api.ListOptions{})
|
||||
pods, err := podClient.List(v1.ListOptions{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -448,7 +448,7 @@ func TestOrphaning(t *testing.T) {
|
||||
}
|
||||
// verify the toBeDeleteRC is deleted
|
||||
if err := wait.PollImmediate(5*time.Second, 30*time.Second, func() (bool, error) {
|
||||
rcs, err := rcClient.List(api.ListOptions{})
|
||||
rcs, err := rcClient.List(v1.ListOptions{})
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
@@ -462,7 +462,7 @@ func TestOrphaning(t *testing.T) {
|
||||
}
|
||||
|
||||
// verify pods don't have the ownerPod as an owner anymore
|
||||
pods, err := podClient.List(api.ListOptions{})
|
||||
pods, err := podClient.List(v1.ListOptions{})
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to list pods: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user