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.
PVC cluster settings update to restart juypter hub with changes. (ope…
…ndatahub-io#135) * Added PVC and Cluster Settings code Added code for PVC, Cluster Settings, and updated to the latest version of patternfly. update pvc settings Fixed linting error. * Fix to restart juypter hub notebook with cluster settings changes.
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { KubeFastifyInstance } from '../types'; | ||
|
||
export const scaleDeploymentConfig = async ( | ||
fastify: KubeFastifyInstance, | ||
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; | ||
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, | ||
); | ||
} catch (e) { | ||
throw new Error('Error scale the deployment pods: ' + e.message); | ||
} | ||
}; |