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:
Dan authored and GitHub committed 2022-12-26 14:30:39 +03:00
1 parent 97551bb7f0
commit ce280e1d07
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",
},
});
}
}