From 0f3888496fb0240643b1b92b78042c43e37fbcfb Mon Sep 17 00:00:00 2001 From: Vaughn Dice Date: Sat, 10 Aug 2019 10:03:37 -0600 Subject: [PATCH] ref(pkg/driver): remove pkg/driver; use cnab-go for needed logic --- Gopkg.lock | 11 +++++------ Gopkg.toml | 2 +- cmd/duffle/main.go | 4 ++-- vendor/github.com/deislabs/cnab-go/bundle/bundle.go | 2 +- .../deislabs/cnab-go/driver/lookup}/lookup.go | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) rename {pkg/driver => vendor/github.com/deislabs/cnab-go/driver/lookup}/lookup.go (97%) diff --git a/Gopkg.lock b/Gopkg.lock index bb951427..8e025e06 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -200,7 +200,7 @@ version = "v1.1.1" [[projects]] - digest = "1:e6b1ef832f13f503f6496d923b9f918d5475b004424ca589558afae541dc0a17" + digest = "1:a4beb7595ff1fbcfae4d7b2176d58d98d94b066152664edd26d4de9818694482" name = "github.com/deislabs/cnab-go" packages = [ "action", @@ -212,11 +212,12 @@ "driver/command", "driver/docker", "driver/kubernetes", + "driver/lookup", "utils/crud", ] pruneopts = "NUT" - revision = "c992a169ba13fb2f36857dbddfb45e6790400758" - version = "v0.3.0-beta1" + revision = "1ef7d96a46de6e4205de8eedd80e3cf387fef72b" + version = "v0.3.1-beta1" [[projects]] digest = "1:7a6852b35eb5bbc184561443762d225116ae630c26a7c4d90546619f1e7d2ad2" @@ -1247,9 +1248,7 @@ "github.com/deislabs/cnab-go/claim", "github.com/deislabs/cnab-go/credentials", "github.com/deislabs/cnab-go/driver", - "github.com/deislabs/cnab-go/driver/command", - "github.com/deislabs/cnab-go/driver/docker", - "github.com/deislabs/cnab-go/driver/kubernetes", + "github.com/deislabs/cnab-go/driver/lookup", "github.com/deislabs/cnab-go/utils/crud", "github.com/docker/cli/cli/command", "github.com/docker/cli/cli/command/image/build", diff --git a/Gopkg.toml b/Gopkg.toml index 3e077884..44597cfa 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -57,7 +57,7 @@ [[constraint]] name = "github.com/deislabs/cnab-go" - version = "v0.3.0-beta1" + version = "v0.3.1-beta1" [[override]] name = "github.com/google/go-containerregistry" diff --git a/cmd/duffle/main.go b/cmd/duffle/main.go index 6f4a1344..7676eae6 100644 --- a/cmd/duffle/main.go +++ b/cmd/duffle/main.go @@ -9,7 +9,6 @@ import ( "runtime" "strings" - duffleDriver "github.com/deislabs/duffle/pkg/driver" "github.com/deislabs/duffle/pkg/duffle/home" "github.com/deislabs/duffle/pkg/loader" "github.com/deislabs/duffle/pkg/reference" @@ -18,6 +17,7 @@ import ( "github.com/deislabs/cnab-go/claim" "github.com/deislabs/cnab-go/credentials" "github.com/deislabs/cnab-go/driver" + "github.com/deislabs/cnab-go/driver/lookup" "github.com/deislabs/cnab-go/utils/crud" "github.com/spf13/cobra" ) @@ -112,7 +112,7 @@ func must(err error) { // prepareDriver prepares a driver per the user's request. func prepareDriver(driverName string, relMap string) (driver.Driver, error) { - driverImpl, err := duffleDriver.Lookup(driverName) + driverImpl, err := lookup.Lookup(driverName) if err != nil { return nil, err } diff --git a/vendor/github.com/deislabs/cnab-go/bundle/bundle.go b/vendor/github.com/deislabs/cnab-go/bundle/bundle.go index 3c2568a7..efcf7bbc 100644 --- a/vendor/github.com/deislabs/cnab-go/bundle/bundle.go +++ b/vendor/github.com/deislabs/cnab-go/bundle/bundle.go @@ -81,7 +81,7 @@ type LocationRef struct { type BaseImage struct { ImageType string `json:"imageType" yaml:"imageType"` Image string `json:"image" yaml:"image"` - Digest string `json:"contentDigest,omitempty" yaml:"contentDigest"` + Digest string `json:"contentDigest,omitempty" yaml:"contentDigest,omitempty"` Size uint64 `json:"size,omitempty" yaml:"size,omitempty"` Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` MediaType string `json:"mediaType,omitempty" yaml:"mediaType,omitempty"` diff --git a/pkg/driver/lookup.go b/vendor/github.com/deislabs/cnab-go/driver/lookup/lookup.go similarity index 97% rename from pkg/driver/lookup.go rename to vendor/github.com/deislabs/cnab-go/driver/lookup/lookup.go index bd05c207..e0d6f212 100644 --- a/pkg/driver/lookup.go +++ b/vendor/github.com/deislabs/cnab-go/driver/lookup/lookup.go @@ -1,4 +1,4 @@ -package driver +package lookup import ( "fmt"