mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 16:53:46 +02:00
Review config for cmd/entrypoint after building a stage
As mentioned in #346, if only ENTRYPOINT is set in a stage then any CMD inherited from a parent should be cleared. If both entrypoint and cmd are set then nothing should change. I added a function and unit test to review the config file after building a stage which clears out config.Cmd if ENTRYPOINT was declared but CMD wasn't. I also added an integration test to make sure this works, which should be tested by the preexisting container-diff --metadata test.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
FROM scratch AS first
|
||||
CMD ["mycmd"]
|
||||
|
||||
FROM first
|
||||
ENTRYPOINT ["myentrypoint"] # This should clear out CMD in the config metadata
|
||||
Reference in New Issue
Block a user