-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shared docker volumes with EFS #822
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
69d5a17
export LabelsByPrefix
mattmanning 58b83cb
honor volumes if convox.volumes.mount label is set
mattmanning 8826b44
comment LabelsByPrefix func
mattmanning 07f3932
use efs to back docker volumes
ddollar db9d834
fix comment
ddollar e6a49db
always mount volumes
ddollar 7a15433
only use efs in regions where it is supported
ddollar d5b5270
namespace mounted volumes with app stack and process name
ddollar 8144665
dont export helper struct
ddollar c48ea21
on second thought do export struct just comment it
ddollar c79f59a
satisfy hound
ddollar 1657d67
keep trying to mount nfs until done
ddollar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import ( | |
"html/template" | ||
"math/rand" | ||
"os" | ||
"path/filepath" | ||
"sort" | ||
"strings" | ||
|
||
|
@@ -163,9 +164,10 @@ func (m Manifest) AppName() string { | |
return m[0].app.Name | ||
} | ||
|
||
func (me ManifestEntry) LabelsByPrefix(prefix string) map[string]string { | ||
// LabelsByPrefix will return the labels that have a given prefix | ||
func (e ManifestEntry) LabelsByPrefix(prefix string) map[string]string { | ||
returnLabels := make(map[string]string) | ||
switch labels := me.Labels.(type) { | ||
switch labels := e.Labels.(type) { | ||
case map[interface{}]interface{}: | ||
for k, v := range labels { | ||
ks, ok := k.(string) | ||
|
@@ -468,13 +470,38 @@ func (me ManifestEntry) EnvMap() map[string]string { | |
return envs | ||
} | ||
|
||
func (me ManifestEntry) MountableVolumes() []string { | ||
volumes := []string{} | ||
// MountableVolume describes a mountable volume | ||
type MountableVolume struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. exported type MountableVolume should have comment or be unexported |
||
Host string | ||
Container string | ||
} | ||
|
||
// MountableVolumes return the mountable volumes for a manifest entry | ||
func (e ManifestEntry) MountableVolumes() []MountableVolume { | ||
volumes := []MountableVolume{} | ||
|
||
for _, volume := range e.Volumes { | ||
parts := strings.Split(volume, ":") | ||
|
||
for _, volume := range me.Volumes { | ||
if strings.HasPrefix(volume, "/var/run/docker.sock") { | ||
volumes = append(volumes, volume) | ||
// if only one volume part use it for both sides | ||
if len(parts) == 1 { | ||
parts = append(parts, parts[0]) | ||
} | ||
|
||
// if we dont have two volume parts bail | ||
if len(parts) != 2 { | ||
continue | ||
} | ||
|
||
// only support absolute paths for volume source | ||
if !filepath.IsAbs(parts[0]) { | ||
continue | ||
} | ||
|
||
volumes = append(volumes, MountableVolume{ | ||
Host: parts[0], | ||
Container: parts[1], | ||
}) | ||
} | ||
|
||
return volumes | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method ManifestEntry.LabelsByPrefix should have comment or be unexported