forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Select entrypoint command based on runtime platform
This fixes a long-standing bug affecting heterogenous clusters, where the controller's platform would be used to lookup the image's entrypoint, instead of the platform of the node where the workload would eventually run. With this change, the controller looks up _all_ the image's entrypoints and passes them to the entrypoint binary on the node, where it uses its current runtime platform to lookup the correct entrypoint to execute. This has the added benefit that we can now pass the entire image@digest of the multi-platform image down to the Pod, instead of the (controller's) platform-specific image. This has benefits for scenarios where Pods may be blocked from running unsigned/untrusted images, since it might be the multi-platform image index that's signed/trusted, and not any particular platform-specific constituent image.
- Loading branch information
1 parent
873edd2
commit 5e834d4
Showing
159 changed files
with
10,585 additions
and
6,790 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
name: entrypoint-resolution | ||
spec: | ||
taskSpec: | ||
steps: | ||
# Multi-arch image with no command defined. We should look up the command | ||
# for each platform-specific image and pass it to the Pod, which selects | ||
# the right command at runtime based on the node's runtime platform. | ||
- image: gcr.io/tekton-nightly/github.com/tektoncd/pipeline/cmd/nop | ||
|
||
# Single-platform image with no command defined, but with args. We'll look | ||
# up the commands and pass it to the entrypoint binary via env var, then | ||
# append the specified args. | ||
- image: ubuntu | ||
args: ['-c', 'echo', 'hello'] | ||
|
||
# Multi-arch image, but since we specify `script` we don't need to look it | ||
# up and pass it down. | ||
- image: ubuntu | ||
script: echo hello | ||
|
||
# Multi-arch image, but since we specify `command` and `args` we don't | ||
# need to look it up and pass it down. | ||
- image: ubuntu | ||
command: ['sh', '-c'] | ||
args: ['echo hello'] | ||
|
||
# Single-platform image with no command defined. We should look up the one | ||
# and only command value and pass it to the Pod. | ||
- image: amd64/ubuntu | ||
|
||
# Single-platform image with no command defined, but with args. We'll look | ||
# up the one command and pass it to the entrypoint binary, then append the | ||
# specified args. | ||
- image: amd64/ubuntu | ||
args: ['-c', 'echo', 'hello'] | ||
|
||
# Single-platform image, but since we specify `script` we don't need to | ||
# look it up and pass it down. | ||
- image: amd64/ubuntu | ||
script: echo hello | ||
|
||
# Single-platform image, but since we specify `command` and `args` we | ||
# don't need to look it up and pass it down. | ||
- image: amd64/ubuntu | ||
command: ['sh', '-c'] | ||
args: ['echo hello'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.