Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use entrypoint and cmd for play kube #8789

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 8 additions & 3 deletions pkg/specgen/generate/kube/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ func ToSpecGen(ctx context.Context, containerYAML v1.Container, iid string, newI
if imageData.Config.WorkingDir != "" {
s.WorkDir = imageData.Config.WorkingDir
}
s.Command = imageData.Config.Entrypoint
if len(imageData.Config.Entrypoint) != 0 {
s.Entrypoint = imageData.Config.Entrypoint
}
if len(imageData.Config.Cmd) != 0 {
s.Command = imageData.Config.Cmd
}
s.Labels = imageData.Config.Labels
if len(imageData.Config.StopSignal) > 0 {
stopSignal, err := util.ParseSignal(imageData.Config.StopSignal)
Expand All @@ -127,11 +132,11 @@ func ToSpecGen(ctx context.Context, containerYAML v1.Container, iid string, newI
}
}
if len(containerYAML.Command) != 0 {
s.Command = containerYAML.Command
s.Entrypoint = containerYAML.Command
}
// doc https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes
if len(containerYAML.Args) != 0 {
s.Command = append(s.Command, containerYAML.Args...)
s.Command = containerYAML.Args
}
// FIXME,
// we are currently ignoring imageData.Config.ExposedPorts
Expand Down