Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Sep 12, 2024
1 parent a3efa72 commit 93fbc00
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmd/scaleComponent.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"errors"
"strconv"

client2 "github.com/equinor/radix-cli/generated-client/client"
apiclient "github.com/equinor/radix-cli/generated-client/client"
"github.com/equinor/radix-cli/generated-client/client/component"
"github.com/equinor/radix-cli/pkg/client"
"github.com/equinor/radix-cli/pkg/flagnames"
Expand Down Expand Up @@ -85,30 +85,28 @@ rx scale --application radix-test --environment dev --component component-abc --
},
}

func scaleComponent(apiClient *client2.Radixapi, appName, envName, cmpName, replicas string) error {
func scaleComponent(apiClient *apiclient.Radixapi, appName, envName, cmpName, replicas string) error {
parameters := component.NewScaleComponentParams().
WithAppName(appName).
WithEnvName(envName).
WithComponentName(cmpName).
WithReplicas(replicas)

_, err := apiClient.Component.ScaleComponent(parameters, nil)
if err != nil {
if _, err := apiClient.Component.ScaleComponent(parameters, nil); err != nil {
return err
}

logrus.Infof("%s Successfully scaled to %s replicas", cmpName, replicas)
return nil
}

func resetScaledComponent(apiClient *client2.Radixapi, appName, envName, cmpName string) error {
func resetScaledComponent(apiClient *apiclient.Radixapi, appName, envName, cmpName string) error {
parameters := component.NewResetScaledComponentParams().
WithAppName(appName).
WithEnvName(envName).
WithComponentName(cmpName)

_, err := apiClient.Component.ResetScaledComponent(parameters, nil)
if err != nil {
if _, err := apiClient.Component.ResetScaledComponent(parameters, nil); err != nil {
return err
}

Expand Down

0 comments on commit 93fbc00

Please sign in to comment.