mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
use core client with explicit version globally
This commit is contained in:
@@ -77,7 +77,7 @@ func (spc *realStatefulPodControl) CreateStatefulPod(set *apps.StatefulSet, pod
|
||||
return err
|
||||
}
|
||||
// If we created the PVCs attempt to create the Pod
|
||||
_, err := spc.client.Core().Pods(set.Namespace).Create(pod)
|
||||
_, err := spc.client.CoreV1().Pods(set.Namespace).Create(pod)
|
||||
// sink already exists errors
|
||||
if apierrors.IsAlreadyExists(err) {
|
||||
return err
|
||||
@@ -113,7 +113,7 @@ func (spc *realStatefulPodControl) UpdateStatefulPod(set *apps.StatefulSet, pod
|
||||
|
||||
attemptedUpdate = true
|
||||
// commit the update, retrying on conflicts
|
||||
_, updateErr := spc.client.Core().Pods(set.Namespace).Update(pod)
|
||||
_, updateErr := spc.client.CoreV1().Pods(set.Namespace).Update(pod)
|
||||
if updateErr == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -134,7 +134,7 @@ func (spc *realStatefulPodControl) UpdateStatefulPod(set *apps.StatefulSet, pod
|
||||
}
|
||||
|
||||
func (spc *realStatefulPodControl) DeleteStatefulPod(set *apps.StatefulSet, pod *v1.Pod) error {
|
||||
err := spc.client.Core().Pods(set.Namespace).Delete(pod.Name, nil)
|
||||
err := spc.client.CoreV1().Pods(set.Namespace).Delete(pod.Name, nil)
|
||||
spc.recordPodEvent("delete", set, pod, err)
|
||||
return err
|
||||
}
|
||||
@@ -182,7 +182,7 @@ func (spc *realStatefulPodControl) createPersistentVolumeClaims(set *apps.Statef
|
||||
_, err := spc.pvcLister.PersistentVolumeClaims(claim.Namespace).Get(claim.Name)
|
||||
switch {
|
||||
case apierrors.IsNotFound(err):
|
||||
_, err := spc.client.Core().PersistentVolumeClaims(claim.Namespace).Create(&claim)
|
||||
_, err := spc.client.CoreV1().PersistentVolumeClaims(claim.Namespace).Create(&claim)
|
||||
if err != nil {
|
||||
errs = append(errs, fmt.Errorf("Failed to create PVC %s: %s", claim.Name, err))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user