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

Commit

Permalink
Merge pull request #239 from joshwget/volumes-interpolation
Browse files Browse the repository at this point in the history
Interpolate under volumes section
  • Loading branch information
ibuildthecloud authored Dec 13, 2016
2 parents a50baa7 + d34c91e commit 1a5c272
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 93 deletions.
4 changes: 2 additions & 2 deletions lookup/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewFileEnvLookup(file string, parent config.EnvironmentLookup) (*FileEnvLoo
}, nil
}

func (f *FileEnvLookup) Lookup(key, serviceName string, config *config.ServiceConfig) []string {
func (f *FileEnvLookup) Lookup(key string, config *config.ServiceConfig) []string {
if v, ok := f.variables[key]; ok {
return []string{fmt.Sprintf("%s=%s", key, v)}
}
Expand All @@ -55,5 +55,5 @@ func (f *FileEnvLookup) Lookup(key, serviceName string, config *config.ServiceCo
return nil
}

return f.parent.Lookup(key, serviceName, config)
return f.parent.Lookup(key, config)
}
2 changes: 1 addition & 1 deletion lookup/map_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type MapEnvLookup struct {
Env map[string]interface{}
}

func (m *MapEnvLookup) Lookup(key, serviceName string, config *config.ServiceConfig) []string {
func (m *MapEnvLookup) Lookup(key string, config *config.ServiceConfig) []string {
if v, ok := m.Env[key]; ok {
return []string{fmt.Sprintf("%s=%v", key, v)}
}
Expand Down
4 changes: 2 additions & 2 deletions lookup/questions.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func join(key, v string) []string {
return []string{fmt.Sprintf("%s=%s", key, v)}
}

func (f *QuestionLookup) Lookup(key, serviceName string, config *config.ServiceConfig) []string {
func (f *QuestionLookup) Lookup(key string, config *config.ServiceConfig) []string {
if v, ok := f.variables[key]; ok {
return join(key, v)
}
Expand All @@ -122,7 +122,7 @@ func (f *QuestionLookup) Lookup(key, serviceName string, config *config.ServiceC
}

if f.parent != nil {
parentResult := f.parent.Lookup(key, serviceName, config)
parentResult := f.parent.Lookup(key, config)
if len(parentResult) > 0 {
return parentResult
}
Expand Down
2 changes: 1 addition & 1 deletion rancher/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (c *Context) unmarshalBytes(composeBytes, bytes []byte) error {
}

func (c *Context) fillInRancherConfig(rawServiceMap config.RawServiceMap) error {
if err := config.Interpolate(c.EnvironmentLookup, &rawServiceMap); err != nil {
if err := config.InterpolateRawServiceMap(&rawServiceMap, c.EnvironmentLookup); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion trash.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ github.com/urfave/cli v1.18.0
github.com/docker/distribution 77b9d2997abcded79a5314970fe69a44c93c25fb
github.com/docker/docker 8658748ef716e43a5f6d834825d818012ed6e2c4
github.com/docker/go-connections 988efe982fdecb46f01d53465878ff1f2ff411ce
github.com/docker/libcompose 81ab85ad1c6cbc4395775d9649d4d92994a2e412 https://github.com/rancher/libcompose
github.com/docker/libcompose 6d5e31da6e294b6d2922434a68e19538038f4243 https://github.com/rancher/libcompose
github.com/flynn/go-shlex 3f9db97f856818214da2e1057f8ad84803971cff
github.com/gorilla/context 14f550f51a
github.com/gorilla/mux e444e69cbd
Expand Down
48 changes: 18 additions & 30 deletions vendor/github.com/docker/libcompose/config/interpolation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 59 additions & 13 deletions vendor/github.com/docker/libcompose/config/merge.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 1 addition & 16 deletions vendor/github.com/docker/libcompose/config/merge_v1.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 1 addition & 16 deletions vendor/github.com/docker/libcompose/config/merge_v2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions vendor/github.com/docker/libcompose/config/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/docker/libcompose/lookup/composable.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/docker/libcompose/lookup/envfile.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/docker/libcompose/lookup/simple_env.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/docker/libcompose/project/project.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1a5c272

Please sign in to comment.