mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #23228 from yifan-gu/rkt_entry_cmd
Auto commit by PR queue bot
This commit is contained in:
commit
88d50f30d2
@ -425,11 +425,17 @@ func setApp(imgManifest *appcschema.ImageManifest, c *api.Container, opts *kubec
|
|||||||
var command, args []string
|
var command, args []string
|
||||||
cmd, ok := imgManifest.Annotations.Get(appcDockerEntrypoint)
|
cmd, ok := imgManifest.Annotations.Get(appcDockerEntrypoint)
|
||||||
if ok {
|
if ok {
|
||||||
command = strings.Fields(cmd)
|
err := json.Unmarshal([]byte(cmd), &command)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("cannot unmarshal ENTRYPOINT %q: %v", cmd, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ag, ok := imgManifest.Annotations.Get(appcDockerCmd)
|
ag, ok := imgManifest.Annotations.Get(appcDockerCmd)
|
||||||
if ok {
|
if ok {
|
||||||
args = strings.Fields(ag)
|
err := json.Unmarshal([]byte(ag), &args)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("cannot unmarshal CMD %q: %v", ag, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
userCommand, userArgs := kubecontainer.ExpandContainerCommandAndArgs(c, opts.Envs)
|
userCommand, userArgs := kubecontainer.ExpandContainerCommandAndArgs(c, opts.Envs)
|
||||||
|
|
||||||
@ -813,8 +819,6 @@ func (r *Runtime) preparePod(pod *api.Pod, pullSecrets []api.Secret) (string, *k
|
|||||||
// TODO handle pod.Spec.HostIPC
|
// TODO handle pod.Spec.HostIPC
|
||||||
|
|
||||||
units := []*unit.UnitOption{
|
units := []*unit.UnitOption{
|
||||||
// This makes the service show up for 'systemctl list-units' even if it exits successfully.
|
|
||||||
newUnitOption("Service", "RemainAfterExit", "true"),
|
|
||||||
newUnitOption("Service", "ExecStart", runPrepared),
|
newUnitOption("Service", "ExecStart", runPrepared),
|
||||||
// This enables graceful stop.
|
// This enables graceful stop.
|
||||||
newUnitOption("Service", "KillMode", "mixed"),
|
newUnitOption("Service", "KillMode", "mixed"),
|
||||||
|
@ -767,8 +767,16 @@ func baseApp(t *testing.T) *appctypes.App {
|
|||||||
|
|
||||||
func baseImageManifest(t *testing.T) *appcschema.ImageManifest {
|
func baseImageManifest(t *testing.T) *appcschema.ImageManifest {
|
||||||
img := &appcschema.ImageManifest{App: baseApp(t)}
|
img := &appcschema.ImageManifest{App: baseApp(t)}
|
||||||
img.Annotations.Set(*appctypes.MustACIdentifier(appcDockerEntrypoint), "/bin/foo")
|
entrypoint, err := json.Marshal([]string{"/bin/foo"})
|
||||||
img.Annotations.Set(*appctypes.MustACIdentifier(appcDockerCmd), "bar")
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
cmd, err := json.Marshal([]string{"bar"})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
img.Annotations.Set(*appctypes.MustACIdentifier(appcDockerEntrypoint), string(entrypoint))
|
||||||
|
img.Annotations.Set(*appctypes.MustACIdentifier(appcDockerCmd), string(cmd))
|
||||||
return img
|
return img
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user