Skip to content

Commit

Permalink
Merge pull request #11 from sekassel-research/feat/container-id
Browse files Browse the repository at this point in the history
Custom Container ID
  • Loading branch information
Clashsoft authored Nov 26, 2022
2 parents e4cb7e3 + 50d310e commit a19fa9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
namespace: ${{ secrets.NAMESPACE }}
deployment: ${{ secrets.DEPLOYMENT }}
docker_image: sekassel-research/test-image:latest
container_id: 0 # optional, defaults to 0
```
# Backwards compatibility
Expand Down
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ async function main() {
const namespace = core.getInput('namespace', {required: true});
const deployment = core.getInput('deployment', {required: true});
const dockerImage = core.getInput('docker_image', {required: true});
const containerId = core.getInput('container_id', {required: false}) || 0;

await axios.patch(
`${rancherUrl}/k8s/clusters/${clusterId}/apis/apps/v1/namespaces/${namespace}/deployments/${deployment}`,
[
{
op: 'replace',
path: '/spec/template/spec/containers/0/image',
path: `/spec/template/spec/containers/${containerId}/image`,
value: dockerImage,
},
],
Expand Down

0 comments on commit a19fa9a

Please sign in to comment.