fix: var-naming linter findings
Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
This commit is contained in:
parent
f9e41f11d1
commit
f4e51493f3
5 changed files with 13 additions and 19 deletions
|
|
@ -66,7 +66,7 @@ garm-cli init --name=dev --url=https://runner.example.com --username=admin --pas
|
|||
|
||||
url := strings.TrimSuffix(loginURL, "/")
|
||||
|
||||
initApiClient(url, "")
|
||||
initAPIClient(url, "")
|
||||
|
||||
response, err := apiCli.FirstRun.FirstRun(newUserReq, authToken)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -451,13 +451,13 @@ func asRawMessage(data []byte) (json.RawMessage, error) {
|
|||
return nil, errors.Wrap(err, "decoding extra specs")
|
||||
}
|
||||
|
||||
var asRawJson json.RawMessage
|
||||
var asRawJSON json.RawMessage
|
||||
var err error
|
||||
asRawJson, err = json.Marshal(unmarshaled)
|
||||
asRawJSON, err = json.Marshal(unmarshaled)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "marshaling json")
|
||||
}
|
||||
return asRawJson, nil
|
||||
return asRawJSON, nil
|
||||
}
|
||||
|
||||
func formatPools(pools []params.Pool) {
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ var profileAddCmd = &cobra.Command{
|
|||
|
||||
url := strings.TrimSuffix(loginURL, "/")
|
||||
|
||||
initApiClient(url, "")
|
||||
initAPIClient(url, "")
|
||||
|
||||
newLoginParamsReq := apiClientLogin.NewLoginParams()
|
||||
newLoginParamsReq.Body = params.PasswordLoginParams{
|
||||
|
|
|
|||
|
|
@ -20,9 +20,6 @@ import (
|
|||
"os"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/jedib0t/go-pretty/v6/table"
|
||||
|
||||
|
||||
openapiRuntimeClient "github.com/go-openapi/runtime/client"
|
||||
"github.com/jedib0t/go-pretty/v6/table"
|
||||
"github.com/spf13/cobra"
|
||||
|
|
@ -63,24 +60,24 @@ func Execute() {
|
|||
}
|
||||
}
|
||||
|
||||
func initApiClient(baseUrl, token string) {
|
||||
baseUrlParsed, err := url.Parse(baseUrl)
|
||||
func initAPIClient(baseURL, token string) {
|
||||
baseURLParsed, err := url.Parse(baseURL)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to parse base url %s: %s", baseUrl, err)
|
||||
fmt.Printf("Failed to parse base url %s: %s", baseURL, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
apiPath, err := url.JoinPath(baseUrlParsed.Path, apiClient.DefaultBasePath)
|
||||
apiPath, err := url.JoinPath(baseURLParsed.Path, apiClient.DefaultBasePath)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to join base url path %s with %s: %s", baseUrlParsed.Path, apiClient.DefaultBasePath, err)
|
||||
fmt.Printf("Failed to join base url path %s with %s: %s", baseURLParsed.Path, apiClient.DefaultBasePath, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if debug {
|
||||
os.Setenv("SWAGGER_DEBUG", "true")
|
||||
}
|
||||
transportCfg := apiClient.DefaultTransportConfig().
|
||||
WithHost(baseUrlParsed.Host).
|
||||
WithHost(baseURLParsed.Host).
|
||||
WithBasePath(apiPath).
|
||||
WithSchemes([]string{baseUrlParsed.Scheme})
|
||||
WithSchemes([]string{baseURLParsed.Scheme})
|
||||
apiCli = apiClient.NewHTTPClientWithConfig(nil, transportCfg)
|
||||
authToken = openapiRuntimeClient.BearerToken(token)
|
||||
}
|
||||
|
|
@ -101,7 +98,7 @@ func initConfig() {
|
|||
mgr = cfg.Managers[0]
|
||||
}
|
||||
}
|
||||
initApiClient(mgr.BaseURL, mgr.Token)
|
||||
initAPIClient(mgr.BaseURL, mgr.Token)
|
||||
}
|
||||
|
||||
func formatOneHookInfo(hook params.HookInfo) {
|
||||
|
|
|
|||
|
|
@ -21,9 +21,6 @@ import (
|
|||
"github.com/jedib0t/go-pretty/v6/table"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/jedib0t/go-pretty/v6/table"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
apiClientEnterprises "github.com/cloudbase/garm/client/enterprises"
|
||||
apiClientInstances "github.com/cloudbase/garm/client/instances"
|
||||
apiClientOrgs "github.com/cloudbase/garm/client/organizations"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue