From fdb2f445045b7092bab5dff739952ebf5249dab6 Mon Sep 17 00:00:00 2001 From: Carolyn Van Slyck Date: Thu, 26 Sep 2019 14:34:11 -0500 Subject: [PATCH 1/2] Rename cnabprovider from duffle to runtime We don't rely on duffle anymore, it's all cnab-go to handle the runtime, so I've renamed it to Runtime to help clarify what the struct really does. --- pkg/cnab/provider/action.go | 6 +++--- pkg/cnab/provider/bundle.go | 2 +- pkg/cnab/provider/claims.go | 4 ++-- pkg/cnab/provider/credentials.go | 4 ++-- pkg/cnab/provider/dockerdriver_test.go | 4 ++-- pkg/cnab/provider/install.go | 2 +- pkg/cnab/provider/invoke.go | 2 +- pkg/cnab/provider/parameters.go | 4 ++-- pkg/cnab/provider/parameters_test.go | 12 ++++++------ pkg/cnab/provider/{duffle.go => runtime.go} | 12 ++++++------ pkg/cnab/provider/uninstall.go | 2 +- pkg/cnab/provider/upgrade.go | 2 +- pkg/porter/dependencies.go | 2 +- pkg/porter/helpers.go | 2 +- pkg/porter/install.go | 2 +- pkg/porter/invoke.go | 2 +- pkg/porter/lifecycle.go | 5 ++--- pkg/porter/list.go | 2 +- pkg/porter/porter.go | 2 +- pkg/porter/uninstall.go | 2 +- pkg/porter/upgrade.go | 2 +- 21 files changed, 38 insertions(+), 39 deletions(-) rename pkg/cnab/provider/{duffle.go => runtime.go} (87%) diff --git a/pkg/cnab/provider/action.go b/pkg/cnab/provider/action.go index 370529d8a..51fd2d38d 100644 --- a/pkg/cnab/provider/action.go +++ b/pkg/cnab/provider/action.go @@ -30,21 +30,21 @@ type ActionArguments struct { Driver string } -func (d *Duffle) ApplyConfig(args ActionArguments) action.OperationConfigs { +func (d *Runtime) ApplyConfig(args ActionArguments) action.OperationConfigs { return action.OperationConfigs{ d.SetOutput(), d.AddFiles(args), } } -func (d *Duffle) SetOutput() action.OperationConfigFunc { +func (d *Runtime) SetOutput() action.OperationConfigFunc { return func(op *driver.Operation) error { op.Out = d.Out return nil } } -func (d *Duffle) AddFiles(args ActionArguments) action.OperationConfigFunc { +func (d *Runtime) AddFiles(args ActionArguments) action.OperationConfigFunc { return func(op *driver.Operation) error { for k, v := range args.Files { op.Files[k] = v diff --git a/pkg/cnab/provider/bundle.go b/pkg/cnab/provider/bundle.go index 237fc6c19..6ed35fca7 100644 --- a/pkg/cnab/provider/bundle.go +++ b/pkg/cnab/provider/bundle.go @@ -9,7 +9,7 @@ import ( // TODO: Export everything in this file from duffle cmd/duffle/pull.go var ErrNotSigned = errors.New("bundle is not signed") -func (d *Duffle) LoadBundle(bundleFile string, insecure bool) (*bundle.Bundle, error) { +func (d *Runtime) LoadBundle(bundleFile string, insecure bool) (*bundle.Bundle, error) { // TODO: once we support secure bundles we need more logic here (it's in duffle but I didn't copy it) // I'm hoping we've gotten this code exported from duffle by then though if !insecure { diff --git a/pkg/cnab/provider/claims.go b/pkg/cnab/provider/claims.go index d8e90f60b..9a92319e6 100644 --- a/pkg/cnab/provider/claims.go +++ b/pkg/cnab/provider/claims.go @@ -11,7 +11,7 @@ const ( ClaimsDirectory = "claims" ) -func (d *Duffle) NewClaimStore() (claim.Store, error) { +func (d *Runtime) NewClaimStore() (claim.Store, error) { claimsPath, err := d.Config.GetClaimsDir() if err != nil { return claim.Store{}, errors.Wrap(err, "could not get path to the claims directory") @@ -20,7 +20,7 @@ func (d *Duffle) NewClaimStore() (claim.Store, error) { } // FetchClaim fetches a claim from the given CNABProvider's claim store -func (d *Duffle) FetchClaim(name string) (*claim.Claim, error) { +func (d *Runtime) FetchClaim(name string) (*claim.Claim, error) { claimStore, err := d.NewClaimStore() if err != nil { return nil, errors.Wrapf(err, "could not retrieve bundle instance %s", name) diff --git a/pkg/cnab/provider/credentials.go b/pkg/cnab/provider/credentials.go index 97deb563d..1ce8c4ac1 100644 --- a/pkg/cnab/provider/credentials.go +++ b/pkg/cnab/provider/credentials.go @@ -13,7 +13,7 @@ const ( CredentialsDirectory = "credentials" ) -func (d *Duffle) loadCredentials(b *bundle.Bundle, files []string) (map[string]string, error) { +func (d *Runtime) loadCredentials(b *bundle.Bundle, files []string) (map[string]string, error) { // TODO: export back outta Compton creds := map[string]string{} @@ -51,7 +51,7 @@ func (d *Duffle) loadCredentials(b *bundle.Bundle, files []string) (map[string]s } // isPathy checks to see if a name looks like a path. -func (d *Duffle) isPathy(name string) bool { +func (d *Runtime) isPathy(name string) bool { // TODO: export back outta Compton return strings.Contains(name, string(filepath.Separator)) diff --git a/pkg/cnab/provider/dockerdriver_test.go b/pkg/cnab/provider/dockerdriver_test.go index 271539371..633c47d6d 100644 --- a/pkg/cnab/provider/dockerdriver_test.go +++ b/pkg/cnab/provider/dockerdriver_test.go @@ -15,7 +15,7 @@ import ( func TestNewDriver_Docker(t *testing.T) { c := config.NewTestConfig(t) - d := NewDuffle(c.Config) + d := NewRuntime(c.Config) driver, err := d.newDriver("docker", "myclaim", ActionArguments{}) require.NoError(t, err) @@ -30,7 +30,7 @@ func TestNewDriver_Docker(t *testing.T) { func TestWriteClaimOutputs(t *testing.T) { c := config.NewTestConfig(t) - d := NewDuffle(c.Config) + d := NewRuntime(c.Config) homeDir, err := c.GetHomeDir() require.NoError(t, err) diff --git a/pkg/cnab/provider/install.go b/pkg/cnab/provider/install.go index 2be5e3cb6..705d47c7c 100644 --- a/pkg/cnab/provider/install.go +++ b/pkg/cnab/provider/install.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" ) -func (d *Duffle) Install(args ActionArguments) error { +func (d *Runtime) Install(args ActionArguments) error { // TODO: this entire function should be exposed in a duffle sdk package e.g. duffle.Install // we shouldn't be reimplementing calling all these functions all over again diff --git a/pkg/cnab/provider/invoke.go b/pkg/cnab/provider/invoke.go index 2cfb6f1b9..021bd2082 100644 --- a/pkg/cnab/provider/invoke.go +++ b/pkg/cnab/provider/invoke.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" ) -func (d *Duffle) Invoke(action string, args ActionArguments) error { +func (d *Runtime) Invoke(action string, args ActionArguments) error { claims, err := d.NewClaimStore() if err != nil { return errors.Wrapf(err, "could not access claim store") diff --git a/pkg/cnab/provider/parameters.go b/pkg/cnab/provider/parameters.go index 0a5f72f52..2d26d940f 100644 --- a/pkg/cnab/provider/parameters.go +++ b/pkg/cnab/provider/parameters.go @@ -12,7 +12,7 @@ import ( // loadParameters accepts a set of string overrides and combines that with the default parameters to create // a full set of parameters. -func (d *Duffle) loadParameters(claim *claim.Claim, rawOverrides map[string]string, action string) (map[string]interface{}, error) { +func (d *Runtime) loadParameters(claim *claim.Claim, rawOverrides map[string]string, action string) (map[string]interface{}, error) { overrides := make(map[string]interface{}, len(rawOverrides)) bun := claim.Bundle @@ -70,7 +70,7 @@ func (d *Duffle) loadParameters(claim *claim.Claim, rawOverrides map[string]stri return bundle.ValuesOrDefaults(overrides, bun) } -func (d *Duffle) getUnconvertedValueFromRaw(def *definition.Schema, key, rawValue string) (string, error) { +func (d *Runtime) getUnconvertedValueFromRaw(def *definition.Schema, key, rawValue string) (string, error) { // the parameter value (via rawValue) may represent a file on the local filesystem if def.Type == "string" && def.ContentEncoding == "base64" { if _, err := d.FileSystem.Stat(rawValue); err == nil { diff --git a/pkg/cnab/provider/parameters_test.go b/pkg/cnab/provider/parameters_test.go index 95c3db2d9..4f9c25ab0 100644 --- a/pkg/cnab/provider/parameters_test.go +++ b/pkg/cnab/provider/parameters_test.go @@ -15,7 +15,7 @@ import ( func Test_loadParameters_paramNotDefined(t *testing.T) { c := config.NewTestConfig(t) - d := NewDuffle(c.Config) + d := NewRuntime(c.Config) claim, err := claim.New("test") require.NoError(t, err) @@ -34,7 +34,7 @@ func Test_loadParameters_paramNotDefined(t *testing.T) { func Test_loadParameters_definitionNotDefined(t *testing.T) { c := config.NewTestConfig(t) - d := NewDuffle(c.Config) + d := NewRuntime(c.Config) claim, err := claim.New("test") require.NoError(t, err) @@ -57,7 +57,7 @@ func Test_loadParameters_definitionNotDefined(t *testing.T) { func Test_loadParameters_applyToClaimDefaults(t *testing.T) { c := config.NewTestConfig(t) - d := NewDuffle(c.Config) + d := NewRuntime(c.Config) claim, err := claim.New("test") require.NoError(t, err) @@ -120,7 +120,7 @@ func Test_loadParameters_applyToClaimDefaults(t *testing.T) { func Test_loadParameters_applyToBundleDefaults(t *testing.T) { c := config.NewTestConfig(t) - d := NewDuffle(c.Config) + d := NewRuntime(c.Config) claim, err := claim.New("test") require.NoError(t, err) @@ -156,7 +156,7 @@ func Test_loadParameters_applyToBundleDefaults(t *testing.T) { func Test_loadParameters_requiredButDoesNotApply(t *testing.T) { c := config.NewTestConfig(t) - d := NewDuffle(c.Config) + d := NewRuntime(c.Config) claim, err := claim.New("test") require.NoError(t, err) @@ -192,7 +192,7 @@ func Test_loadParameters_requiredButDoesNotApply(t *testing.T) { func Test_loadParameters_fileParameter(t *testing.T) { c := config.NewTestConfig(t) - d := NewDuffle(c.Config) + d := NewRuntime(c.Config) c.TestContext.AddTestFile("testdata/file-param", "/path/to/file") diff --git a/pkg/cnab/provider/duffle.go b/pkg/cnab/provider/runtime.go similarity index 87% rename from pkg/cnab/provider/duffle.go rename to pkg/cnab/provider/runtime.go index 1c6bb6201..d81ab5fe9 100644 --- a/pkg/cnab/provider/duffle.go +++ b/pkg/cnab/provider/runtime.go @@ -14,17 +14,17 @@ import ( "github.com/pkg/errors" ) -type Duffle struct { +type Runtime struct { *config.Config } -func NewDuffle(c *config.Config) *Duffle { - return &Duffle{ +func NewRuntime(c *config.Config) *Runtime { + return &Runtime{ Config: c, } } -func (d *Duffle) newDriver(driverName string, claimName string, args ActionArguments) (driver.Driver, error) { +func (d *Runtime) newDriver(driverName string, claimName string, args ActionArguments) (driver.Driver, error) { driverImpl, err := lookup.Lookup(driverName) if err != nil { return driverImpl, err @@ -51,7 +51,7 @@ func (d *Duffle) newDriver(driverName string, claimName string, args ActionArgum return driverImpl, err } -func (d *Duffle) setupOutputsMount(driverImpl driver.Driver, claimName string) error { +func (d *Runtime) setupOutputsMount(driverImpl driver.Driver, claimName string) error { // If docker driver, setup host bind mount for outputs if dockerish, ok := driverImpl.(*docker.Driver); ok { outputsDir, err := d.Config.GetOutputsDir() @@ -82,7 +82,7 @@ func (d *Duffle) setupOutputsMount(driverImpl driver.Driver, claimName string) e // WriteClaimOutputs writes outputs to a claim, according to the provided bundle // and Duffle config -func (d *Duffle) WriteClaimOutputs(c *claim.Claim, action string) error { +func (d *Runtime) WriteClaimOutputs(c *claim.Claim, action string) error { if c.Bundle == nil { return errors.New("bundle instance has no bundle set") } diff --git a/pkg/cnab/provider/uninstall.go b/pkg/cnab/provider/uninstall.go index 69109ca9c..fa0a3c994 100644 --- a/pkg/cnab/provider/uninstall.go +++ b/pkg/cnab/provider/uninstall.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" ) -func (d *Duffle) Uninstall(args ActionArguments) error { +func (d *Runtime) Uninstall(args ActionArguments) error { // TODO: this entire function should be exposed in a duffle sdk package e.g. duffle.Install // we shouldn't be reimplementing calling all these functions all over again diff --git a/pkg/cnab/provider/upgrade.go b/pkg/cnab/provider/upgrade.go index c34038f4f..d1b1b3a5f 100644 --- a/pkg/cnab/provider/upgrade.go +++ b/pkg/cnab/provider/upgrade.go @@ -9,7 +9,7 @@ import ( "github.com/deislabs/porter/pkg/config" ) -func (d *Duffle) Upgrade(args ActionArguments) error { +func (d *Runtime) Upgrade(args ActionArguments) error { // TODO: this entire function should be exposed in a duffle sdk package e.g. duffle.Upgrade // we shouldn't be reimplementing calling all these functions all over again diff --git a/pkg/porter/dependencies.go b/pkg/porter/dependencies.go index 852bb995f..d1c900620 100644 --- a/pkg/porter/dependencies.go +++ b/pkg/porter/dependencies.go @@ -78,7 +78,7 @@ func (e *dependencyExecutioner) Execute() error { } // executeDependency the requested action against all of the dependencies - parentArgs := e.parentOpts.ToDuffleArgs(e) + parentArgs := e.parentOpts.ToActionArgs(e) for _, dep := range e.deps { err := e.executeDependency(dep, parentArgs) if err != nil { diff --git a/pkg/porter/helpers.go b/pkg/porter/helpers.go index c6c269243..1420d9bcd 100644 --- a/pkg/porter/helpers.go +++ b/pkg/porter/helpers.go @@ -38,7 +38,7 @@ func NewTestPorter(t *testing.T) *TestPorter { tc := config.NewTestConfig(t) p := New() p.Config = tc.Config - p.CNAB = cnabprovider.NewDuffle(tc.Config) + p.CNAB = cnabprovider.NewRuntime(tc.Config) p.Mixins = &mixin.TestMixinProvider{} p.Cache = cache.New(tc.Config) p.Builder = NewTestBuildProvider() diff --git a/pkg/porter/install.go b/pkg/porter/install.go index c4b673519..689febaaa 100644 --- a/pkg/porter/install.go +++ b/pkg/porter/install.go @@ -42,5 +42,5 @@ func (p *Porter) InstallBundle(opts InstallOptions) error { } fmt.Fprintf(p.Out, "installing %s...\n", opts.Name) - return p.CNAB.Install(opts.ToDuffleArgs(deperator)) + return p.CNAB.Install(opts.ToActionArgs(deperator)) } diff --git a/pkg/porter/invoke.go b/pkg/porter/invoke.go index e18ae179b..a39a537bb 100644 --- a/pkg/porter/invoke.go +++ b/pkg/porter/invoke.go @@ -56,5 +56,5 @@ func (p *Porter) InvokeBundle(opts InvokeOptions) error { } fmt.Fprintf(p.Out, "invoking custom action %s on %s...\n", opts.Action, opts.Name) - return p.CNAB.Invoke(opts.Action, opts.ToDuffleArgs(deperator)) + return p.CNAB.Invoke(opts.Action, opts.ToActionArgs(deperator)) } diff --git a/pkg/porter/lifecycle.go b/pkg/porter/lifecycle.go index d890cea05..9bb203aff 100644 --- a/pkg/porter/lifecycle.go +++ b/pkg/porter/lifecycle.go @@ -27,9 +27,8 @@ func (o *BundleLifecycleOpts) Validate(args []string, cxt *context.Context) erro return nil } -// ToDuffleArgs converts this instance of user-provided action options -// to duffle action arguments. -func (o *BundleLifecycleOpts) ToDuffleArgs(deperator *dependencyExecutioner) cnabprovider.ActionArguments { +// ToActionArgs converts this instance of user-provided action options. +func (o *BundleLifecycleOpts) ToActionArgs(deperator *dependencyExecutioner) cnabprovider.ActionArguments { args := cnabprovider.ActionArguments{ Claim: o.Name, BundlePath: o.CNABFile, diff --git a/pkg/porter/list.go b/pkg/porter/list.go index 36398ea88..2d08d0385 100644 --- a/pkg/porter/list.go +++ b/pkg/porter/list.go @@ -39,7 +39,7 @@ func (l CondensedClaimList) Less(i, j int) bool { // ListInstances lists installed bundles by their claims. func (p *Porter) ListInstances(opts ListOptions) error { - cp := cnab.NewDuffle(p.Config) + cp := cnab.NewRuntime(p.Config) claimStore, err := cp.NewClaimStore() if err != nil { return errors.Wrapf(err, "could not access claim store") diff --git a/pkg/porter/porter.go b/pkg/porter/porter.go index 6a8f48a53..90f1ef479 100644 --- a/pkg/porter/porter.go +++ b/pkg/porter/porter.go @@ -35,6 +35,6 @@ func New() *Porter { Templates: templates.NewTemplates(), Builder: buildprovider.NewDockerBuilder(c), Mixins: mixinprovider.NewFileSystem(c), - CNAB: cnabprovider.NewDuffle(c), + CNAB: cnabprovider.NewRuntime(c), } } diff --git a/pkg/porter/uninstall.go b/pkg/porter/uninstall.go index 372b65f83..f514e7772 100644 --- a/pkg/porter/uninstall.go +++ b/pkg/porter/uninstall.go @@ -37,7 +37,7 @@ func (p *Porter) UninstallBundle(opts UninstallOptions) error { } fmt.Fprintf(p.Out, "uninstalling %s...\n", opts.Name) - err = p.CNAB.Uninstall(opts.ToDuffleArgs(deperator)) + err = p.CNAB.Uninstall(opts.ToActionArgs(deperator)) if err != nil { if len(deperator.deps) > 0 { return errors.Wrapf(err, "failed to uninstall the %s bundle, the remaining dependencies were not uninstalled", opts.Name) diff --git a/pkg/porter/upgrade.go b/pkg/porter/upgrade.go index d42c654c2..3aebb2687 100644 --- a/pkg/porter/upgrade.go +++ b/pkg/porter/upgrade.go @@ -42,5 +42,5 @@ func (p *Porter) UpgradeBundle(opts UpgradeOptions) error { } fmt.Fprintf(p.Out, "upgrading %s...\n", opts.Name) - return p.CNAB.Upgrade(opts.ToDuffleArgs(deperator)) + return p.CNAB.Upgrade(opts.ToActionArgs(deperator)) } From daf0ba561f190b7b2c831fed6b6ec07660ebd05d Mon Sep 17 00:00:00 2001 From: Carolyn Van Slyck Date: Thu, 26 Sep 2019 15:44:54 -0500 Subject: [PATCH 2/2] Update comments to not refer to duffle We don't use duffle anymore so be more clear about what's going on, or remove outdated comments entirely --- Gopkg.toml | 2 +- pkg/cnab/provider/action.go | 2 +- pkg/cnab/provider/bundle.go | 3 --- pkg/cnab/provider/credentials.go | 2 -- pkg/cnab/provider/install.go | 3 --- pkg/cnab/provider/runtime.go | 3 +-- pkg/cnab/provider/uninstall.go | 3 --- pkg/cnab/provider/upgrade.go | 3 --- pkg/porter/cnab.go | 2 +- pkg/porter/lifecycle.go | 2 +- 10 files changed, 5 insertions(+), 20 deletions(-) diff --git a/Gopkg.toml b/Gopkg.toml index 68b61f745..a8ce0c055 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -19,7 +19,7 @@ # # SEMVER IS DEAD, LONG LIVE SEMVER -# Use a very specific version of docker and its libraries because they aren't contained in a release yet, but duffle uses some unreleased feature/code ¯\_(ツ)_/¯ +# Use a very specific version of docker and its libraries because they aren't contained in a release yet, but cnab-go references some unreleased feature/code ¯\_(ツ)_/¯ # [[constraint]] name = "github.com/docker/cli" diff --git a/pkg/cnab/provider/action.go b/pkg/cnab/provider/action.go index 51fd2d38d..63ee3ea7a 100644 --- a/pkg/cnab/provider/action.go +++ b/pkg/cnab/provider/action.go @@ -5,7 +5,7 @@ import ( "github.com/deislabs/cnab-go/driver" ) -// Shared arguments for all CNAB actions supported by duffle +// Shared arguments for all CNAB actions type ActionArguments struct { // Name of the instance. Claim string diff --git a/pkg/cnab/provider/bundle.go b/pkg/cnab/provider/bundle.go index 6ed35fca7..c707344a6 100644 --- a/pkg/cnab/provider/bundle.go +++ b/pkg/cnab/provider/bundle.go @@ -6,12 +6,9 @@ import ( "github.com/pkg/errors" ) -// TODO: Export everything in this file from duffle cmd/duffle/pull.go var ErrNotSigned = errors.New("bundle is not signed") func (d *Runtime) LoadBundle(bundleFile string, insecure bool) (*bundle.Bundle, error) { - // TODO: once we support secure bundles we need more logic here (it's in duffle but I didn't copy it) - // I'm hoping we've gotten this code exported from duffle by then though if !insecure { return nil, errors.New("secure bundles not implemented") } diff --git a/pkg/cnab/provider/credentials.go b/pkg/cnab/provider/credentials.go index 1ce8c4ac1..1aac94aab 100644 --- a/pkg/cnab/provider/credentials.go +++ b/pkg/cnab/provider/credentials.go @@ -26,8 +26,6 @@ func (d *Runtime) loadCredentials(b *bundle.Bundle, files []string) (map[string] // in which they were supplied on the CLI. for _, file := range files { if !d.isPathy(file) { - // TODO: when we export this function, having an instance where we can set home manually - // instead of on an env var would be super helpful. I had to inject the homepath instead of using duffle's homepath function. credsPath, err := d.Config.GetCredentialsDir() if err != nil { return nil, err diff --git a/pkg/cnab/provider/install.go b/pkg/cnab/provider/install.go index 705d47c7c..fa4f61401 100644 --- a/pkg/cnab/provider/install.go +++ b/pkg/cnab/provider/install.go @@ -10,9 +10,6 @@ import ( ) func (d *Runtime) Install(args ActionArguments) error { - // TODO: this entire function should be exposed in a duffle sdk package e.g. duffle.Install - // we shouldn't be reimplementing calling all these functions all over again - c, err := claim.New(args.Claim) if err != nil { return errors.Wrap(err, "invalid bundle instance name") diff --git a/pkg/cnab/provider/runtime.go b/pkg/cnab/provider/runtime.go index d81ab5fe9..a8f0f59b0 100644 --- a/pkg/cnab/provider/runtime.go +++ b/pkg/cnab/provider/runtime.go @@ -80,8 +80,7 @@ func (d *Runtime) setupOutputsMount(driverImpl driver.Driver, claimName string) return nil } -// WriteClaimOutputs writes outputs to a claim, according to the provided bundle -// and Duffle config +// WriteClaimOutputs writes outputs to a claim, according to the provided bundle config. func (d *Runtime) WriteClaimOutputs(c *claim.Claim, action string) error { if c.Bundle == nil { return errors.New("bundle instance has no bundle set") diff --git a/pkg/cnab/provider/uninstall.go b/pkg/cnab/provider/uninstall.go index fa0a3c994..769d3415f 100644 --- a/pkg/cnab/provider/uninstall.go +++ b/pkg/cnab/provider/uninstall.go @@ -10,9 +10,6 @@ import ( ) func (d *Runtime) Uninstall(args ActionArguments) error { - // TODO: this entire function should be exposed in a duffle sdk package e.g. duffle.Install - // we shouldn't be reimplementing calling all these functions all over again - claims, err := d.NewClaimStore() if err != nil { return errors.Wrapf(err, "could not access claim store") diff --git a/pkg/cnab/provider/upgrade.go b/pkg/cnab/provider/upgrade.go index d1b1b3a5f..8a30629b0 100644 --- a/pkg/cnab/provider/upgrade.go +++ b/pkg/cnab/provider/upgrade.go @@ -10,9 +10,6 @@ import ( ) func (d *Runtime) Upgrade(args ActionArguments) error { - // TODO: this entire function should be exposed in a duffle sdk package e.g. duffle.Upgrade - // we shouldn't be reimplementing calling all these functions all over again - claims, err := d.NewClaimStore() if err != nil { return errors.Wrapf(err, "could not access claim store") diff --git a/pkg/porter/cnab.go b/pkg/porter/cnab.go index fe88cd82e..bf980222f 100644 --- a/pkg/porter/cnab.go +++ b/pkg/porter/cnab.go @@ -186,7 +186,7 @@ func (o *bundleFileOptions) validateCNABFile(cxt *context.Context) error { originalPath := o.CNABFile if !filepath.IsAbs(o.CNABFile) { - // Convert to an absolute filepath because duffle needs it that way + // Convert to an absolute filepath because runtime needs it that way pwd, err := os.Getwd() if err != nil { return errors.Wrap(err, "could not get current working directory") diff --git a/pkg/porter/lifecycle.go b/pkg/porter/lifecycle.go index 9bb203aff..16a59d839 100644 --- a/pkg/porter/lifecycle.go +++ b/pkg/porter/lifecycle.go @@ -38,7 +38,7 @@ func (o *BundleLifecycleOpts) ToActionArgs(deperator *dependencyExecutioner) cna Driver: o.Driver, } - // Do a safe copy so that modifications to the duffle args aren't also made to the + // Do a safe copy so that modifications to the args aren't also made to the // original options, which is confusing to debug for k, v := range o.combinedParameters { args.Params[k] = v