forked from opendatahub-io/odh-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UPSTREAM]: Add culler timeout feature and save button
- Loading branch information
1 parent
cf6e7d6
commit b12ff21
Showing
9 changed files
with
331 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,24 @@ | ||
import { KubeFastifyInstance } from '../types'; | ||
|
||
export const scaleDeploymentConfig = async ( | ||
export const rolloutDeployment = async ( | ||
fastify: KubeFastifyInstance, | ||
namespace: string, | ||
name: string, | ||
replicas: number, | ||
): Promise<void> => { | ||
const customObjectsApi = fastify.kube.customObjectsApi; | ||
const group = 'apps.openshift.io'; | ||
const version = 'v1'; | ||
const plural = 'deploymentconfigs'; | ||
const namespace = fastify.kube.namespace; | ||
const plural = `deploymentconfigs/${name}/instantiate`; | ||
const body = { | ||
kind: 'DeploymentRequest', | ||
apiVersion: 'apps.openshift.io/v1', | ||
name, | ||
latest: true, | ||
force: true, | ||
}; | ||
try { | ||
const res = await customObjectsApi.getNamespacedCustomObject( | ||
group, | ||
version, | ||
namespace, | ||
plural, | ||
name, | ||
); | ||
const deployment: any = res.body; | ||
|
||
deployment.spec.replicas = replicas; | ||
|
||
await customObjectsApi.replaceNamespacedCustomObject( | ||
group, | ||
version, | ||
namespace, | ||
plural, | ||
name, | ||
deployment, | ||
); | ||
await customObjectsApi.createNamespacedCustomObject(group, version, namespace, plural, body); | ||
} catch (e) { | ||
throw new Error('Error scale the deployment pods: ' + e.message); | ||
throw new Error('Error rollout the deployment: ' + e.message); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.