Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #340 from joshwget/go-yaml
Browse files Browse the repository at this point in the history
Switch back to go-yaml
  • Loading branch information
vdemeester authored Jul 28, 2016
2 parents e1a83f7 + fb72517 commit 80e2cf9
Show file tree
Hide file tree
Showing 54 changed files with 8,211 additions and 10,771 deletions.
2 changes: 1 addition & 1 deletion config/interpolation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"testing"

yaml "github.com/cloudfoundry-incubator/candiedyaml"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v2"
)

func testInterpolatedLine(t *testing.T, expectedLine, interpolatedLine string, envVariables map[string]string) {
Expand Down
2 changes: 1 addition & 1 deletion config/marshal_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package config
import (
"testing"

yaml "github.com/cloudfoundry-incubator/candiedyaml"
yamlTypes "github.com/docker/libcompose/yaml"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v2"
)

type TestConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion config/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"fmt"
"strings"

yaml "github.com/cloudfoundry-incubator/candiedyaml"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/libcompose/utils"
composeYaml "github.com/docker/libcompose/yaml"
"gopkg.in/yaml.v2"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion config/merge_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"path"

"github.com/Sirupsen/logrus"
yaml "github.com/cloudfoundry-incubator/candiedyaml"
"github.com/docker/libcompose/utils"
"gopkg.in/yaml.v2"
)

// MergeServicesV1 merges a v1 compose file into an existing set of service configs
Expand Down
2 changes: 1 addition & 1 deletion config/merge_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"path"

"github.com/Sirupsen/logrus"
yaml "github.com/cloudfoundry-incubator/candiedyaml"
"github.com/docker/libcompose/utils"
"gopkg.in/yaml.v2"
)

// MergeServicesV2 merges a v2 compose file into an existing set of service configs
Expand Down
20 changes: 10 additions & 10 deletions config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ type ServiceConfigV1 struct {
CapAdd []string `yaml:"cap_add,omitempty"`
CapDrop []string `yaml:"cap_drop,omitempty"`
CgroupParent string `yaml:"cgroup_parent,omitempty"`
CPUQuota int64 `yaml:"cpu_quota,omitempty"`
CPUQuota yaml.StringorInt `yaml:"cpu_quota,omitempty"`
CPUSet string `yaml:"cpuset,omitempty"`
CPUShares int64 `yaml:"cpu_shares,omitempty"`
CPUShares yaml.StringorInt `yaml:"cpu_shares,omitempty"`
Command yaml.Command `yaml:"command,flow,omitempty"`
ContainerName string `yaml:"container_name,omitempty"`
Devices []string `yaml:"devices,omitempty"`
Expand All @@ -42,8 +42,8 @@ type ServiceConfigV1 struct {
Links yaml.MaporColonSlice `yaml:"links,omitempty"`
LogDriver string `yaml:"log_driver,omitempty"`
MacAddress string `yaml:"mac_address,omitempty"`
MemLimit int64 `yaml:"mem_limit,omitempty"`
MemSwapLimit int64 `yaml:"memswap_limit,omitempty"`
MemLimit yaml.StringorInt `yaml:"mem_limit,omitempty"`
MemSwapLimit yaml.StringorInt `yaml:"memswap_limit,omitempty"`
Name string `yaml:"name,omitempty"`
Net string `yaml:"net,omitempty"`
Pid string `yaml:"pid,omitempty"`
Expand All @@ -53,7 +53,7 @@ type ServiceConfigV1 struct {
Privileged bool `yaml:"privileged,omitempty"`
Restart string `yaml:"restart,omitempty"`
ReadOnly bool `yaml:"read_only,omitempty"`
ShmSize int64 `yaml:"shm_size,omitempty"`
ShmSize yaml.StringorInt `yaml:"shm_size,omitempty"`
StdinOpen bool `yaml:"stdin_open,omitempty"`
SecurityOpt []string `yaml:"security_opt,omitempty"`
Tty bool `yaml:"tty,omitempty"`
Expand Down Expand Up @@ -81,8 +81,8 @@ type ServiceConfig struct {
CapAdd []string `yaml:"cap_add,omitempty"`
CapDrop []string `yaml:"cap_drop,omitempty"`
CPUSet string `yaml:"cpuset,omitempty"`
CPUShares int64 `yaml:"cpu_shares,omitempty"`
CPUQuota int64 `yaml:"cpu_quota,omitempty"`
CPUShares yaml.StringorInt `yaml:"cpu_shares,omitempty"`
CPUQuota yaml.StringorInt `yaml:"cpu_quota,omitempty"`
Command yaml.Command `yaml:"command,flow,omitempty"`
CgroupParent string `yaml:"cgroup_parent,omitempty"`
ContainerName string `yaml:"container_name,omitempty"`
Expand All @@ -105,15 +105,15 @@ type ServiceConfig struct {
Links yaml.MaporColonSlice `yaml:"links,omitempty"`
Logging Log `yaml:"logging,omitempty"`
MacAddress string `yaml:"mac_address,omitempty"`
MemLimit int64 `yaml:"mem_limit,omitempty"`
MemSwapLimit int64 `yaml:"memswap_limit,omitempty"`
MemLimit yaml.StringorInt `yaml:"mem_limit,omitempty"`
MemSwapLimit yaml.StringorInt `yaml:"memswap_limit,omitempty"`
NetworkMode string `yaml:"network_mode,omitempty"`
Networks *yaml.Networks `yaml:"networks,omitempty"`
Pid string `yaml:"pid,omitempty"`
Ports []string `yaml:"ports,omitempty"`
Privileged bool `yaml:"privileged,omitempty"`
SecurityOpt []string `yaml:"security_opt,omitempty"`
ShmSize int64 `yaml:"shm_size,omitempty"`
ShmSize yaml.StringorInt `yaml:"shm_size,omitempty"`
StopSignal string `yaml:"stop_signal,omitempty"`
VolumeDriver string `yaml:"volume_driver,omitempty"`
Volumes []string `yaml:"volumes,omitempty"`
Expand Down
10 changes: 5 additions & 5 deletions docker/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ func Convert(c *config.ServiceConfig, ctx project.Context, clientFactory compose

resources := container.Resources{
CgroupParent: c.CgroupParent,
Memory: c.MemLimit,
MemorySwap: c.MemSwapLimit,
CPUShares: c.CPUShares,
CPUQuota: c.CPUQuota,
Memory: int64(c.MemLimit),
MemorySwap: int64(c.MemSwapLimit),
CPUShares: int64(c.CPUShares),
CPUQuota: int64(c.CPUQuota),
CpusetCpus: c.CPUSet,
Ulimits: ulimits,
Devices: deviceMappings,
Expand Down Expand Up @@ -242,7 +242,7 @@ func Convert(c *config.ServiceConfig, ctx project.Context, clientFactory compose
IpcMode: container.IpcMode(c.Ipc),
PortBindings: portBindings,
RestartPolicy: *restartPolicy,
ShmSize: c.ShmSize,
ShmSize: int64(c.ShmSize),
SecurityOpt: utils.CopySlice(c.SecurityOpt),
VolumeDriver: c.VolumeDriver,
Resources: resources,
Expand Down
4 changes: 2 additions & 2 deletions project/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestParseWithBadContent(t *testing.T) {
t.Fatal("Should have failed parse")
}

if !strings.HasPrefix(err.Error(), "Invalid timestamp: 'garbage'") {
if !strings.Contains(err.Error(), "cannot unmarshal !!str `garbage` into config.Config") {
t.Fatalf("Should have failed parse: %#v", err)
}
}
Expand Down Expand Up @@ -204,5 +204,5 @@ func TestParseWithMultipleComposeFiles(t *testing.T) {
assert.Equal(t, "busybox", multipleConfig.Image)
assert.Equal(t, "multi", multipleConfig.ContainerName)
assert.Equal(t, []string{"8000", "9000", "10000"}, multipleConfig.Ports)
assert.Equal(t, int64(40000000), multipleConfig.MemLimit)
assert.Equal(t, yaml.StringorInt(40000000), multipleConfig.MemLimit)
}
2 changes: 1 addition & 1 deletion script/vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ clone git golang.org/x/crypto 3fbbcd23f1cb824e69491a5930cfeff09b12f4d2 https://g
clone git golang.org/x/net 2beffdc2e92c8a3027590f898fe88f69af48a3f8 https://github.com/tonistiigi/net.git
# clone git golang.org/x/net 47990a1ba55743e6ef1affd3a14e5bac8553615d https://github.com/golang/net.git
clone git gopkg.in/check.v1 11d3bc7aa68e238947792f30573146a3231fc0f1
clone git github.com/cloudfoundry-incubator/candiedyaml 5cef21e2e4f0fd147973b558d4db7395176bcd95
clone git gopkg.in/yaml.v2 e4d366fc3c7938e2958e662b4258c7a89e1f0e3e
clone git github.com/Azure/go-ansiterm 388960b655244e76e24c75f48631564eaefade62
clone git github.com/Microsoft/go-winio v0.3.0
clone git github.com/xeipuuv/gojsonpointer e0fe6f68307607d540ed8eac07a342c33fa1b54a
Expand Down
2 changes: 1 addition & 1 deletion utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/Sirupsen/logrus"

yaml "github.com/cloudfoundry-incubator/candiedyaml"
"gopkg.in/yaml.v2"
)

// InParallel holds a pool and a waitgroup to execute tasks in parallel and to be able
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions vendor/github.com/cloudfoundry-incubator/candiedyaml/.travis.yml

This file was deleted.

176 changes: 0 additions & 176 deletions vendor/github.com/cloudfoundry-incubator/candiedyaml/LICENSE

This file was deleted.

Loading

0 comments on commit 80e2cf9

Please sign in to comment.