mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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:
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 {
|
||||
|
||||
Reference in new issue
Block a user