1
0
mirror of https://github.com/rancher/os.git synced 2025-09-04 08:14:21 +00:00

migrate to upstream libcompose in one and a half go

This commit is contained in:
Ivan Mikushin
2015-11-26 17:41:42 +05:00
parent 1d691cd8d6
commit 5a363ab97d
1291 changed files with 40107 additions and 123532 deletions

View File

@@ -1,6 +1,58 @@
Aanand Prasad <aanand@docker.com> (@aanand)
Adrien Duermael <adrien@docker.com> (@aduermael)
Daniel Nephin <dnephin@gmail.com> (@dnephin)
Darren Shepherd <darren@rancher.com> (@ibuildthecloud)
Gaetan de Villele <gaetan@docker.com> (@gdevillele)
Vincent Demeester <vincent@sbr.pm> (@vdemeester)
# Libcompose maintainers file
#
# This file describes who runs the docker/libcompose project and how.
# This is a living document - if you see something out of date or missing, speak up!
#
# It is structured to be consumable by both humans and programs.
# To extract its contents programmatically, use any TOML-compliant parser.
#
# This file is compiled into the MAINTAINERS file in docker/opensource.
#
[Org]
[Org."Core maintainers"]
people = [
"aanand",
"aduermael",
"dnephin",
"ibuildthecloud",
"gdevillele",
"vdemeester",
]
[people]
# A reference list of all people associated with the project.
# All other sections should refer to people by their canonical key
# in the people section.
# ADD YOURSELF HERE IN ALPHABETICAL ORDER
[people.aanand]
Name = "Aanand Prasad"
Email = "aanand@docker.com"
GitHub = "aanand"
[people.aduermael]
Name = "Adrien Duermael"
Email = "adrien@docker.com"
GitHub = "aduermael"
[people.dnephin]
Name = "Daniel Nephin"
Email = "dnephin@gmail.com"
GitHub = "dnephin"
[people.ibuildthecloud]
Name = "Darren Shepherd"
Email = "darren@rancher.com"
GitHub = "ibuildthecloud"
[people.gdevillele]
Name = "Gaetan de Villele"
Email = "gaetan@docker.com"
GitHub = "gdevillele"
[people.vdemeester]
Name = "Vincent Demeester"
Email = "vincent@sbr.pm"
GitHub = "vdemeester"

View File

@@ -136,10 +136,21 @@ func CreateTar(p *project.Project, name string) (io.ReadCloser, error) {
return nil, fmt.Errorf("Cannot locate Dockerfile: %s", origDockerfile)
}
var includes = []string{"."}
var excludes []string
excludes, err := utils.ReadDockerIgnore(path.Join(root, ".dockerignore"))
dockerIgnorePath := path.Join(root, ".dockerignore")
dockerIgnore, err := os.Open(dockerIgnorePath)
if err != nil {
return nil, err
if !os.IsNotExist(err) {
return nil, err
}
logrus.Warnf("Error while reading .dockerignore (%s) : %s", dockerIgnorePath, err.Error())
excludes = make([]string, 0)
} else {
excludes, err = utils.ReadDockerIgnore(dockerIgnore)
if err != nil {
return nil, err
}
}
// If .dockerignore mentions .dockerignore or the Dockerfile

View File

@@ -456,6 +456,7 @@ func (c *Container) Log() error {
l := c.service.context.LoggerFactory.Create(c.name)
err = c.client.Logs(dockerclient.LogsOptions{
Container: c.name,
Follow: true,
Stdout: true,
Stderr: true,
@@ -464,6 +465,7 @@ func (c *Container) Log() error {
ErrorStream: &logger.Wrapper{Logger: l, Err: true},
RawTerminal: info.Config.Tty,
})
logrus.WithFields(logrus.Fields{"Logger": l, "err": err}).Debug("c.client.Logs() returned error")
return err
}

View File

@@ -1,4 +0,0 @@
package libcompose
//go:generate mkdir -p vendor/github.com/docker/docker/autogen/dockerversion
//go:generate cp script/dockerversion vendor/github.com/docker/docker/autogen/dockerversion/dockerversion.go

View File

@@ -15,9 +15,6 @@ type Stringorslice struct {
// MarshalYAML implements the Marshaller interface.
func (s Stringorslice) MarshalYAML() (tag string, value interface{}, err error) {
if s.parts == nil {
return "", []string{}, nil
}
return "", s.parts, nil
}
@@ -67,9 +64,6 @@ type Command struct {
// MarshalYAML implements the Marshaller interface.
func (s Command) MarshalYAML() (tag string, value interface{}, err error) {
if s.parts == nil {
return "", []string{}, nil
}
return "", s.parts, nil
}
@@ -113,9 +107,6 @@ type SliceorMap struct {
// MarshalYAML implements the Marshaller interface.
func (s SliceorMap) MarshalYAML() (tag string, value interface{}, err error) {
if s.parts == nil {
return "", map[string]string{}, nil
}
return "", s.parts, nil
}
@@ -169,9 +160,6 @@ type MaporEqualSlice struct {
// MarshalYAML implements the Marshaller interface.
func (s MaporEqualSlice) MarshalYAML() (tag string, value interface{}, err error) {
if s.parts == nil {
return "", []string{}, nil
}
return "", s.parts, nil
}
@@ -214,9 +202,6 @@ type MaporColonSlice struct {
// MarshalYAML implements the Marshaller interface.
func (s MaporColonSlice) MarshalYAML() (tag string, value interface{}, err error) {
if s.parts == nil {
return "", []string{}, nil
}
return "", s.parts, nil
}
@@ -259,9 +244,6 @@ type MaporSpaceSlice struct {
// MarshalYAML implements the Marshaller interface.
func (s MaporSpaceSlice) MarshalYAML() (tag string, value interface{}, err error) {
if s.parts == nil {
return "", []string{}, nil
}
return "", s.parts, nil
}

View File

@@ -120,6 +120,11 @@ type StructSliceorMap struct {
Bars []string `yaml:"bars"`
}
type StructCommand struct {
Entrypoint Command `yaml:"entrypoint,flow,omitempty"`
Command Command `yaml:"command,flow,omitempty"`
}
func TestSliceOrMapYaml(t *testing.T) {
str := `{foos: [bar=baz, far=faz]}`
@@ -192,3 +197,24 @@ func TestMaporsliceYaml(t *testing.T) {
assert.True(t, contains(s2.Foo.parts, "bar=baz"))
assert.True(t, contains(s2.Foo.parts, "far=faz"))
}
var sampleStructCommand = `command: bash`
func TestUnmarshalCommand(t *testing.T) {
s := &StructCommand{}
err := yaml.Unmarshal([]byte(sampleStructCommand), s)
assert.Nil(t, err)
assert.Equal(t, []string{"bash"}, s.Command.Slice())
assert.Nil(t, s.Entrypoint.Slice())
bytes, err := yaml.Marshal(s)
assert.Nil(t, err)
s2 := &StructCommand{}
err = yaml.Unmarshal(bytes, s2)
assert.Nil(t, err)
assert.Equal(t, []string{"bash"}, s.Command.Slice())
assert.Nil(t, s.Entrypoint.Slice())
}