mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
use appsv1beta1 for statefulsets and controller
history
This commit is contained in:
@@ -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)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user