diff --git a/pkg/controller/history/controller_history.go b/pkg/controller/history/controller_history.go index d2183e41a42..faea530aa14 100644 --- a/pkg/controller/history/controller_history.go +++ b/pkg/controller/history/controller_history.go @@ -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))) diff --git a/pkg/controller/statefulset/stateful_set_status_updater.go b/pkg/controller/statefulset/stateful_set_status_updater.go index 70f604cdaad..c44ab0d8787 100644 --- a/pkg/controller/statefulset/stateful_set_status_updater.go +++ b/pkg/controller/statefulset/stateful_set_status_updater.go @@ -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 }