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:
@@ -333,11 +333,11 @@ func (o *DrainOptions) getController(namespace string, controllerRef *metav1.Own
|
||||
case "ReplicationController":
|
||||
return o.client.CoreV1().ReplicationControllers(namespace).Get(controllerRef.Name, metav1.GetOptions{})
|
||||
case "DaemonSet":
|
||||
return o.client.Extensions().DaemonSets(namespace).Get(controllerRef.Name, metav1.GetOptions{})
|
||||
return o.client.ExtensionsV1beta1().DaemonSets(namespace).Get(controllerRef.Name, metav1.GetOptions{})
|
||||
case "Job":
|
||||
return o.client.Batch().Jobs(namespace).Get(controllerRef.Name, metav1.GetOptions{})
|
||||
case "ReplicaSet":
|
||||
return o.client.Extensions().ReplicaSets(namespace).Get(controllerRef.Name, metav1.GetOptions{})
|
||||
return o.client.ExtensionsV1beta1().ReplicaSets(namespace).Get(controllerRef.Name, metav1.GetOptions{})
|
||||
case "StatefulSet":
|
||||
return o.client.AppsV1beta1().StatefulSets(namespace).Get(controllerRef.Name, metav1.GetOptions{})
|
||||
}
|
||||
@@ -404,7 +404,7 @@ func (o *DrainOptions) daemonsetFilter(pod corev1.Pod) (bool, *warning, *fatal)
|
||||
if controllerRef == nil || controllerRef.Kind != "DaemonSet" {
|
||||
return true, nil, nil
|
||||
}
|
||||
if _, err := o.client.Extensions().DaemonSets(pod.Namespace).Get(controllerRef.Name, metav1.GetOptions{}); err != nil {
|
||||
if _, err := o.client.ExtensionsV1beta1().DaemonSets(pod.Namespace).Get(controllerRef.Name, metav1.GetOptions{}); err != nil {
|
||||
return false, nil, &fatal{err.Error()}
|
||||
}
|
||||
if !o.IgnoreDaemonsets {
|
||||
|
@@ -38,9 +38,9 @@ type StatusViewer interface {
|
||||
func StatusViewerFor(kind schema.GroupKind, c kubernetes.Interface) (StatusViewer, error) {
|
||||
switch kind {
|
||||
case extensionsv1beta1.SchemeGroupVersion.WithKind("Deployment").GroupKind(), apps.Kind("Deployment"):
|
||||
return &DeploymentStatusViewer{c.Extensions()}, nil
|
||||
return &DeploymentStatusViewer{c.ExtensionsV1beta1()}, nil
|
||||
case extensionsv1beta1.SchemeGroupVersion.WithKind("DaemonSet").GroupKind(), apps.Kind("DaemonSet"):
|
||||
return &DaemonSetStatusViewer{c.Extensions()}, nil
|
||||
return &DaemonSetStatusViewer{c.ExtensionsV1beta1()}, nil
|
||||
case apps.Kind("StatefulSet"):
|
||||
return &StatefulSetStatusViewer{c.AppsV1beta1()}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user