Skip to content

Commit a8b99c3

Browse files
committed
refactor: remove canary deployment support
Canary deployments are not being used, so removing all related logic to simplify the codebase. Changes: - Remove removeCanary input parameter and logic from index.js - Remove special handling for track === 'canary' - Remove canary test scenarios (canary.sh, canary.sh.snap) - Update test snapshots to remove removeCanary debug output - Remove canary deployment documentation from README - Update description to remove canary deployment mention
1 parent 7ad9a91 commit a8b99c3

File tree

7 files changed

+3
-111
lines changed

7 files changed

+3
-111
lines changed

README.md

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ Releasing: The `v1` tag gets updated on **master merge**!
66

77
# Helm Action
88

9-
Deploys a helm chart using GitHub actions. Supports canary deployments and
10-
provides a built in helm chart for apps that listen over http to get your ramped
11-
up quickly.
9+
Deploys a helm chart using GitHub actions. Provides a built in helm chart for
10+
apps that listen over http to get you ramped up quickly.
1211

1312
View an example repository using this action at
1413
[github.com/deliverybot/example-helm](https://github.com/deliverybot/example-helm).
@@ -33,8 +32,7 @@ payload if the action was triggered by a deployment.
3332
chart found in this repository. (required)
3433
- `chart_version`: The version of the helm chart you want to deploy (distinct from app version)
3534
- `values`: Helm chart values, expected to be a YAML or JSON string.
36-
- `track`: Track for the deployment. If the track is not "stable" it activates
37-
the canary workflow described below.
35+
- `track`: Track for the deployment (e.g., stable, staging).
3836
- `task`: Task name. If the task is "remove" it will remove the configured helm
3937
release.
4038
- `dry-run`: Helm dry-run option.
@@ -102,43 +100,6 @@ jobs:
102100
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'
103101
```
104102
105-
## Example canary
106-
107-
If a track is chosen that is equal to canary, this updates the helm chart
108-
in a few ways:
109-
110-
1. Release name is changed to `{release}-{track}` (eg. myapp-canary).
111-
2. The service is disabled on the helm chart `service.enabled=false`
112-
3. The ingress is disabled on the helm chart `ingress.enabled=false`
113-
114-
Not enabling the service or ingress allows the stable ingress and service
115-
resources to pick up the canary pods and route traffic to them.
116-
117-
```yaml
118-
# .github/workflows/deploy.yml
119-
name: Deploy
120-
on: ['deployment']
121-
122-
jobs:
123-
deployment:
124-
runs-on: 'ubuntu-latest'
125-
steps:
126-
- uses: actions/checkout@v1
127-
128-
- name: 'Deploy'
129-
uses: 'deliverybot/helm@v1'
130-
with:
131-
release: 'nginx'
132-
track: canary
133-
namespace: 'default'
134-
chart: 'app'
135-
token: '${{ github.token }}'
136-
values: |
137-
name: foobar
138-
env:
139-
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'
140-
```
141-
142103
## Example pr cleanup
143104
144105
If you are creating an environment per pull request with Helm you may have the

index.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ async function run() {
206206
const task = getInput("task");
207207
const version = getInput("version");
208208
const valueFiles = getValueFiles(getInput("value_files"));
209-
const removeCanary = getInput("remove_canary");
210209
const helm = getInput("helm") || "helm";
211210
const timeout = getInput("timeout");
212211
const repository = getInput("repository");
@@ -235,7 +234,6 @@ async function run() {
235234
core.debug(`param: version = "${version}"`);
236235
core.debug(`param: secrets = "${JSON.stringify(secrets)}"`);
237236
core.debug(`param: valueFiles = "${JSON.stringify(valueFiles)}"`);
238-
core.debug(`param: removeCanary = ${removeCanary}`);
239237
core.debug(`param: timeout = "${timeout}"`);
240238
core.debug(`param: repository = "${repository}"`);
241239
core.debug(`param: atomic = "${atomic}"`);
@@ -288,13 +286,6 @@ async function run() {
288286
valueFiles.forEach((f) => args.push(`--values=${f}`));
289287
args.push("--values=./values.yml");
290288

291-
// Special behaviour is triggered if the track is labelled 'canary'. The
292-
// service and ingress resources are disabled. Access to the canary
293-
// deployments can be routed via the main stable service resource.
294-
if (track === "canary") {
295-
args.push("--set=service.enabled=false", "--set=ingress.enabled=false");
296-
}
297-
298289
// If true upgrade process rolls back changes made in case of failed upgrade.
299290
if (atomic === true) {
300291
args.push("--atomic");
@@ -322,14 +313,6 @@ async function run() {
322313
await exec.exec(helm, ["dependency", "build", chart]);
323314
}
324315

325-
// Remove the canary deployment before continuing.
326-
if (removeCanary) {
327-
core.debug(`removing canary ${appName}-canary`);
328-
await exec.exec(helm, deleteCmd(namespace, `${appName}-canary`), {
329-
ignoreReturnCode: true,
330-
});
331-
}
332-
333316
// Actually execute the deployment here.
334317
if (task === "remove") {
335318
// delete ttl cronjob in case it was set (it is not required).

tests/scenarios/canary.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/scenarios/canary.sh.snap

Lines changed: 0 additions & 34 deletions
This file was deleted.

tests/scenarios/helm3.sh.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
::debug::param: version = "1234"
1616
::debug::param: secrets = "{"secret":"val"}"
1717
::debug::param: valueFiles = "[]"
18-
::debug::param: removeCanary =
1918
::debug::param: timeout = ""
2019
::debug::param: repository = ""
2120
::debug::param: atomic = "true"

tests/scenarios/production.sh.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
::debug::param: version = "1234"
1616
::debug::param: secrets = "{"secret":"val"}"
1717
::debug::param: valueFiles = "[]"
18-
::debug::param: removeCanary =
1918
::debug::param: timeout = "30"
2019
::debug::param: repository = ""
2120
::debug::param: atomic = "true"

tests/scenarios/ttl.sh.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
::debug::param: version = "1234"
1616
::debug::param: secrets = "{"secret":"val"}"
1717
::debug::param: valueFiles = "[]"
18-
::debug::param: removeCanary =
1918
::debug::param: timeout = ""
2019
::debug::param: repository = ""
2120
::debug::param: atomic = "true"

0 commit comments

Comments
 (0)