Skip to content

Commit

Permalink
chore(Gopkg.toml): bump cnab-go dep; update some usage (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdice authored Oct 8, 2019
1 parent 5eafd3b commit b601e4e
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 71 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

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

4 changes: 2 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[[constraint]]
name = "github.com/deislabs/cnab-go"
version = "v0.5.0-beta1"
version = "v0.6.0-beta1"

[[override]]
name = "github.com/deislabs/cnab-go"
version = "v0.5.0-beta1"
version = "v0.6.0-beta1"


[[constraint]]
Expand Down
17 changes: 2 additions & 15 deletions pkg/cnab/provider/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (d *Runtime) loadParameters(claim *claim.Claim, rawOverrides map[string]str
}

// If this parameter applies to the current action, set the override accordingly
if appliesToAction(action, param) {
if param.AppliesTo(action) {
overrides[key] = value
} else {
// Otherwise, set to current parameter value on the claim, if exists
Expand All @@ -60,7 +60,7 @@ func (d *Runtime) loadParameters(claim *claim.Claim, rawOverrides map[string]str
for name, param := range bun.Parameters {
if param.Required {
if _, exists := rawOverrides[name]; !exists {
if !appliesToAction(action, param) {
if !param.AppliesTo(action) {
overrides[name] = claim.Parameters[name]
}
}
Expand All @@ -83,16 +83,3 @@ func (d *Runtime) getUnconvertedValueFromRaw(def *definition.Schema, key, rawVal
}
return rawValue, nil
}

// TODO: remove in favor of cnab-go logic: https://github.com/deislabs/cnab-go/pull/129
func appliesToAction(action string, parameter bundle.Parameter) bool {
if len(parameter.ApplyTo) == 0 {
return true
}
for _, act := range parameter.ApplyTo {
if action == act {
return true
}
}
return false
}
15 changes: 1 addition & 14 deletions pkg/manifest/runtime-manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (m *RuntimeManifest) buildSourceData() (map[string]interface{}, error) {
continue
}
for name, output := range bun.Outputs {
if !OutputAppliesTo(string(m.Action), output) {
if !output.AppliesTo(string(m.Action)) {
continue
}

Expand Down Expand Up @@ -306,16 +306,3 @@ func (m *RuntimeManifest) Prepare() error {
}
return nil
}

// TODO: remove in favor of cnab-go logic: https://github.com/deislabs/cnab-go/pull/129
func OutputAppliesTo(action string, output bundle.Output) bool {
if len(output.ApplyTo) == 0 {
return true
}
for _, act := range output.ApplyTo {
if action == act {
return true
}
}
return false
}
13 changes: 12 additions & 1 deletion vendor/github.com/deislabs/cnab-go/driver/docker/docker.go

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

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

17 changes: 4 additions & 13 deletions vendor/github.com/deislabs/cnab-go/packager/import.go

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

0 comments on commit b601e4e

Please sign in to comment.