Merge pull request #47709 from krmayankk/ss

Automatic merge from submit-queue (batch tested with PRs 47958, 46261, 46667, 47709, 47579)

use appsv1beta1 for statefulsets

**What this PR does / why we need it**:


**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
fixes https://github.com/kubernetes/kubernetes/issues/46922
This commit is contained in:
Kubernetes Submit Queue 2017-06-23 07:21:33 -07:00 committed by GitHub
commit 76103db5e4
2 changed files with 6 additions and 6 deletions

View File

@ -256,7 +256,7 @@ func (rh *realHistory) CreateControllerRevision(parent metav1.Object, revision *
}
// Update the revisions name and labels
clone.Name = ControllerRevisionName(parent.GetName(), hash)
created, err := rh.client.Apps().ControllerRevisions(parent.GetNamespace()).Create(clone)
created, err := rh.client.AppsV1beta1().ControllerRevisions(parent.GetNamespace()).Create(clone)
if errors.IsAlreadyExists(err) {
probe++
continue
@ -276,7 +276,7 @@ func (rh *realHistory) UpdateControllerRevision(revision *apps.ControllerRevisio
return nil
}
clone.Revision = newRevision
updated, updateErr := rh.client.Apps().ControllerRevisions(clone.Namespace).Update(clone)
updated, updateErr := rh.client.AppsV1beta1().ControllerRevisions(clone.Namespace).Update(clone)
if updateErr == nil {
return nil
}
@ -297,7 +297,7 @@ func (rh *realHistory) UpdateControllerRevision(revision *apps.ControllerRevisio
}
func (rh *realHistory) DeleteControllerRevision(revision *apps.ControllerRevision) error {
return rh.client.Apps().ControllerRevisions(revision.Namespace).Delete(revision.Name, nil)
return rh.client.AppsV1beta1().ControllerRevisions(revision.Namespace).Delete(revision.Name, nil)
}
func (rh *realHistory) AdoptControllerRevision(parent metav1.Object, parentKind schema.GroupVersionKind, revision *apps.ControllerRevision) (*apps.ControllerRevision, error) {
@ -306,7 +306,7 @@ func (rh *realHistory) AdoptControllerRevision(parent metav1.Object, parentKind
return nil, fmt.Errorf("attempt to adopt revision owned by %v", owner)
}
// Use strategic merge patch to add an owner reference indicating a controller ref
return rh.client.Apps().ControllerRevisions(parent.GetNamespace()).Patch(revision.GetName(),
return rh.client.AppsV1beta1().ControllerRevisions(parent.GetNamespace()).Patch(revision.GetName(),
types.StrategicMergePatchType, []byte(fmt.Sprintf(
`{"metadata":{"ownerReferences":[{"apiVersion":"%s","kind":"%s","name":"%s","uid":"%s","controller":true,"blockOwnerDeletion":true}],"uid":"%s"}}`,
parentKind.GroupVersion().String(), parentKind.Kind,
@ -315,7 +315,7 @@ func (rh *realHistory) AdoptControllerRevision(parent metav1.Object, parentKind
func (rh *realHistory) ReleaseControllerRevision(parent metav1.Object, revision *apps.ControllerRevision) (*apps.ControllerRevision, error) {
// Use strategic merge patch to add an owner reference indicating a controller ref
released, err := rh.client.Apps().ControllerRevisions(revision.GetNamespace()).Patch(revision.GetName(),
released, err := rh.client.AppsV1beta1().ControllerRevisions(revision.GetNamespace()).Patch(revision.GetName(),
types.StrategicMergePatchType,
[]byte(fmt.Sprintf(`{"metadata":{"ownerReferences":[{"$patch":"delete","uid":"%s"}],"uid":"%s"}}`, parent.GetUID(), revision.UID)))

View File

@ -56,7 +56,7 @@ func (ssu *realStatefulSetStatusUpdater) UpdateStatefulSetStatus(
// don't wait due to limited number of clients, but backoff after the default number of steps
return retry.RetryOnConflict(retry.DefaultRetry, func() error {
set.Status = *status
_, updateErr := ssu.client.Apps().StatefulSets(set.Namespace).UpdateStatus(set)
_, updateErr := ssu.client.AppsV1beta1().StatefulSets(set.Namespace).UpdateStatus(set)
if updateErr == nil {
return nil
}