mirror of
https://github.com/rancher/os.git
synced 2025-09-29 06:25:07 +00:00
Bump libcompose and its dependencies
This commit is contained in:
41
vendor/github.com/docker/libcompose/docker/project.go
generated
vendored
41
vendor/github.com/docker/libcompose/docker/project.go
generated
vendored
@@ -1,20 +1,42 @@
|
||||
package docker
|
||||
|
||||
import (
|
||||
"github.com/Sirupsen/logrus"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/docker/libcompose/config"
|
||||
"github.com/docker/libcompose/docker/client"
|
||||
"github.com/docker/libcompose/lookup"
|
||||
"github.com/docker/libcompose/project"
|
||||
)
|
||||
|
||||
// ComposeVersion is name of docker-compose.yml file syntax supported version
|
||||
const ComposeVersion = "1.5.0"
|
||||
|
||||
// NewProject creates a Project with the specified context.
|
||||
func NewProject(context *Context) (*project.Project, error) {
|
||||
if context.ConfigLookup == nil {
|
||||
context.ConfigLookup = &lookup.FileConfigLookup{}
|
||||
func NewProject(context *Context, parseOptions *config.ParseOptions) (*project.Project, error) {
|
||||
if context.ResourceLookup == nil {
|
||||
context.ResourceLookup = &lookup.FileConfigLookup{}
|
||||
}
|
||||
|
||||
if context.EnvironmentLookup == nil {
|
||||
context.EnvironmentLookup = &lookup.OsEnvLookup{}
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
context.EnvironmentLookup = &lookup.ComposableEnvLookup{
|
||||
Lookups: []config.EnvironmentLookup{
|
||||
&lookup.EnvfileLookup{
|
||||
Path: filepath.Join(cwd, ".env"),
|
||||
},
|
||||
&lookup.OsEnvLookup{},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
if context.AuthLookup == nil {
|
||||
context.AuthLookup = &ConfigAuthLookup{context}
|
||||
}
|
||||
|
||||
if context.ServiceFactory == nil {
|
||||
@@ -23,19 +45,16 @@ func NewProject(context *Context) (*project.Project, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if context.Builder == nil {
|
||||
context.Builder = NewDaemonBuilder(context)
|
||||
}
|
||||
|
||||
if context.ClientFactory == nil {
|
||||
factory, err := NewDefaultClientFactory(ClientOpts{})
|
||||
factory, err := project.NewDefaultClientFactory(client.Options{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
context.ClientFactory = factory
|
||||
}
|
||||
|
||||
p := project.NewProject(&context.Context)
|
||||
// FIXME(vdemeester) Remove the context duplication ?
|
||||
p := project.NewProject(context.ClientFactory, &context.Context, parseOptions)
|
||||
|
||||
err := p.Parse()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user