diff --git a/README.md b/README.md index f97ed9e..ce50503 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/main.js b/main.js index 2947d6f..99de1e2 100644 --- a/main.js +++ b/main.js @@ -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, }, ],