mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Use PATCH verb to scale deployments and statefulsets (#3744)
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
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"
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user