Skip to content

Commit

Permalink
Updated vendor for libcompose and docker/cli
Browse files Browse the repository at this point in the history
To resolve build context issue as mentioned in kubernetes#636
This PR will update vendor for `libcompose` and `docker/cli` and fix small issues from
`pkg/loader/compose/v3.go` which are occuring due to new changes in `docker/cli`
  • Loading branch information
surajnarwade committed Nov 21, 2017
1 parent c7d6bc6 commit 87aab39
Show file tree
Hide file tree
Showing 319 changed files with 27,640 additions and 66,846 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ test-image:
test-container:
docker run -v `pwd`:/opt/tmp/kompose:ro -it $(TEST_IMAGE)

# Update vendoring
# Vendoring is a bit messy right now
.PHONY: vendor-update
vendor-update:
glide update --strip-vendor
glide-vc --only-code --no-tests
find ./vendor/github.com/docker/distribution -type f -exec sed -i 's/Sirupsen/sirupen/g' {} \;


.PHONE: test-k8s
test-k8s:
./script/test_k8s/test.sh
2 changes: 1 addition & 1 deletion cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"os"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package cmd
import (
"strings"

log "github.com/Sirupsen/logrus"
"github.com/kubernetes/kompose/pkg/app"
"github.com/kubernetes/kompose/pkg/kobject"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"os"
"strings"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package cmd

import (
log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"

"github.com/kubernetes/kompose/pkg/app"
"github.com/kubernetes/kompose/pkg/kobject"
Expand Down
48 changes: 25 additions & 23 deletions glide.lock

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

9 changes: 2 additions & 7 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ import:
- package: github.com/sirupsen/logrus
version: 1.0.3

- package: github.com/Sirupsen/logrus
repo: git@github.com:/sirupsen/logrus
vcs: git
version: 1.0.3

- package: github.com/xeipuuv/gojsonschema
version: 93e72a773fade158921402d6a24c819b48aba29d

Expand All @@ -24,15 +19,15 @@ import:

# We use libcompose to parse v1 and v2 of Docker Compose
- package: github.com/docker/libcompose
version: 4a647d664afbe05c41455c9d534d8239671eb46a
version: 57bd716502dcbe1799f026148016022b0f3b989c
subpackages:
- config
- lookup
- project

# We use docker/cli to parse v3 of Docker Compose
- package: github.com/docker/cli
version: 9bdb0763b9e667dc01adf36ba98a2b7bd47bdc75
version: 9b7656cc05d2878c85dc1252f5813f0ad77d808f

# Docker parser library for image names
- package: github.com/novln/docker-parser
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package app
import (
"strings"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

// install kubernetes api
Expand Down
2 changes: 1 addition & 1 deletion pkg/loader/bundle/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (

"k8s.io/kubernetes/pkg/api"

log "github.com/Sirupsen/logrus"
"github.com/fatih/structs"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)

// Bundle is docker bundle file loader, implements Loader interface
Expand Down
2 changes: 1 addition & 1 deletion pkg/loader/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (

yaml "gopkg.in/yaml.v2"

log "github.com/Sirupsen/logrus"
"github.com/docker/libcompose/project"
"github.com/fatih/structs"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)

// Compose is docker compose file loader, implements Loader interface
Expand Down
12 changes: 9 additions & 3 deletions pkg/loader/compose/compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,27 @@ import (
"github.com/kubernetes/kompose/pkg/kobject"
"k8s.io/kubernetes/pkg/api"

"time"

"github.com/docker/cli/cli/compose/types"
"github.com/docker/libcompose/config"
"github.com/docker/libcompose/project"
"github.com/docker/libcompose/yaml"
"github.com/pkg/errors"
)

func durationPtr(value time.Duration) *time.Duration {
return &value
}

func TestParseHealthCheck(t *testing.T) {
helperValue := uint64(2)
check := types.HealthCheckConfig{
Test: []string{"CMD-SHELL", "echo", "foobar"},
Timeout: "1s",
Interval: "2s",
Timeout: durationPtr(1 * time.Second),
Interval: durationPtr(2 * time.Second),
Retries: &helperValue,
StartPeriod: "3s",
StartPeriod: durationPtr(3 * time.Second),
}

// CMD-SHELL or SHELL is included Test within docker/cli, thus we remove the first value in Test
Expand Down
2 changes: 1 addition & 1 deletion pkg/loader/compose/v1v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (

"k8s.io/kubernetes/pkg/api"

log "github.com/Sirupsen/logrus"
"github.com/docker/libcompose/config"
"github.com/docker/libcompose/lookup"
"github.com/docker/libcompose/project"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/kubernetes/kompose/pkg/transformer"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)

// Parse Docker Compose with libcompose (only supports v1 and v2). Eventually we will
Expand Down
14 changes: 7 additions & 7 deletions pkg/loader/compose/v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (

"os"

log "github.com/Sirupsen/logrus"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)

// converts os.Environ() ([]string) to map[string]string
Expand Down Expand Up @@ -171,16 +171,16 @@ func parseHealthCheck(composeHealthCheck types.HealthCheckConfig) (kobject.Healt
var timeout, interval, retries, startPeriod int32

// Here we convert the timeout from 1h30s (example) to 36030 seconds.
if composeHealthCheck.Timeout != "" {
parse, err := time.ParseDuration(composeHealthCheck.Timeout)
if composeHealthCheck.Timeout != nil {
parse, err := time.ParseDuration(composeHealthCheck.Timeout.String())
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check timeout variable")
}
timeout = int32(parse.Seconds())
}

if composeHealthCheck.Interval != "" {
parse, err := time.ParseDuration(composeHealthCheck.Interval)
if composeHealthCheck.Interval != nil {
parse, err := time.ParseDuration(composeHealthCheck.Interval.String())
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check interval variable")
}
Expand All @@ -191,8 +191,8 @@ func parseHealthCheck(composeHealthCheck types.HealthCheckConfig) (kobject.Healt
retries = int32(*composeHealthCheck.Retries)
}

if composeHealthCheck.StartPeriod != "" {
parse, err := time.ParseDuration(composeHealthCheck.StartPeriod)
if composeHealthCheck.StartPeriod != nil {
parse, err := time.ParseDuration(composeHealthCheck.StartPeriod.String())
if err != nil {
return kobject.HealthCheck{}, errors.Wrap(err, "unable to parse health check startPeriod variable")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/transformer/kubernetes/k8sutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (
"text/template"
"time"

log "github.com/Sirupsen/logrus"
"github.com/ghodss/yaml"
"github.com/joho/godotenv"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/kubernetes/kompose/pkg/transformer"
log "github.com/sirupsen/logrus"

"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
Expand Down
2 changes: 1 addition & 1 deletion pkg/transformer/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (
"strconv"
"time"

log "github.com/Sirupsen/logrus"
"github.com/fatih/structs"
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/kubernetes/kompose/pkg/transformer"
buildapi "github.com/openshift/origin/pkg/build/api"
deployapi "github.com/openshift/origin/pkg/deploy/api"
log "github.com/sirupsen/logrus"

// install kubernetes api
_ "k8s.io/kubernetes/pkg/api/install"
Expand Down
2 changes: 1 addition & 1 deletion pkg/transformer/openshift/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/kubernetes/kompose/pkg/kobject"
"github.com/kubernetes/kompose/pkg/transformer/kubernetes"

log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"

kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
Expand Down
Loading

0 comments on commit 87aab39

Please sign in to comment.