Use PATCH verb to scale deployments and statefulsets (#3744)

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala authored and GitHub committed 2021-09-09 09:31:11 +03:00
1 parent d6b2b0352c
commit 8651eb9594
4 files changed
+132 -4

No files matched your search

@@ -41,13 +41,17 @@ export class DeploymentApi extends KubeApi<Deployment> {
}
scale(params: { namespace: string; name: string }, replicas: number) {
return this.request.put(this.getScaleApiUrl(params), {
return this.request.patch(this.getScaleApiUrl(params), {
data: {
metadata: params,
spec: {
replicas
}
}
},
{
headers: {
"content-type": "application/merge-patch+json"
}
});
}
@@ -39,13 +39,17 @@ export class StatefulSetApi extends KubeApi<StatefulSet> {
}
scale(params: { namespace: string; name: string }, replicas: number) {
return this.request.put(this.getScaleApiUrl(params), {
return this.request.patch(this.getScaleApiUrl(params), {
data: {
metadata: params,
spec: {
replicas
}
}
},
{
headers: {
"content-type": "application/merge-patch+json"
}
});
}
}