Merge pull request #55995 from supereagle/extensions-client-with-version

Automatic merge from submit-queue (batch tested with PRs 55900, 55995, 55913, 55467, 55376). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use extensions client with explicit version

**What this PR does / why we need it**:
Extensions client without explicit version has been deprecated, change them to the one with explicit version.

**Which issue(s) this PR fixes**:
Fixes partially #55993

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2017-12-14 00:45:15 -08:00
committed by GitHub
16 changed files with 42 additions and 42 deletions

View File

@@ -116,7 +116,7 @@ func newMatchingPod(podName, namespace string) *v1.Pod {
// sets and pods are rsNum and podNum. It returns error if the
// communication with the API server fails.
func verifyRemainingObjects(t *testing.T, clientSet clientset.Interface, namespace string, rsNum, podNum int) (bool, error) {
rsClient := clientSet.Extensions().ReplicaSets(namespace)
rsClient := clientSet.ExtensionsV1beta1().ReplicaSets(namespace)
podClient := clientSet.CoreV1().Pods(namespace)
pods, err := podClient.List(metav1.ListOptions{})
if err != nil {
@@ -200,7 +200,7 @@ func createRSsPods(t *testing.T, clientSet clientset.Interface, rss []*v1beta1.R
var createdRSs []*v1beta1.ReplicaSet
var createdPods []*v1.Pod
for _, rs := range rss {
createdRS, err := clientSet.Extensions().ReplicaSets(rs.Namespace).Create(rs)
createdRS, err := clientSet.ExtensionsV1beta1().ReplicaSets(rs.Namespace).Create(rs)
if err != nil {
t.Fatalf("Failed to create replica set %s: %v", rs.Name, err)
}
@@ -226,7 +226,7 @@ func waitRSStable(t *testing.T, clientSet clientset.Interface, rs *v1beta1.Repli
// Update .Spec.Replicas to replicas and verify .Status.Replicas is changed accordingly
func scaleRS(t *testing.T, c clientset.Interface, rs *v1beta1.ReplicaSet, replicas int32) {
rsClient := c.Extensions().ReplicaSets(rs.Namespace)
rsClient := c.ExtensionsV1beta1().ReplicaSets(rs.Namespace)
rs = updateRS(t, rsClient, rs.Name, func(rs *v1beta1.ReplicaSet) {
*rs.Spec.Replicas = replicas
})
@@ -361,7 +361,7 @@ func setPodsReadyCondition(t *testing.T, clientSet clientset.Interface, pods *v1
func testScalingUsingScaleSubresource(t *testing.T, c clientset.Interface, rs *v1beta1.ReplicaSet, replicas int32) {
ns := rs.Namespace
rsClient := c.Extensions().ReplicaSets(ns)
rsClient := c.ExtensionsV1beta1().ReplicaSets(ns)
newRS, err := rsClient.Get(rs.Name, metav1.GetOptions{})
if err != nil {
t.Fatalf("Failed to obtain rs %s: %v", rs.Name, err)
@@ -454,7 +454,7 @@ func TestAdoption(t *testing.T) {
ns := framework.CreateTestingNamespace(fmt.Sprintf("rs-adoption-%d", i), s, t)
defer framework.DeleteTestingNamespace(ns, s, t)
rsClient := clientSet.Extensions().ReplicaSets(ns.Name)
rsClient := clientSet.ExtensionsV1beta1().ReplicaSets(ns.Name)
podClient := clientSet.CoreV1().Pods(ns.Name)
const rsName = "rs"
rs, err := rsClient.Create(newRS(rsName, ns.Name, 1))
@@ -549,7 +549,7 @@ func TestSpecReplicasChange(t *testing.T) {
// Add a template annotation change to test RS's status does update
// without .Spec.Replicas change
rsClient := c.Extensions().ReplicaSets(ns.Name)
rsClient := c.ExtensionsV1beta1().ReplicaSets(ns.Name)
var oldGeneration int64
newRS := updateRS(t, rsClient, rs.Name, func(rs *v1beta1.ReplicaSet) {
oldGeneration = rs.Generation
@@ -819,7 +819,7 @@ func TestReadyAndAvailableReplicas(t *testing.T) {
// by setting LastTransitionTime to more than 3600 seconds ago
setPodsReadyCondition(t, c, thirdPodList, v1.ConditionTrue, time.Now().Add(-120*time.Minute))
rsClient := c.Extensions().ReplicaSets(ns.Name)
rsClient := c.ExtensionsV1beta1().ReplicaSets(ns.Name)
if err := wait.PollImmediate(interval, timeout, func() (bool, error) {
newRS, err := rsClient.Get(rs.Name, metav1.GetOptions{})
if err != nil {
@@ -898,7 +898,7 @@ func TestFullyLabeledReplicas(t *testing.T) {
waitRSStable(t, c, rs)
// Change RS's template labels to have extra labels, but not its selector
rsClient := c.Extensions().ReplicaSets(ns.Name)
rsClient := c.ExtensionsV1beta1().ReplicaSets(ns.Name)
updateRS(t, rsClient, rs.Name, func(rs *v1beta1.ReplicaSet) {
rs.Spec.Template.Labels = extraLabelMap
})