Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
Bump cnab-go dep
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyrickard authored and glyn committed Jul 25, 2019
1 parent 7a704f2 commit 90d739c
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 35 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.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

[[constraint]]
name = "github.com/deislabs/cnab-go"
version = "v0.1.2-beta1"
version = "v0.2.0-beta1"

[[override]]
name = "github.com/google/go-containerregistry"
Expand Down
11 changes: 8 additions & 3 deletions cmd/duffle/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ func (i *installCmd) run() error {
}

c.Bundle = bun
c.Parameters, err = calculateParamValues(bun, i.valuesFile, i.setParams, i.setFiles)
// calculateParamValues determines if values can be changed in later actions, but we don't have
// previous values so install passes nil.
c.Parameters, err = calculateParamValues(bun, i.valuesFile, i.setParams, i.setFiles, nil)
if err != nil {
return err
}
Expand Down Expand Up @@ -221,7 +223,10 @@ func parseValues(file string) (map[string]interface{}, error) {
return v.AllSettings(), nil
}

func calculateParamValues(bun *bundle.Bundle, valuesFile string, setParams, setFilePaths []string) (map[string]interface{}, error) {
func calculateParamValues(bun *bundle.Bundle, valuesFile string, setParams, setFilePaths []string, prevVals map[string]interface{}) (map[string]interface{}, error) {
if prevVals == nil {
prevVals = map[string]interface{}{}
}
vals := map[string]interface{}{}
if valuesFile != "" {
var err error
Expand Down Expand Up @@ -261,5 +266,5 @@ func calculateParamValues(bun *bundle.Bundle, valuesFile string, setParams, setF
vals[parts[0]] = string(content)
}

return bundle.ValuesOrDefaults(vals, bun)
return bundle.ValuesOrDefaults(vals, prevVals, bun)
}
2 changes: 1 addition & 1 deletion cmd/duffle/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Credentials and parameters may be passed to the bundle during a target action.

// Override parameters only if some are set.
if valuesFile != "" || len(setParams) > 0 {
c.Parameters, err = calculateParamValues(c.Bundle, valuesFile, setParams, setFiles)
c.Parameters, err = calculateParamValues(c.Bundle, valuesFile, setParams, setFiles, c.Parameters)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/duffle/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (un *uninstallCmd) run() error {
if claim.Bundle == nil {
return errors.New("parameters can only be set if a bundle is provided")
}
params, err := calculateParamValues(claim.Bundle, un.valuesFile, un.setParams, []string{})
params, err := calculateParamValues(claim.Bundle, un.valuesFile, un.setParams, []string{}, claim.Parameters)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/duffle/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (up *upgradeCmd) run() error {

// Override parameters only if some are set.
if up.valuesFile != "" || len(up.setParams) > 0 {
claim.Parameters, err = calculateParamValues(claim.Bundle, up.valuesFile, up.setParams, up.setFiles)
claim.Parameters, err = calculateParamValues(claim.Bundle, up.valuesFile, up.setParams, up.setFiles, claim.Parameters)
if err != nil {
return err
}
Expand Down
5 changes: 5 additions & 0 deletions vendor/github.com/deislabs/cnab-go/action/action.go

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

38 changes: 23 additions & 15 deletions vendor/github.com/deislabs/cnab-go/bundle/bundle.go

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

1 change: 1 addition & 0 deletions vendor/github.com/deislabs/cnab-go/bundle/parameters.go

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

22 changes: 13 additions & 9 deletions vendor/github.com/deislabs/cnab-go/claim/claim.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/deislabs/cnab-go/driver/driver.go

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

0 comments on commit 90d739c

Please sign in to comment.