Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/action/runtime.container.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (c *runtimeContainer) GetFlags() *FlagsGroup {
Title: "Remote copy back",
Description: "Copies the working directory back from the container. Works only if the runtime is remote.",
Type: jsonschema.Boolean,
Default: false,
},
&DefParameter{
Name: containerFlagRemoveImage,
Expand Down Expand Up @@ -161,7 +162,8 @@ func (c *runtimeContainer) ValidateInput(input *Input) error {
}

// early peak for an exec flag.
if c.exec {
exec := input.GetFlagInGroup(c.flags.GetName(), containerFlagExec)
if exec != nil && exec.(bool) {
// Mark input as validated because arguments are passed directly to exec.
input.SetValidated(true)
}
Expand All @@ -188,7 +190,7 @@ func (c *runtimeContainer) SetFlags(input *Input) error {
c.noCache = nc.(bool)
}

if e, ok := flags[containerFlagEntrypoint]; ok {
if e, ok := flags[containerFlagEntrypoint]; ok && e != "" {
c.entrypointSet = true
c.entrypoint = e.(string)
}
Expand Down
8 changes: 6 additions & 2 deletions plugins/actionscobra/cobra.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ func CobraImpl(a *action.Action, streams launchr.Streams, manager action.Manager
if rt, ok := a.Runtime().(action.RuntimeFlags); ok {
runtimeFlagsGroup := rt.GetFlags()
runOpts = derefOpts(filterChangedFlags(cmd, runOpts))
for k, v := range runOpts {
input.SetFlagInGroup(runtimeFlagsGroup.GetName(), k, v)
for flag, defaultValue := range runtimeFlagsGroup.GetAll() {
value := defaultValue
if runOpts[flag] != nil {
value = runOpts[flag]
}
input.SetFlagInGroup(runtimeFlagsGroup.GetName(), flag, value)
}
}

Expand Down