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:
benjamin
2025-07-09 13:22:21 -04:00
committed by GitHub
parent e207ec429b
commit ac0b58c9a5
28 changed files with 1677 additions and 209 deletions
+7 -4
View File
@@ -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