in src/strategyHelpers/blueGreen/promote.ts [12:40]
export async function promoteBlueGreenIngress(
kubectl: Kubectl,
manifestObjects
): Promise<BlueGreenDeployment> {
//checking if anything to promote
const {areValid, invalidIngresses} = await validateIngresses(
kubectl,
manifestObjects.ingressEntityList,
manifestObjects.serviceNameMap
)
if (!areValid) {
throw new Error(
`Ingresses are not in promote state: ${invalidIngresses.toString()}`
)
}
// create stable deployments with new configuration
const result: BlueGreenDeployment = await deployWithLabel(
kubectl,
[].concat(
manifestObjects.deploymentEntityList,
manifestObjects.serviceEntityList
),
NONE_LABEL_VALUE
)
// create stable services with new configuration
return result
}