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
+14 -8
View File
@@ -41,14 +41,15 @@ export async function deployManifests(
files: string[],
deploymentStrategy: DeploymentStrategy,
kubectl: Kubectl,
trafficSplitMethod: TrafficSplitMethod
trafficSplitMethod: TrafficSplitMethod,
timeout?: string
): Promise<string[]> {
switch (deploymentStrategy) {
case DeploymentStrategy.CANARY: {
const canaryDeployResult: DeployResult =
trafficSplitMethod == TrafficSplitMethod.SMI
? await deploySMICanary(files, kubectl)
: await deployPodCanary(files, kubectl)
? await deploySMICanary(files, kubectl, false, timeout)
: await deployPodCanary(files, kubectl, false, timeout)
checkForErrors([canaryDeployResult.execResult])
return canaryDeployResult.manifestFiles
@@ -61,7 +62,8 @@ export async function deployManifests(
const blueGreenDeployment = await deployBlueGreen(
kubectl,
files,
routeStrategy
routeStrategy,
timeout
)
core.debug(
`objects deployed for ${routeStrategy}: ${JSON.stringify(
@@ -92,14 +94,16 @@ export async function deployManifests(
const result = await kubectl.apply(
updatedManifests,
forceDeployment,
serverSideApply
serverSideApply,
timeout
)
checkForErrors([result])
} else {
const result = await kubectl.apply(
files,
forceDeployment,
serverSideApply
serverSideApply,
timeout
)
checkForErrors([result])
}
@@ -147,12 +151,14 @@ function appendStableVersionLabelToResource(files: string[]): string[] {
export async function checkManifestStability(
kubectl: Kubectl,
resources: Resource[],
resourceType: ClusterType
resourceType: ClusterType,
timeout?: string
): Promise<void> {
await KubernetesManifestUtility.checkManifestStability(
kubectl,
resources,
resourceType
resourceType,
timeout
)
}