Skip to content

Commit 72a09f4

Browse files
Logging Changes for Promote, Reject actions (#207)
1 parent a17f35b commit 72a09f4

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

src/actions/promote.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,30 @@ async function promoteCanary(kubectl: Kubectl, manifests: string[]) {
6565

6666
// In case of SMI traffic split strategy when deployment is promoted, first we will redirect traffic to
6767
// canary deployment, then update stable deployment and then redirect traffic to stable deployment
68-
core.info('Redirecting traffic to canary deployment')
68+
core.startGroup('Redirecting traffic to canary deployment')
6969
await SMICanaryDeploymentHelper.redirectTrafficToCanaryDeployment(
7070
kubectl,
7171
manifests
7272
)
73+
core.endGroup()
7374

74-
core.info('Deploying input manifests with SMI canary strategy')
75+
core.startGroup('Deploying input manifests with SMI canary strategy')
7576
await deploy.deploy(kubectl, manifests, DeploymentStrategy.CANARY)
77+
core.endGroup()
7678

77-
core.info('Redirecting traffic to stable deployment')
79+
core.startGroup('Redirecting traffic to stable deployment')
7880
await SMICanaryDeploymentHelper.redirectTrafficToStableDeployment(
7981
kubectl,
8082
manifests
8183
)
84+
core.endGroup()
8285
} else {
83-
core.info('Deploying input manifests')
86+
core.startGroup('Deploying input manifests')
8487
await deploy.deploy(kubectl, manifests, DeploymentStrategy.CANARY)
88+
core.endGroup()
8589
}
8690

87-
core.info('Deleting canary and baseline workloads')
91+
core.startGroup('Deleting canary and baseline workloads')
8892
try {
8993
await canaryDeploymentHelper.deleteCanaryDeployment(
9094
kubectl,
@@ -97,6 +101,7 @@ async function promoteCanary(kubectl: Kubectl, manifests: string[]) {
97101
ex
98102
)
99103
}
104+
core.endGroup()
100105
}
101106

102107
async function promoteBlueGreen(kubectl: Kubectl, manifests: string[]) {
@@ -109,7 +114,7 @@ async function promoteBlueGreen(kubectl: Kubectl, manifests: string[]) {
109114
core.getInput('route-method', {required: true})
110115
)
111116

112-
core.info('Deleting old deployment and making new one')
117+
core.startGroup('Deleting old deployment and making new one')
113118
let result
114119
if (routeStrategy == RouteStrategy.INGRESS) {
115120
result = await promoteBlueGreenIngress(kubectl, manifestObjects)
@@ -118,9 +123,10 @@ async function promoteBlueGreen(kubectl: Kubectl, manifests: string[]) {
118123
} else {
119124
result = await promoteBlueGreenService(kubectl, manifestObjects)
120125
}
126+
core.endGroup()
121127

122128
// checking stability of newly created deployments
123-
core.info('Checking manifest stability')
129+
core.startGroup('Checking manifest stability')
124130
const deployedManifestFiles = result.newFilePaths
125131
const resources: Resource[] = getResources(
126132
deployedManifestFiles,
@@ -129,8 +135,9 @@ async function promoteBlueGreen(kubectl: Kubectl, manifests: string[]) {
129135
])
130136
)
131137
await KubernetesManifestUtility.checkManifestStability(kubectl, resources)
138+
core.endGroup()
132139

133-
core.info(
140+
core.startGroup(
134141
'Routing to new deployments and deleting old workloads and services'
135142
)
136143
if (routeStrategy == RouteStrategy.INGRESS) {
@@ -170,4 +177,5 @@ async function promoteBlueGreen(kubectl: Kubectl, manifests: string[]) {
170177
manifestObjects.deploymentEntityList
171178
)
172179
}
180+
core.endGroup()
173181
}

src/actions/reject.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,26 @@ async function rejectCanary(kubectl: Kubectl, manifests: string[]) {
3636
core.getInput('traffic-split-method', {required: true})
3737
)
3838
if (trafficSplitMethod == TrafficSplitMethod.SMI) {
39-
core.info('Rejecting deployment with SMI canary strategy')
39+
core.startGroup('Rejecting deployment with SMI canary strategy')
4040
includeServices = true
4141
await SMICanaryDeploymentHelper.redirectTrafficToStableDeployment(
4242
kubectl,
4343
manifests
4444
)
45+
core.endGroup()
4546
}
4647

47-
core.info('Deleting baseline and canary workloads')
48+
core.startGroup('Deleting baseline and canary workloads')
4849
await canaryDeploymentHelper.deleteCanaryDeployment(
4950
kubectl,
5051
manifests,
5152
includeServices
5253
)
54+
core.endGroup()
5355
}
5456

5557
async function rejectBlueGreen(kubectl: Kubectl, manifests: string[]) {
56-
core.info('Rejecting deployment with blue green strategy')
58+
core.startGroup('Rejecting deployment with blue green strategy')
5759

5860
const routeStrategy = parseRouteStrategy(
5961
core.getInput('route-method', {required: true})
@@ -65,4 +67,5 @@ async function rejectBlueGreen(kubectl: Kubectl, manifests: string[]) {
6567
} else {
6668
await rejectBlueGreenService(kubectl, manifests)
6769
}
70+
core.endGroup()
6871
}

0 commit comments

Comments
 (0)