Skip to content

Commit

Permalink
fix: fetch provider-registry-hostname from viper.GetString
Browse files Browse the repository at this point in the history
Updates the value to be read from the `viper.GetString` method which
will handle the environment as well as flags.
  • Loading branch information
jacobbednarz committed Jul 2, 2024
1 parent eff2de6 commit d227173
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/app/cf-terraforming/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ func generateResources() func(cmd *cobra.Command, args []string) {

zoneID = viper.GetString("zone")
accountID = viper.GetString("account")

var execPath, workingDir string
workingDir = viper.GetString("terraform-install-path")
execPath = viper.GetString("terraform-binary-path")
workingDir := viper.GetString("terraform-install-path")
execPath := viper.GetString("terraform-binary-path")
providerRegistryHostname := viper.GetString("provider-registry-hostname")

// Download terraform if no existing binary was provided
if execPath == "" {
Expand Down Expand Up @@ -83,6 +82,7 @@ func generateResources() func(cmd *cobra.Command, args []string) {
if err != nil {
log.Fatal("failed to read provider schema", err)
}

s := ps.Schemas[providerRegistryHostname+"/cloudflare/cloudflare"]
if s == nil {
log.Fatal("failed to detect provider installation")
Expand Down

0 comments on commit d227173

Please sign in to comment.