Add Restart Button to StatefulSet Menu (#6868)

* add restart button to statefulsets

Signed-off-by: Dan Bryant <daniel.bryant@linux.com>

* use ShowCheckedErrorNotification

Signed-off-by: Dan Bryant <daniel.bryant@linux.com>

Signed-off-by: Dan Bryant <daniel.bryant@linux.com>
This commit is contained in:
Dan authored and GitHub committed 2023-01-04 08:14:56 -05:00
1 parent 9522420f5b
commit b4d3a16470
3 files changed
+119

No files matched your search

@@ -3,6 +3,8 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import moment from "moment";
import type { DerivedKubeApiOptions, IgnoredKubeApiOptions } from "../kube-api";
import { KubeApi } from "../kube-api";
import type { LabelSelector, NamespaceScopedMetadata } from "../kube-object";
@@ -42,6 +44,25 @@ export class StatefulSetApi extends KubeApi<StatefulSet> {
},
});
}
restart(params: { namespace: string; name: string }) {
return this.request.patch(this.getUrl(params), {
data: {
spec: {
template: {
metadata: {
annotations: { "kubectl.kubernetes.io/restartedAt" : moment.utc().format() },
},
},
},
},
},
{
headers: {
"content-type": "application/strategic-merge-patch+json",
},
});
}
}
export interface StatefulSetSpec {