define CapMountSSH

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
docker-18.09
Akihiro Suda 2018-10-02 15:17:08 +09:00
parent cc8d59ecb0
commit 900a1b96c4
2 changed files with 11 additions and 0 deletions

View File

@ -270,6 +270,10 @@ func (e *ExecOp) Marshal(c *Constraints) (digest.Digest, []byte, *pb.OpMetadata,
addCap(&e.constraints, pb.CapMountSecret)
}
if len(e.ssh) > 0 {
addCap(&e.constraints, pb.CapMountSSH)
}
for _, s := range e.secrets {
pm := &pb.Mount{
Dest: s.Target,

View File

@ -40,6 +40,7 @@ const (
CapExecMountSelector apicaps.CapID = "exec.mount.selector"
CapExecMountTmpfs apicaps.CapID = "exec.mount.tmpfs"
CapMountSecret apicaps.CapID = "exec.mount.secret"
CapMountSSH apicaps.CapID = "exec.mount.ssh"
CapConstraints apicaps.CapID = "constraints"
CapPlatform apicaps.CapID = "platform"
@ -212,6 +213,12 @@ func init() {
Status: apicaps.CapStatusExperimental,
})
Caps.Init(apicaps.Cap{
ID: CapMountSSH,
Enabled: true,
Status: apicaps.CapStatusExperimental,
})
Caps.Init(apicaps.Cap{
ID: CapConstraints,
Enabled: true,