mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-23 04:59:26 +08:00
Massive refactor (#165)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
export enum DeploymentStrategy {
|
||||
CANARY = "canary",
|
||||
BLUE_GREEN = "blue-green",
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a string to the DeploymentStrategy enum
|
||||
* @param str The deployment strategy (case insensitive)
|
||||
* @returns The DeploymentStrategy enum or undefined if it can't be parsed
|
||||
*/
|
||||
export const parseDeploymentStrategy = (
|
||||
str: string
|
||||
): DeploymentStrategy | undefined =>
|
||||
DeploymentStrategy[
|
||||
Object.keys(DeploymentStrategy).filter(
|
||||
(k) =>
|
||||
DeploymentStrategy[k].toString().toLowerCase() === str.toLowerCase()
|
||||
)[0] as keyof typeof DeploymentStrategy
|
||||
];
|
||||
Reference in New Issue
Block a user