Signed-off-by: Vincent Demeester <vincent@sbr.pm>
| ... | ... |
@@ -33,6 +33,7 @@ type ContainerSpec struct {
|
| 33 | 33 |
User string `json:",omitempty"` |
| 34 | 34 |
Groups []string `json:",omitempty"` |
| 35 | 35 |
TTY bool `json:",omitempty"` |
| 36 |
+ OpenStdin bool `json:",omitempty"` |
|
| 36 | 37 |
Mounts []mount.Mount `json:",omitempty"` |
| 37 | 38 |
StopGracePeriod *time.Duration `json:",omitempty"` |
| 38 | 39 |
Healthcheck *container.HealthConfig `json:",omitempty"` |
| ... | ... |
@@ -14,18 +14,19 @@ import ( |
| 14 | 14 |
|
| 15 | 15 |
func containerSpecFromGRPC(c *swarmapi.ContainerSpec) types.ContainerSpec {
|
| 16 | 16 |
containerSpec := types.ContainerSpec{
|
| 17 |
- Image: c.Image, |
|
| 18 |
- Labels: c.Labels, |
|
| 19 |
- Command: c.Command, |
|
| 20 |
- Args: c.Args, |
|
| 21 |
- Hostname: c.Hostname, |
|
| 22 |
- Env: c.Env, |
|
| 23 |
- Dir: c.Dir, |
|
| 24 |
- User: c.User, |
|
| 25 |
- Groups: c.Groups, |
|
| 26 |
- TTY: c.TTY, |
|
| 27 |
- Hosts: c.Hosts, |
|
| 28 |
- Secrets: secretReferencesFromGRPC(c.Secrets), |
|
| 17 |
+ Image: c.Image, |
|
| 18 |
+ Labels: c.Labels, |
|
| 19 |
+ Command: c.Command, |
|
| 20 |
+ Args: c.Args, |
|
| 21 |
+ Hostname: c.Hostname, |
|
| 22 |
+ Env: c.Env, |
|
| 23 |
+ Dir: c.Dir, |
|
| 24 |
+ User: c.User, |
|
| 25 |
+ Groups: c.Groups, |
|
| 26 |
+ TTY: c.TTY, |
|
| 27 |
+ OpenStdin: c.OpenStdin, |
|
| 28 |
+ Hosts: c.Hosts, |
|
| 29 |
+ Secrets: secretReferencesFromGRPC(c.Secrets), |
|
| 29 | 30 |
} |
| 30 | 31 |
|
| 31 | 32 |
if c.DNSConfig != nil {
|
| ... | ... |
@@ -123,18 +124,19 @@ func secretReferencesFromGRPC(sr []*swarmapi.SecretReference) []*types.SecretRef |
| 123 | 123 |
|
| 124 | 124 |
func containerToGRPC(c types.ContainerSpec) (*swarmapi.ContainerSpec, error) {
|
| 125 | 125 |
containerSpec := &swarmapi.ContainerSpec{
|
| 126 |
- Image: c.Image, |
|
| 127 |
- Labels: c.Labels, |
|
| 128 |
- Command: c.Command, |
|
| 129 |
- Args: c.Args, |
|
| 130 |
- Hostname: c.Hostname, |
|
| 131 |
- Env: c.Env, |
|
| 132 |
- Dir: c.Dir, |
|
| 133 |
- User: c.User, |
|
| 134 |
- Groups: c.Groups, |
|
| 135 |
- TTY: c.TTY, |
|
| 136 |
- Hosts: c.Hosts, |
|
| 137 |
- Secrets: secretReferencesToGRPC(c.Secrets), |
|
| 126 |
+ Image: c.Image, |
|
| 127 |
+ Labels: c.Labels, |
|
| 128 |
+ Command: c.Command, |
|
| 129 |
+ Args: c.Args, |
|
| 130 |
+ Hostname: c.Hostname, |
|
| 131 |
+ Env: c.Env, |
|
| 132 |
+ Dir: c.Dir, |
|
| 133 |
+ User: c.User, |
|
| 134 |
+ Groups: c.Groups, |
|
| 135 |
+ TTY: c.TTY, |
|
| 136 |
+ OpenStdin: c.OpenStdin, |
|
| 137 |
+ Hosts: c.Hosts, |
|
| 138 |
+ Secrets: secretReferencesToGRPC(c.Secrets), |
|
| 138 | 139 |
} |
| 139 | 140 |
|
| 140 | 141 |
if c.DNSConfig != nil {
|
| ... | ... |
@@ -185,6 +185,7 @@ func (c *containerConfig) config() *enginecontainer.Config {
|
| 185 | 185 |
config := &enginecontainer.Config{
|
| 186 | 186 |
Labels: c.labels(), |
| 187 | 187 |
Tty: c.spec().TTY, |
| 188 |
+ OpenStdin: c.spec().OpenStdin, |
|
| 188 | 189 |
User: c.spec().User, |
| 189 | 190 |
Env: c.spec().Env, |
| 190 | 191 |
Hostname: c.spec().Hostname, |