Skip to content

Commit

Permalink
Merge pull request #115 from ecordell/fix-to-option
Browse files Browse the repository at this point in the history
fix(builder): Add AppRegistry org to `ToOption`
  • Loading branch information
openshift-merge-robot authored Nov 1, 2019
2 parents 17dd631 + bf49c9b commit 755df4f
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions pkg/appregistry/builder_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,21 @@ func (o *AppregistryBuildOptions) Complete() error {

// build a separate path for manifests and the built database, so that
// building is idempotent
manifestDir, err := ioutil.TempDir("", "manifests-")
if err != nil {
return err
if o.ManifestDir == "" {
manifestDir, err := ioutil.TempDir("", "manifests-")
if err != nil {
return err
}
o.ManifestDir = manifestDir
}
o.ManifestDir = manifestDir
databaseDir, err := ioutil.TempDir("", "db-")
if err != nil {
return err

if o.DatabaseDir == "" {
databaseDir, err := ioutil.TempDir("", "db-")
if err != nil {
return err
}
o.DatabaseDir = databaseDir
}
o.DatabaseDir = databaseDir

if o.DatabasePath == "" {
o.DatabasePath = path.Join(o.DatabaseDir, "bundles.db")
Expand Down Expand Up @@ -96,6 +101,9 @@ func (c *AppregistryBuildOptions) ToOption() AppregistryBuildOption {
if c.AuthToken != "" {
o.AuthToken = c.AuthToken
}
if c.AppRegistryOrg != "" {
o.AppRegistryOrg = c.AppRegistryOrg
}
if c.AppRegistryEndpoint != "" {
o.AppRegistryEndpoint = c.AppRegistryEndpoint
}
Expand All @@ -105,6 +113,9 @@ func (c *AppregistryBuildOptions) ToOption() AppregistryBuildOption {
if c.CacheDir != "" {
o.CacheDir = c.CacheDir
}
if c.DatabaseDir != "" {
o.DatabaseDir = c.DatabaseDir
}
}
}

Expand Down

0 comments on commit 755df4f

Please sign in to comment.