Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
| ... | ... |
@@ -29,7 +29,7 @@ type mountPoint struct {
|
| 29 | 29 |
RW bool |
| 30 | 30 |
Volume volume.Volume `json:"-"` |
| 31 | 31 |
Source string |
| 32 |
- Relabel string |
|
| 32 |
+ Mode string `json:"Relabel"` // Originally field was `Relabel`" |
|
| 33 | 33 |
} |
| 34 | 34 |
|
| 35 | 35 |
func (m *mountPoint) Setup() (string, error) {
|
| ... | ... |
@@ -94,8 +94,8 @@ func parseBindMount(spec string, mountLabel string, config *runconfig.Config) (* |
| 94 | 94 |
return nil, fmt.Errorf("invalid mode for volumes-from: %s", mode)
|
| 95 | 95 |
} |
| 96 | 96 |
bind.RW = isRw |
| 97 |
- // Relabel will apply a SELinux label, if necessary |
|
| 98 |
- bind.Relabel = mode |
|
| 97 |
+ // Mode field is used by SELinux to decide whether to apply label |
|
| 98 |
+ bind.Mode = mode |
|
| 99 | 99 |
default: |
| 100 | 100 |
return nil, fmt.Errorf("Invalid volume specification: %s", spec)
|
| 101 | 101 |
} |
| ... | ... |
@@ -226,12 +226,12 @@ func (daemon *Daemon) registerMountPoints(container *Container, hostConfig *runc |
| 226 | 226 |
bind.Volume = v |
| 227 | 227 |
bind.Source = v.Path() |
| 228 | 228 |
// Since this is just a named volume and not a typical bind, set to shared mode `z` |
| 229 |
- if bind.Relabel == "" {
|
|
| 230 |
- bind.Relabel = "z" |
|
| 229 |
+ if bind.Mode == "" {
|
|
| 230 |
+ bind.Mode = "z" |
|
| 231 | 231 |
} |
| 232 | 232 |
} |
| 233 | 233 |
|
| 234 |
- if err := label.Relabel(bind.Source, container.MountLabel, bind.Relabel); err != nil {
|
|
| 234 |
+ if err := label.Relabel(bind.Source, container.MountLabel, bind.Mode); err != nil {
|
|
| 235 | 235 |
return err |
| 236 | 236 |
} |
| 237 | 237 |
binds[bind.Destination] = true |