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

Commit

Permalink
Merge pull request #90 from yukinying/online-offline
Browse files Browse the repository at this point in the history
add cfg.LoadAndValidate back
  • Loading branch information
morgante committed Nov 5, 2019
2 parents 1fe01ae + 1ce320d commit e0cb1b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion converters/google/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,17 @@ type AssetResource struct {
}

// NewConverter is a factory function for Converter.
func NewConverter(ancestryManager ancestrymanager.AncestryManager, project, credentials string) (*Converter, error) {
func NewConverter(ancestryManager ancestrymanager.AncestryManager, project, credentials string, offline bool) (*Converter, error) {
cfg := &converter.Config{
Project: project,
Credentials: credentials,
}
if !offline {
converter.ConfigureBasePaths(cfg)
if err := cfg.LoadAndValidate(); err != nil {
return nil, errors.Wrap(err, "load and validate config")
}
}
p := provider.Provider().(*schema.Provider)
return &Converter{
schema: p,
Expand Down
2 changes: 1 addition & 1 deletion tfgcv/planned_assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func ReadPlannedAssets(path, project, ancestry string, offline bool) ([]google.A
if err != nil {
return nil, errors.Wrap(err, "constructing resource manager client")
}
converter, err := google.NewConverter(ancestryManager, project, "")
converter, err := google.NewConverter(ancestryManager, project, "", offline)
if err != nil {
return nil, errors.Wrap(err, "building google converter")
}
Expand Down

0 comments on commit e0cb1b5

Please sign in to comment.