Skip to content

Commit

Permalink
Refactor codebase to use new config pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught committed Apr 17, 2023
1 parent de87857 commit 8423370
Show file tree
Hide file tree
Showing 17 changed files with 101 additions and 620 deletions.
2 changes: 1 addition & 1 deletion internal/cli/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ func openActionCmd(cli *cli) *cobra.Command {
inputs.ID = args[0]
}

openManageURL(cli, cli.config.DefaultTenant, formatActionDetailsPath(url.PathEscape(inputs.ID)))
openManageURL(cli, cli.Config.DefaultTenant, formatActionDetailsPath(url.PathEscape(inputs.ID)))
return nil
},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ func openAPICmd(cli *cli) *cobra.Command {
}
}

openManageURL(cli, cli.config.DefaultTenant, formatAPISettingsPath(inputs.ID))
openManageURL(cli, cli.Config.DefaultTenant, formatAPISettingsPath(inputs.ID))
return nil
},
}
Expand Down
8 changes: 4 additions & 4 deletions internal/cli/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func useAppCmd(cli *cli) *cobra.Command {
}
}

if err := cli.setDefaultAppID(inputs.ID); err != nil {
if err := cli.Config.SaveNewDefaultAppIDForTenant(cli.tenant, inputs.ID); err != nil {
return err
}

Expand Down Expand Up @@ -479,7 +479,7 @@ func createAppCmd(cli *cli) *cobra.Command {
return fmt.Errorf("Unable to create application: %v", err)
}

if err := cli.setDefaultAppID(a.GetClientID()); err != nil {
if err := cli.Config.SaveNewDefaultAppIDForTenant(cli.tenant, a.GetClientID()); err != nil {
return err
}

Expand Down Expand Up @@ -737,7 +737,7 @@ func openAppCmd(cli *cli) *cobra.Command {
inputs.ID = args[0]
}

openManageURL(cli, cli.config.DefaultTenant, formatAppSettingsPath(inputs.ID))
openManageURL(cli, cli.Config.DefaultTenant, formatAppSettingsPath(inputs.ID))
return nil
},
}
Expand Down Expand Up @@ -879,7 +879,7 @@ func (c *cli) appPickerOptions(requestOpts ...management.RequestOption) pickerOp
return nil, err
}

tenant, err := c.getTenant()
tenant, err := c.Config.GetTenant(c.tenant)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit 8423370

Please sign in to comment.