Compare commits

..

3 Commits

Author SHA1 Message Date
Hariharan Subramanian 6627812069 format check changes 2022-06-27 20:42:08 +00:00
Hariharan Subramanian 9390dc6380 Logging Changes with group 2022-06-27 16:35:32 -04:00
Hariharan Subramanian 8da762e272 Logging changes for deploy 2022-06-27 16:33:31 -04:00
7 changed files with 14 additions and 37 deletions
+6 -9
View File
@@ -43,15 +43,7 @@ Following are the key capabilities of this action:
<tr>
<td>manifests </br></br>(Required)</td>
<td>Path to the manifest files to be used for deployment. These can also be directories containing manifest files, in which case, all manifest files in the referenced directory at every depth will be deployed. Files not ending in .yml or .yaml will be ignored.</td>
</tr>
<tr>
<td>strategy </br></br>(Required)</td>
<td>Acceptable values: basic/canary/blue-green. <br>
Default value: basic
<br>Deployment strategy to be used while applying manifest files on the cluster.
<br>basic - Template is force applied to all pods when deploying to cluster. NOTE: Can only be used with action == deploy
<br>canary - Canary deployment strategy is used when deploying to the cluster.<br>blue-green - Blue-Green deployment strategy is used when deploying to cluster.</td>
</tr>
</tr>
<tr>
<td>namespace </br></br>(Optional)
<td>Namespace within the cluster to deploy to.</td>
@@ -70,6 +62,11 @@ Following are the key capabilities of this action:
<td>pull-images</br></br>(Optional)</td>
<td>Acceptable values: true/false</br>Default value: true</br>Switch whether to pull the images from the registry before deployment to find out Dockerfile's path in order to add it to the annotations</td>
</tr>
<tr>
<td>strategy </br></br>(Optional)</td>
<td>Acceptable values: none/canary/blue-green. <br>
Deployment strategy to be used while applying manifest files on the cluster.<br>none - No deployment strategy is used when deploying.<br>canary - Canary deployment strategy is used when deploying to the cluster.<br>blue-green - Blue-Green deployment strategy is used when deploying to cluster.</td>
</tr>
<tr>
<td>traffic-split-method </br></br>(Optional)</td>
<td>Acceptable values: pod/smi.<br> Default value: pod <br>SMI: Percentage traffic split is done at request level using service mesh. Service mesh has to be setup by cluster admin. Orchestration of <a href="https://github.com/servicemeshinterface/smi-spec/blob/master/apis/traffic-split/v1alpha3/traffic-split.md" data-raw-source="TrafficSplit](https://github.com/deislabs/smi-spec/blob/master/traffic-split.md)">TrafficSplit</a> objects of SMI is handled by this action. <br>Pod: Percentage split not possible at request level in the absence of service mesh. Percentage input is used to calculate the replicas for baseline and canary as a percentage of replicas specified in the input manifests for the stable variant.</td>
+3 -3
View File
@@ -20,9 +20,9 @@ inputs:
required: false
default: true
strategy:
description: 'Deployment strategy to be used. Allowed values are basic, canary and blue-green'
required: true
default: 'basic'
description: 'Deployment strategy to be used. Allowed values are none, canary and blue-green'
required: false
default: 'none'
route-method:
description: 'Route based on service, ingress or SMI for blue-green strategy'
required: false
-16
View File
@@ -22,7 +22,6 @@
"@types/jest": "^26.0.0",
"@types/js-yaml": "^3.12.7",
"@types/node": "^12.20.41",
"@vercel/ncc": "^0.34.0",
"jest": "^26.0.0",
"prettier": "2.7.1",
"ts-jest": "^26.0.0",
@@ -1156,15 +1155,6 @@
"integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==",
"dev": true
},
"node_modules/@vercel/ncc": {
"version": "0.34.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.34.0.tgz",
"integrity": "sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==",
"dev": true,
"bin": {
"ncc": "dist/ncc/cli.js"
}
},
"node_modules/abab": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
@@ -7096,12 +7086,6 @@
"integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==",
"dev": true
},
"@vercel/ncc": {
"version": "0.34.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.34.0.tgz",
"integrity": "sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==",
"dev": true
},
"abab": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
+1 -2
View File
@@ -4,7 +4,7 @@
"author": "Deepak Sattiraju",
"license": "MIT",
"scripts": {
"build": "ncc build src/run.ts -o lib",
"build": "tsc --outDir ./lib --rootDir ./src",
"test": "jest",
"format": "prettier --write .",
"format-check": "prettier --check ."
@@ -23,7 +23,6 @@
"@types/jest": "^26.0.0",
"@types/js-yaml": "^3.12.7",
"@types/node": "^12.20.41",
"@vercel/ncc": "^0.34.0",
"jest": "^26.0.0",
"prettier": "2.7.1",
"ts-jest": "^26.0.0",
+4 -5
View File
@@ -70,7 +70,10 @@ export async function deployManifests(
return newFilePaths
}
case DeploymentStrategy.BASIC: {
case undefined: {
core.warning('Deployment strategy is not recognized.')
}
default: {
const trafficSplitMethod = parseTrafficSplitMethod(
core.getInput('traffic-split-method', {required: true})
)
@@ -91,10 +94,6 @@ export async function deployManifests(
return files
}
default: {
throw new Error('Deployment strategy is not recognized.')
}
}
}
-1
View File
@@ -5,7 +5,6 @@ describe('Deployment strategy type', () => {
const vals = <any>Object.values(DeploymentStrategy)
expect(vals.includes('canary')).toBe(true)
expect(vals.includes('blue-green')).toBe(true)
expect(vals.includes('basic')).toBe(true)
})
test('it can parse valid values from a string', () => {
-1
View File
@@ -1,5 +1,4 @@
export enum DeploymentStrategy {
BASIC = 'basic',
CANARY = 'canary',
BLUE_GREEN = 'blue-green'
}