Skip to content

Commit

Permalink
fixed linter
Browse files Browse the repository at this point in the history
  • Loading branch information
enrichman committed Apr 9, 2024
1 parent 52b7f76 commit b10185a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func getKubeConfigForUser(ctx *cli.Context, user string) (*api.Config, error) {
}

focusedServer := cf.FocusedServer()
kubeConfig, _ := focusedServer.KubeConfigs[fmt.Sprintf(kubeConfigKeyFormat, user, focusedServer.FocusedCluster())]
kubeConfig := focusedServer.KubeConfigs[fmt.Sprintf(kubeConfigKeyFormat, user, focusedServer.FocusedCluster())]
return kubeConfig, nil
}

Expand Down
8 changes: 8 additions & 0 deletions cmd/kubectl_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ func samlAuth(input *LoginInput, tlsConfig *tls.Config) (managementClient.Token,
// log error and use the token if login succeeds
customPrint(fmt.Errorf("DeleteToken: %v", err))
}
defer res.Body.Close()

return token, nil

case <-timeout.C:
Expand All @@ -502,12 +504,18 @@ func samlAuth(input *LoginInput, tlsConfig *tls.Config) (managementClient.Token,
func getAuthProviders(server string) (map[string]string, error) {
authProviders := fmt.Sprintf(authProviderURL, server)
customPrint(authProviders)

response, err := request(http.MethodGet, authProviders, nil)
if err != nil {
return nil, err
}

data := map[string]interface{}{}
err = json.Unmarshal(response, &data)
if err != nil {
return nil, err
}

providers := map[string]string{}
i := 0
for _, value := range convert.ToMapSlice(data["data"]) {
Expand Down
4 changes: 4 additions & 0 deletions cmd/multiclusterapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ func multiClusterAppLs(ctx *cli.Context) error {
}

collection, err := c.ManagementClient.MultiClusterApp.List(defaultListOpts(ctx))
if err != nil {
return err
}

writer := NewTableWriter([][]string{
{"ID", "ID"},
{"NAME", "App.Name"},
Expand Down
4 changes: 2 additions & 2 deletions cmd/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ func wait(ctx *cli.Context) error {
}

timeout := time.After(time.Duration(ctx.Int("timeout")) * time.Second)
every := time.Tick(1 * time.Second)
ticker := time.NewTicker(time.Second)

for {
select {
case <-timeout:
return fmt.Errorf("Timeout reached %v:%v transitioningMessage: %v", resource.Type, resource.ID, mapResource["transitioningMessage"])
case <-every:
case <-ticker.C:
err = c.ByID(resource, &mapResource)
if err != nil {
return err
Expand Down

0 comments on commit b10185a

Please sign in to comment.