mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-13 06:04:02 +00:00
Merge pull request #49763 from supereagle/versioned-group-clients
Automatic merge from submit-queue (batch tested with PRs 55331, 55272, 55228, 49763, 55242). 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 versiond group clients from client-go **What this PR does / why we need it**: Some **Deprecated** group clients are still used, replace them with versioned group clients. **Which issue this PR fixes**: fixes #49760 **Special notes for your reviewer**: /assign @caesarxuchao **Release note**: ```release-note NONE ```
This commit is contained in:
@@ -591,7 +591,7 @@ func WaitForPodsRunningReady(c clientset.Interface, ns string, minPods, allowedN
|
||||
replicaOk += rc.Status.ReadyReplicas
|
||||
}
|
||||
|
||||
rsList, err := c.Extensions().ReplicaSets(ns).List(metav1.ListOptions{})
|
||||
rsList, err := c.ExtensionsV1beta1().ReplicaSets(ns).List(metav1.ListOptions{})
|
||||
if err != nil {
|
||||
Logf("Error getting replication sets in namespace %q: %v", ns, err)
|
||||
if IsRetryableAPIError(err) {
|
||||
@@ -2796,13 +2796,13 @@ func getRuntimeObjectForKind(c clientset.Interface, kind schema.GroupKind, ns, n
|
||||
case api.Kind("ReplicationController"):
|
||||
return c.CoreV1().ReplicationControllers(ns).Get(name, metav1.GetOptions{})
|
||||
case extensionsinternal.Kind("ReplicaSet"), appsinternal.Kind("ReplicaSet"):
|
||||
return c.Extensions().ReplicaSets(ns).Get(name, metav1.GetOptions{})
|
||||
return c.ExtensionsV1beta1().ReplicaSets(ns).Get(name, metav1.GetOptions{})
|
||||
case extensionsinternal.Kind("Deployment"), appsinternal.Kind("Deployment"):
|
||||
return c.Extensions().Deployments(ns).Get(name, metav1.GetOptions{})
|
||||
return c.ExtensionsV1beta1().Deployments(ns).Get(name, metav1.GetOptions{})
|
||||
case extensionsinternal.Kind("DaemonSet"):
|
||||
return c.Extensions().DaemonSets(ns).Get(name, metav1.GetOptions{})
|
||||
return c.ExtensionsV1beta1().DaemonSets(ns).Get(name, metav1.GetOptions{})
|
||||
case batchinternal.Kind("Job"):
|
||||
return c.Batch().Jobs(ns).Get(name, metav1.GetOptions{})
|
||||
return c.BatchV1().Jobs(ns).Get(name, metav1.GetOptions{})
|
||||
default:
|
||||
return nil, fmt.Errorf("Unsupported kind when getting runtime object: %v", kind)
|
||||
}
|
||||
@@ -2813,13 +2813,13 @@ func deleteResource(c clientset.Interface, kind schema.GroupKind, ns, name strin
|
||||
case api.Kind("ReplicationController"):
|
||||
return c.CoreV1().ReplicationControllers(ns).Delete(name, deleteOption)
|
||||
case extensionsinternal.Kind("ReplicaSet"), appsinternal.Kind("ReplicaSet"):
|
||||
return c.Extensions().ReplicaSets(ns).Delete(name, deleteOption)
|
||||
return c.ExtensionsV1beta1().ReplicaSets(ns).Delete(name, deleteOption)
|
||||
case extensionsinternal.Kind("Deployment"), appsinternal.Kind("Deployment"):
|
||||
return c.Extensions().Deployments(ns).Delete(name, deleteOption)
|
||||
return c.ExtensionsV1beta1().Deployments(ns).Delete(name, deleteOption)
|
||||
case extensionsinternal.Kind("DaemonSet"):
|
||||
return c.Extensions().DaemonSets(ns).Delete(name, deleteOption)
|
||||
return c.ExtensionsV1beta1().DaemonSets(ns).Delete(name, deleteOption)
|
||||
case batchinternal.Kind("Job"):
|
||||
return c.Batch().Jobs(ns).Delete(name, deleteOption)
|
||||
return c.BatchV1().Jobs(ns).Delete(name, deleteOption)
|
||||
default:
|
||||
return fmt.Errorf("Unsupported kind when deleting: %v", kind)
|
||||
}
|
||||
@@ -4096,7 +4096,7 @@ func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []st
|
||||
|
||||
// getIngressAddress returns the ips/hostnames associated with the Ingress.
|
||||
func getIngressAddress(client clientset.Interface, ns, name string) ([]string, error) {
|
||||
ing, err := client.Extensions().Ingresses(ns).Get(name, metav1.GetOptions{})
|
||||
ing, err := client.ExtensionsV1beta1().Ingresses(ns).Get(name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user