mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-28 07:49:27 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b0f33712c6 | |||
| 3b11c64ce0 | |||
| 99510dff95 | |||
| 5dfb05d024 | |||
| 68cb22352a | |||
| 67def0664b | |||
| 76046dd320 | |||
| 8b4e45d97b | |||
| 2c1455e4a0 | |||
| c53a656438 |
@@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 #v3.28.13
|
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 #v3.28.15
|
||||||
# Override language selection by uncommenting this and choosing your languages
|
# Override language selection by uncommenting this and choosing your languages
|
||||||
# with:
|
# with:
|
||||||
# languages: go, javascript, csharp, python, cpp, java
|
# languages: go, javascript, csharp, python, cpp, java
|
||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@1b549b9259bda1cb5ddde3b41741a82a2d15a841 #v3.28.13
|
uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 #v3.28.15
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
@@ -46,4 +46,4 @@ jobs:
|
|||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 #v3.28.13
|
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 #v3.28.15
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
- name: Create namespace to run tests
|
- name: Create namespace to run tests
|
||||||
run: kubectl create ns ${{ env.NAMESPACE }}
|
run: kubectl create ns ${{ env.NAMESPACE }}
|
||||||
|
|
||||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
|
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # 5.5.0
|
||||||
name: Install Python
|
name: Install Python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
- name: Create namespace to run tests
|
- name: Create namespace to run tests
|
||||||
run: kubectl create ns ${{ env.NAMESPACE }}
|
run: kubectl create ns ${{ env.NAMESPACE }}
|
||||||
|
|
||||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
|
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # 5.5.0
|
||||||
name: Install Python
|
name: Install Python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
- name: Create namespace to run tests
|
- name: Create namespace to run tests
|
||||||
run: kubectl create ns ${{ env.NAMESPACE }}
|
run: kubectl create ns ${{ env.NAMESPACE }}
|
||||||
|
|
||||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
|
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # 5.5.0
|
||||||
name: Install Python
|
name: Install Python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ jobs:
|
|||||||
- name: Create namespace to run tests
|
- name: Create namespace to run tests
|
||||||
run: kubectl create ns ${{ env.NAMESPACE }}
|
run: kubectl create ns ${{ env.NAMESPACE }}
|
||||||
|
|
||||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
|
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # 5.5.0
|
||||||
name: Install Python
|
name: Install Python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
- name: Create namespace to run tests
|
- name: Create namespace to run tests
|
||||||
run: kubectl create ns ${{ env.NAMESPACE }}
|
run: kubectl create ns ${{ env.NAMESPACE }}
|
||||||
|
|
||||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
|
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # 5.5.0
|
||||||
name: Install Python
|
name: Install Python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
- name: Create namespace to run tests
|
- name: Create namespace to run tests
|
||||||
run: kubectl create ns ${{ env.NAMESPACE }}
|
run: kubectl create ns ${{ env.NAMESPACE }}
|
||||||
|
|
||||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
|
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # 5.5.0
|
||||||
name: Install Python
|
name: Install Python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: ncc build src/run.ts -o lib
|
run: ncc build src/run.ts -o lib
|
||||||
- name: Azure login
|
- name: Azure login
|
||||||
uses: azure/login@v2.2.0
|
uses: azure/login@v2.3.0
|
||||||
with:
|
with:
|
||||||
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
||||||
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
||||||
@@ -51,7 +51,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
az aks command invoke --resource-group ${{ env.NAMESPACE }} --name ${{ env.NAMESPACE }} --command "kubectl create ns ${{ env.NAMESPACE }}"
|
az aks command invoke --resource-group ${{ env.NAMESPACE }} --name ${{ env.NAMESPACE }} --command "kubectl create ns ${{ env.NAMESPACE }}"
|
||||||
|
|
||||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
|
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # 5.5.0
|
||||||
name: Install Python
|
name: Install Python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
- name: Create namespace to run tests
|
- name: Create namespace to run tests
|
||||||
run: kubectl create ns ${{ env.NAMESPACE }}
|
run: kubectl create ns ${{ env.NAMESPACE }}
|
||||||
|
|
||||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # 5.4.0
|
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # 5.5.0
|
||||||
name: Install Python
|
name: Install Python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|||||||
@@ -2,6 +2,5 @@ node_modules
|
|||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
lib/
|
|
||||||
|
|
||||||
coverage/
|
coverage/
|
||||||
@@ -1,5 +1,17 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [5.0.3] - 2025-04-16
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- #398 case-insensitive resource type
|
||||||
|
|
||||||
|
## [5.0.2] - 2025-04-15
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- #396 Update new resource-type input for action
|
||||||
|
|
||||||
## [5.0.1] - 2024-03-12
|
## [5.0.1] - 2024-03-12
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -80,6 +80,10 @@ inputs:
|
|||||||
skip-tls-verify:
|
skip-tls-verify:
|
||||||
description: True if the insecure-skip-tls-verify option should be used. Input should be 'true' or 'false'.
|
description: True if the insecure-skip-tls-verify option should be used. Input should be 'true' or 'false'.
|
||||||
default: false
|
default: false
|
||||||
|
resource-type:
|
||||||
|
description: Either Microsoft.ContainerService/managedClusters or Microsoft.ContainerService/fleets'.
|
||||||
|
required: false
|
||||||
|
default: 'Microsoft.ContainerService/managedClusters'
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
color: 'green'
|
color: 'green'
|
||||||
|
|||||||
+17991
File diff suppressed because it is too large
Load Diff
Generated
+33
-32
@@ -25,12 +25,12 @@
|
|||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/js-yaml": "^4.0.9",
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@types/minimist": "^1.2.5",
|
"@types/minimist": "^1.2.5",
|
||||||
"@types/node": "^22.13.13",
|
"@types/node": "^22.14.0",
|
||||||
"@vercel/ncc": "^0.38.3",
|
"@vercel/ncc": "^0.38.3",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"ts-jest": "^29.3.0",
|
"ts-jest": "^29.3.1",
|
||||||
"typescript": "5.8.2"
|
"typescript": "5.8.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
@@ -2348,13 +2348,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "22.13.13",
|
"version": "22.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.0.tgz",
|
||||||
"integrity": "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==",
|
"integrity": "sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~6.20.0"
|
"undici-types": "~6.21.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/stack-utils": {
|
"node_modules/@types/stack-utils": {
|
||||||
@@ -4964,9 +4964,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ts-jest": {
|
"node_modules/ts-jest": {
|
||||||
"version": "29.3.0",
|
"version": "29.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.1.tgz",
|
||||||
"integrity": "sha512-4bfGBX7Gd1Aqz3SyeDS9O276wEU/BInZxskPrbhZLyv+c1wskDCqDFMJQJLWrIr/fKoAH4GE5dKUlrdyvo+39A==",
|
"integrity": "sha512-FT2PIRtZABwl6+ZCry8IY7JZ3xMuppsEV9qFVHOVe8jDzggwUZ9TsM4chyJxL9yi6LvkqcZYU3LmapEE454zBQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -4978,7 +4978,7 @@
|
|||||||
"lodash.memoize": "^4.1.2",
|
"lodash.memoize": "^4.1.2",
|
||||||
"make-error": "^1.3.6",
|
"make-error": "^1.3.6",
|
||||||
"semver": "^7.7.1",
|
"semver": "^7.7.1",
|
||||||
"type-fest": "^4.37.0",
|
"type-fest": "^4.38.0",
|
||||||
"yargs-parser": "^21.1.1"
|
"yargs-parser": "^21.1.1"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -5069,9 +5069,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.8.2",
|
"version": "5.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
||||||
"integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
|
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -5083,10 +5083,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
"version": "6.20.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
||||||
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
|
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/unicode-canonical-property-names-ecmascript": {
|
"node_modules/unicode-canonical-property-names-ecmascript": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
@@ -6875,12 +6876,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "22.13.13",
|
"version": "22.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.0.tgz",
|
||||||
"integrity": "sha512-ClsL5nMwKaBRwPcCvH8E7+nU4GxHVx1axNvMZTFHMEfNI7oahimt26P5zjVCRrjiIWj6YFXfE1v3dEp94wLcGQ==",
|
"integrity": "sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"undici-types": "~6.20.0"
|
"undici-types": "~6.21.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/stack-utils": {
|
"@types/stack-utils": {
|
||||||
@@ -8781,9 +8782,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ts-jest": {
|
"ts-jest": {
|
||||||
"version": "29.3.0",
|
"version": "29.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.1.tgz",
|
||||||
"integrity": "sha512-4bfGBX7Gd1Aqz3SyeDS9O276wEU/BInZxskPrbhZLyv+c1wskDCqDFMJQJLWrIr/fKoAH4GE5dKUlrdyvo+39A==",
|
"integrity": "sha512-FT2PIRtZABwl6+ZCry8IY7JZ3xMuppsEV9qFVHOVe8jDzggwUZ9TsM4chyJxL9yi6LvkqcZYU3LmapEE454zBQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"bs-logger": "^0.2.6",
|
"bs-logger": "^0.2.6",
|
||||||
@@ -8794,7 +8795,7 @@
|
|||||||
"lodash.memoize": "^4.1.2",
|
"lodash.memoize": "^4.1.2",
|
||||||
"make-error": "^1.3.6",
|
"make-error": "^1.3.6",
|
||||||
"semver": "^7.7.1",
|
"semver": "^7.7.1",
|
||||||
"type-fest": "^4.37.0",
|
"type-fest": "^4.38.0",
|
||||||
"yargs-parser": "^21.1.1"
|
"yargs-parser": "^21.1.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -8830,15 +8831,15 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "5.8.2",
|
"version": "5.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
||||||
"integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
|
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"undici-types": {
|
"undici-types": {
|
||||||
"version": "6.20.0",
|
"version": "6.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
||||||
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
|
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"unicode-canonical-property-names-ecmascript": {
|
"unicode-canonical-property-names-ecmascript": {
|
||||||
|
|||||||
+3
-3
@@ -28,11 +28,11 @@
|
|||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/js-yaml": "^4.0.9",
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@types/minimist": "^1.2.5",
|
"@types/minimist": "^1.2.5",
|
||||||
"@types/node": "^22.13.13",
|
"@types/node": "^22.14.0",
|
||||||
"@vercel/ncc": "^0.38.3",
|
"@vercel/ncc": "^0.38.3",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"ts-jest": "^29.3.0",
|
"ts-jest": "^29.3.1",
|
||||||
"typescript": "5.8.2"
|
"typescript": "5.8.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-17
@@ -13,17 +13,15 @@ import {
|
|||||||
} from '../strategyHelpers/deploymentHelper'
|
} from '../strategyHelpers/deploymentHelper'
|
||||||
import {DeploymentStrategy} from '../types/deploymentStrategy'
|
import {DeploymentStrategy} from '../types/deploymentStrategy'
|
||||||
import {parseTrafficSplitMethod} from '../types/trafficSplitMethod'
|
import {parseTrafficSplitMethod} from '../types/trafficSplitMethod'
|
||||||
|
import {ClusterType} from '../inputUtils'
|
||||||
export const ResourceTypeManagedCluster =
|
export const ResourceTypeManagedCluster =
|
||||||
'Microsoft.ContainerService/managedClusters'
|
'Microsoft.ContainerService/managedClusters'
|
||||||
export const ResourceTypeFleet = 'Microsoft.ContainerService/fleets'
|
export const ResourceTypeFleet = 'Microsoft.ContainerService/fleets'
|
||||||
export type ClusterType =
|
|
||||||
| typeof ResourceTypeManagedCluster
|
|
||||||
| typeof ResourceTypeFleet
|
|
||||||
|
|
||||||
export async function deploy(
|
export async function deploy(
|
||||||
kubectl: Kubectl,
|
kubectl: Kubectl,
|
||||||
manifestFilePaths: string[],
|
manifestFilePaths: string[],
|
||||||
deploymentStrategy: DeploymentStrategy
|
deploymentStrategy: DeploymentStrategy,
|
||||||
|
resourceType: ClusterType
|
||||||
) {
|
) {
|
||||||
// update manifests
|
// update manifests
|
||||||
const inputManifestFiles: string[] = updateManifestFiles(manifestFilePaths)
|
const inputManifestFiles: string[] = updateManifestFiles(manifestFilePaths)
|
||||||
@@ -45,8 +43,6 @@ export async function deploy(
|
|||||||
|
|
||||||
// check manifest stability
|
// check manifest stability
|
||||||
core.startGroup('Checking manifest stability')
|
core.startGroup('Checking manifest stability')
|
||||||
const resourceTypeInput =
|
|
||||||
core.getInput('resource-type') || ResourceTypeManagedCluster
|
|
||||||
const resourceTypes: Resource[] = getResources(
|
const resourceTypes: Resource[] = getResources(
|
||||||
deployedManifestFiles,
|
deployedManifestFiles,
|
||||||
models.DEPLOYMENT_TYPES.concat([
|
models.DEPLOYMENT_TYPES.concat([
|
||||||
@@ -54,16 +50,7 @@ export async function deploy(
|
|||||||
])
|
])
|
||||||
)
|
)
|
||||||
|
|
||||||
if (
|
await checkManifestStability(kubectl, resourceTypes, resourceType)
|
||||||
resourceTypeInput !== ResourceTypeManagedCluster &&
|
|
||||||
resourceTypeInput !== ResourceTypeFleet
|
|
||||||
) {
|
|
||||||
let errMsg = `Invalid resource type: ${resourceTypeInput}. Supported resource types are: ${ResourceTypeManagedCluster} (default), ${ResourceTypeFleet}`
|
|
||||||
core.setFailed(errMsg)
|
|
||||||
throw new Error(errMsg)
|
|
||||||
}
|
|
||||||
|
|
||||||
await checkManifestStability(kubectl, resourceTypes, resourceTypeInput)
|
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
// print ingresses
|
// print ingresses
|
||||||
|
|||||||
+9
-14
@@ -38,19 +38,20 @@ import {
|
|||||||
TrafficSplitMethod
|
TrafficSplitMethod
|
||||||
} from '../types/trafficSplitMethod'
|
} from '../types/trafficSplitMethod'
|
||||||
import {parseRouteStrategy, RouteStrategy} from '../types/routeStrategy'
|
import {parseRouteStrategy, RouteStrategy} from '../types/routeStrategy'
|
||||||
import {ResourceTypeFleet, ResourceTypeManagedCluster} from './deploy'
|
import {ClusterType} from '../inputUtils'
|
||||||
|
|
||||||
export async function promote(
|
export async function promote(
|
||||||
kubectl: Kubectl,
|
kubectl: Kubectl,
|
||||||
manifests: string[],
|
manifests: string[],
|
||||||
deploymentStrategy: DeploymentStrategy
|
deploymentStrategy: DeploymentStrategy,
|
||||||
|
resourceType: ClusterType
|
||||||
) {
|
) {
|
||||||
switch (deploymentStrategy) {
|
switch (deploymentStrategy) {
|
||||||
case DeploymentStrategy.CANARY:
|
case DeploymentStrategy.CANARY:
|
||||||
await promoteCanary(kubectl, manifests)
|
await promoteCanary(kubectl, manifests)
|
||||||
break
|
break
|
||||||
case DeploymentStrategy.BLUE_GREEN:
|
case DeploymentStrategy.BLUE_GREEN:
|
||||||
await promoteBlueGreen(kubectl, manifests)
|
await promoteBlueGreen(kubectl, manifests, resourceType)
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
throw Error('Invalid promote deployment strategy')
|
throw Error('Invalid promote deployment strategy')
|
||||||
@@ -140,7 +141,11 @@ async function promoteCanary(kubectl: Kubectl, manifests: string[]) {
|
|||||||
core.endGroup()
|
core.endGroup()
|
||||||
}
|
}
|
||||||
|
|
||||||
async function promoteBlueGreen(kubectl: Kubectl, manifests: string[]) {
|
async function promoteBlueGreen(
|
||||||
|
kubectl: Kubectl,
|
||||||
|
manifests: string[],
|
||||||
|
resourceType: ClusterType
|
||||||
|
) {
|
||||||
// update container images and pull secrets
|
// update container images and pull secrets
|
||||||
const inputManifestFiles: string[] = updateManifestFiles(manifests)
|
const inputManifestFiles: string[] = updateManifestFiles(manifests)
|
||||||
const manifestObjects: BlueGreenManifests =
|
const manifestObjects: BlueGreenManifests =
|
||||||
@@ -167,8 +172,6 @@ async function promoteBlueGreen(kubectl: Kubectl, manifests: string[]) {
|
|||||||
|
|
||||||
// checking stability of newly created deployments
|
// checking stability of newly created deployments
|
||||||
core.startGroup('Checking manifest stability')
|
core.startGroup('Checking manifest stability')
|
||||||
const resourceType =
|
|
||||||
core.getInput('resource-type') || ResourceTypeManagedCluster
|
|
||||||
const deployedManifestFiles = deployResult.manifestFiles
|
const deployedManifestFiles = deployResult.manifestFiles
|
||||||
const resources: Resource[] = getResources(
|
const resources: Resource[] = getResources(
|
||||||
deployedManifestFiles,
|
deployedManifestFiles,
|
||||||
@@ -176,14 +179,6 @@ async function promoteBlueGreen(kubectl: Kubectl, manifests: string[]) {
|
|||||||
models.DiscoveryAndLoadBalancerResource.SERVICE
|
models.DiscoveryAndLoadBalancerResource.SERVICE
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
if (
|
|
||||||
resourceType !== ResourceTypeManagedCluster &&
|
|
||||||
resourceType !== ResourceTypeFleet
|
|
||||||
) {
|
|
||||||
const errMsg = `Invalid resource type: ${resourceType}. Supported resource types are: ${ResourceTypeManagedCluster} (default), fleet`
|
|
||||||
core.setFailed(errMsg)
|
|
||||||
throw new Error(errMsg)
|
|
||||||
}
|
|
||||||
await KubernetesManifestUtility.checkManifestStability(
|
await KubernetesManifestUtility.checkManifestStability(
|
||||||
kubectl,
|
kubectl,
|
||||||
resources,
|
resources,
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import {parseResourceTypeInput} from './inputUtils'
|
||||||
|
import {
|
||||||
|
ClusterType,
|
||||||
|
ResourceTypeFleet,
|
||||||
|
ResourceTypeManagedCluster
|
||||||
|
} from './actions/deploy'
|
||||||
|
|
||||||
|
describe('InputUtils', () => {
|
||||||
|
describe('parseResourceTypeInput', () => {
|
||||||
|
it('should extract fleet exact match resource type', () => {
|
||||||
|
expect(
|
||||||
|
parseResourceTypeInput('Microsoft.ContainerService/fleets')
|
||||||
|
).toEqual(ResourceTypeFleet)
|
||||||
|
})
|
||||||
|
it('should match fleet case-insensitively', () => {
|
||||||
|
expect(
|
||||||
|
parseResourceTypeInput('Microsoft.containerservice/fleets')
|
||||||
|
).toEqual(ResourceTypeFleet)
|
||||||
|
})
|
||||||
|
it('should match managed cluster case-insensitively', () => {
|
||||||
|
expect(
|
||||||
|
parseResourceTypeInput('Microsoft.containerservice/MAnaGedClusterS')
|
||||||
|
).toEqual(ResourceTypeManagedCluster)
|
||||||
|
})
|
||||||
|
it('should error on unexpected values', () => {
|
||||||
|
expect(() => {
|
||||||
|
parseResourceTypeInput('icrosoft.ContainerService/ManagedCluster')
|
||||||
|
}).toThrow()
|
||||||
|
expect(() => {
|
||||||
|
parseResourceTypeInput('wrong-value')
|
||||||
|
}).toThrow()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {parseAnnotations} from './types/annotations'
|
import {parseAnnotations} from './types/annotations'
|
||||||
|
import {ResourceTypeFleet, ResourceTypeManagedCluster} from './actions/deploy'
|
||||||
|
|
||||||
export const inputAnnotations = parseAnnotations(
|
export const inputAnnotations = parseAnnotations(
|
||||||
core.getInput('annotations', {required: false})
|
core.getInput('annotations', {required: false})
|
||||||
@@ -14,3 +15,18 @@ export function getBufferTime(): number {
|
|||||||
|
|
||||||
return inputBufferTime
|
return inputBufferTime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function parseResourceTypeInput(rawInput: string): ClusterType {
|
||||||
|
switch (rawInput.toLowerCase()) {
|
||||||
|
case ResourceTypeFleet.toLowerCase():
|
||||||
|
return ResourceTypeFleet
|
||||||
|
case ResourceTypeManagedCluster.toLowerCase():
|
||||||
|
return ResourceTypeManagedCluster
|
||||||
|
}
|
||||||
|
throw new Error(
|
||||||
|
`Invalid resource type: ${rawInput}. Supported resource types are: ${ResourceTypeManagedCluster} (default), ${ResourceTypeFleet}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export type ClusterType =
|
||||||
|
| typeof ResourceTypeManagedCluster
|
||||||
|
| typeof ResourceTypeFleet
|
||||||
|
|||||||
+19
-3
@@ -1,12 +1,18 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {getKubectlPath, Kubectl} from './types/kubectl'
|
import {getKubectlPath, Kubectl} from './types/kubectl'
|
||||||
import {deploy} from './actions/deploy'
|
import {
|
||||||
|
deploy,
|
||||||
|
ResourceTypeFleet,
|
||||||
|
ResourceTypeManagedCluster
|
||||||
|
} from './actions/deploy'
|
||||||
|
import {ClusterType} from './inputUtils'
|
||||||
import {promote} from './actions/promote'
|
import {promote} from './actions/promote'
|
||||||
import {reject} from './actions/reject'
|
import {reject} from './actions/reject'
|
||||||
import {Action, parseAction} from './types/action'
|
import {Action, parseAction} from './types/action'
|
||||||
import {parseDeploymentStrategy} from './types/deploymentStrategy'
|
import {parseDeploymentStrategy} from './types/deploymentStrategy'
|
||||||
import {getFilesFromDirectoriesAndURLs} from './utilities/fileUtils'
|
import {getFilesFromDirectoriesAndURLs} from './utilities/fileUtils'
|
||||||
import {PrivateKubectl} from './types/privatekubectl'
|
import {PrivateKubectl} from './types/privatekubectl'
|
||||||
|
import {parseResourceTypeInput} from './inputUtils'
|
||||||
|
|
||||||
export async function run() {
|
export async function run() {
|
||||||
// verify kubeconfig is set
|
// verify kubeconfig is set
|
||||||
@@ -36,6 +42,16 @@ export async function run() {
|
|||||||
const resourceName = core.getInput('name') || ''
|
const resourceName = core.getInput('name') || ''
|
||||||
const skipTlsVerify = core.getBooleanInput('skip-tls-verify')
|
const skipTlsVerify = core.getBooleanInput('skip-tls-verify')
|
||||||
|
|
||||||
|
let resourceType: ClusterType
|
||||||
|
try {
|
||||||
|
// included in the trycatch to allow raw input to go out of scope after parsing
|
||||||
|
const resourceTypeInput = core.getInput('resource-type')
|
||||||
|
resourceType = parseResourceTypeInput(resourceTypeInput)
|
||||||
|
} catch (e) {
|
||||||
|
core.setFailed(e)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const kubectl = isPrivateCluster
|
const kubectl = isPrivateCluster
|
||||||
? new PrivateKubectl(
|
? new PrivateKubectl(
|
||||||
kubectlPath,
|
kubectlPath,
|
||||||
@@ -49,11 +65,11 @@ export async function run() {
|
|||||||
// run action
|
// run action
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case Action.DEPLOY: {
|
case Action.DEPLOY: {
|
||||||
await deploy(kubectl, fullManifestFilePaths, strategy)
|
await deploy(kubectl, fullManifestFilePaths, strategy, resourceType)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case Action.PROMOTE: {
|
case Action.PROMOTE: {
|
||||||
await promote(kubectl, fullManifestFilePaths, strategy)
|
await promote(kubectl, fullManifestFilePaths, strategy, resourceType)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case Action.REJECT: {
|
case Action.REJECT: {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import {
|
|||||||
} from '../utilities/githubUtils'
|
} from '../utilities/githubUtils'
|
||||||
import {getDeploymentConfig} from '../utilities/dockerUtils'
|
import {getDeploymentConfig} from '../utilities/dockerUtils'
|
||||||
import {DeployResult} from '../types/deployResult'
|
import {DeployResult} from '../types/deployResult'
|
||||||
import {ClusterType} from '../actions/deploy'
|
import {ClusterType} from '../inputUtils'
|
||||||
|
|
||||||
export async function deployManifests(
|
export async function deployManifests(
|
||||||
files: string[],
|
files: string[],
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import * as KubernetesConstants from '../types/kubernetesTypes'
|
|||||||
import {Kubectl, Resource} from '../types/kubectl'
|
import {Kubectl, Resource} from '../types/kubectl'
|
||||||
import {checkForErrors} from './kubectlUtils'
|
import {checkForErrors} from './kubectlUtils'
|
||||||
import {sleep} from './timeUtils'
|
import {sleep} from './timeUtils'
|
||||||
import {ClusterType, ResourceTypeFleet} from '../actions/deploy'
|
import {ResourceTypeFleet} from '../actions/deploy'
|
||||||
|
import {ClusterType} from '../inputUtils'
|
||||||
|
|
||||||
const IS_SILENT = false
|
const IS_SILENT = false
|
||||||
const POD = 'pod'
|
const POD = 'pod'
|
||||||
@@ -11,10 +12,10 @@ const POD = 'pod'
|
|||||||
export async function checkManifestStability(
|
export async function checkManifestStability(
|
||||||
kubectl: Kubectl,
|
kubectl: Kubectl,
|
||||||
resources: Resource[],
|
resources: Resource[],
|
||||||
clusterTyper: ClusterType
|
resourceType: ClusterType
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
// Skip if resource type is microsoft.containerservice/fleets
|
// Skip if resource type is microsoft.containerservice/fleets
|
||||||
if (clusterTyper === ResourceTypeFleet) {
|
if (resourceType === ResourceTypeFleet) {
|
||||||
core.info(`Skipping checkManifestStability for ${ResourceTypeFleet}`)
|
core.info(`Skipping checkManifestStability for ${ResourceTypeFleet}`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user