mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-28 15:59:27 +08:00
Add timeout to the rollout status (#425)
* Added timeout to the rollout status and tests for it * Fixed integration test errors * Fix for blue green integration test * Probable fix for integration errors * No jobs run error fixed * Changed timeout to file level constant * Added parsing logic for timeout * Made tests more concise * implemented timeout validation check in an extracted utils mod * Changed function name to parseDuration * Removed timeout parameter from getResource --------- Co-authored-by: David Gamero <david340804@gmail.com> Co-authored-by: Suneha Bose <123775811+bosesuneha@users.noreply.github.com>
This commit is contained in:
@@ -12,14 +12,16 @@ import {routeBlueGreenIngressUnchanged, routeBlueGreenService} from './route'
|
||||
|
||||
export async function rejectBlueGreenIngress(
|
||||
kubectl: Kubectl,
|
||||
manifestObjects: BlueGreenManifests
|
||||
manifestObjects: BlueGreenManifests,
|
||||
timeout?: string
|
||||
): Promise<BlueGreenRejectResult> {
|
||||
// get all kubernetes objects defined in manifest files
|
||||
// route ingress to stables services
|
||||
const routeResult = await routeBlueGreenIngressUnchanged(
|
||||
kubectl,
|
||||
manifestObjects.serviceNameMap,
|
||||
manifestObjects.ingressEntityList
|
||||
manifestObjects.ingressEntityList,
|
||||
timeout
|
||||
)
|
||||
|
||||
// delete green services and deployments
|
||||
@@ -28,7 +30,8 @@ export async function rejectBlueGreenIngress(
|
||||
[].concat(
|
||||
manifestObjects.deploymentEntityList,
|
||||
manifestObjects.serviceEntityList
|
||||
)
|
||||
),
|
||||
timeout
|
||||
)
|
||||
|
||||
return {routeResult, deleteResult}
|
||||
@@ -36,19 +39,22 @@ export async function rejectBlueGreenIngress(
|
||||
|
||||
export async function rejectBlueGreenService(
|
||||
kubectl: Kubectl,
|
||||
manifestObjects: BlueGreenManifests
|
||||
manifestObjects: BlueGreenManifests,
|
||||
timeout?: string
|
||||
): Promise<BlueGreenRejectResult> {
|
||||
// route to stable objects
|
||||
const routeResult = await routeBlueGreenService(
|
||||
kubectl,
|
||||
NONE_LABEL_VALUE,
|
||||
manifestObjects.serviceEntityList
|
||||
manifestObjects.serviceEntityList,
|
||||
timeout
|
||||
)
|
||||
|
||||
// delete new deployments with green suffix
|
||||
const deleteResult = await deleteGreenObjects(
|
||||
kubectl,
|
||||
manifestObjects.deploymentEntityList
|
||||
manifestObjects.deploymentEntityList,
|
||||
timeout
|
||||
)
|
||||
|
||||
return {routeResult, deleteResult}
|
||||
@@ -56,25 +62,29 @@ export async function rejectBlueGreenService(
|
||||
|
||||
export async function rejectBlueGreenSMI(
|
||||
kubectl: Kubectl,
|
||||
manifestObjects: BlueGreenManifests
|
||||
manifestObjects: BlueGreenManifests,
|
||||
timeout?: string
|
||||
): Promise<BlueGreenRejectResult> {
|
||||
// route trafficsplit to stable deployments
|
||||
const routeResult = await routeBlueGreenSMI(
|
||||
kubectl,
|
||||
NONE_LABEL_VALUE,
|
||||
manifestObjects.serviceEntityList
|
||||
manifestObjects.serviceEntityList,
|
||||
timeout
|
||||
)
|
||||
|
||||
// delete rejected new bluegreen deployments
|
||||
const deletedObjects = await deleteGreenObjects(
|
||||
kubectl,
|
||||
manifestObjects.deploymentEntityList
|
||||
manifestObjects.deploymentEntityList,
|
||||
timeout
|
||||
)
|
||||
|
||||
// delete trafficsplit and extra services
|
||||
const cleanupResult = await cleanupSMI(
|
||||
kubectl,
|
||||
manifestObjects.serviceEntityList
|
||||
manifestObjects.serviceEntityList,
|
||||
timeout
|
||||
)
|
||||
|
||||
return {routeResult, deleteResult: [].concat(deletedObjects, cleanupResult)}
|
||||
|
||||
Reference in New Issue
Block a user