mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-07-01 09:49: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:
@@ -28,7 +28,8 @@ export const STABLE_LABEL_VALUE = 'stable'
|
||||
export async function deleteCanaryDeployment(
|
||||
kubectl: Kubectl,
|
||||
manifestFilePaths: string[],
|
||||
includeServices: boolean
|
||||
includeServices: boolean,
|
||||
timeout?: string
|
||||
): Promise<string[]> {
|
||||
if (manifestFilePaths == null || manifestFilePaths.length == 0) {
|
||||
throw new Error('Manifest files for deleting canary deployment not found')
|
||||
@@ -37,7 +38,8 @@ export async function deleteCanaryDeployment(
|
||||
const deletedFiles = await cleanUpCanary(
|
||||
kubectl,
|
||||
manifestFilePaths,
|
||||
includeServices
|
||||
includeServices,
|
||||
timeout
|
||||
)
|
||||
return deletedFiles
|
||||
}
|
||||
@@ -193,7 +195,8 @@ function addCanaryLabelsAndAnnotations(inputObject: any, type: string) {
|
||||
async function cleanUpCanary(
|
||||
kubectl: Kubectl,
|
||||
files: string[],
|
||||
includeServices: boolean
|
||||
includeServices: boolean,
|
||||
timeout?: string
|
||||
): Promise<string[]> {
|
||||
const deleteObject = async function (
|
||||
kind: string,
|
||||
@@ -201,7 +204,7 @@ async function cleanUpCanary(
|
||||
namespace: string | undefined
|
||||
) {
|
||||
try {
|
||||
const result = await kubectl.delete([kind, name], namespace)
|
||||
const result = await kubectl.delete([kind, name], namespace, timeout)
|
||||
checkForErrors([result])
|
||||
} catch (ex) {
|
||||
// Ignore failures of delete if it doesn't exist
|
||||
|
||||
Reference in New Issue
Block a user