Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

lib/app: use runtime app mounts and appVolumes rather than mountpoints #3571

Merged
merged 1 commit into from
Feb 1, 2017
Merged
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
28 changes: 5 additions & 23 deletions lib/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,30 +65,12 @@ func newApp(ra *schema.RuntimeApp, podManifest *schema.PodManifest, pod *pkgPod.
UserLabels: ra.App.UserLabels,
}

// Generate mounts
for _, mnt := range ra.App.MountPoints {
name := mnt.Name.String()
containerPath := mnt.Path
readOnly := mnt.ReadOnly

var hostPath string
for _, vol := range podManifest.Volumes {
if vol.Name != mnt.Name {
continue
}

hostPath = vol.Source
if vol.ReadOnly != nil && !readOnly {
readOnly = *vol.ReadOnly
}
break
}

for _, mnt := range ra.Mounts {
app.Mounts = append(app.Mounts, &Mount{
Name: name,
ContainerPath: containerPath,
HostPath: hostPath,
ReadOnly: readOnly,
Name: mnt.Volume.String(),
ContainerPath: mnt.Path,
HostPath: mnt.AppVolume.Source,
ReadOnly: *mnt.AppVolume.ReadOnly,
})
}

Expand Down