mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
add restart button to daemonset menu (#6826)
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
+115
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 { KubeObjectStatus, LabelSelector, NamespaceScopedMetadata } from "../kube-object";
|
||||
@@ -87,4 +89,23 @@ export class DaemonSetApi extends KubeApi<DaemonSet> {
|
||||
objectConstructor: DaemonSet,
|
||||
});
|
||||
}
|
||||
|
||||
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",
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user