Skip to content

Commit

Permalink
address linter comments
Browse files Browse the repository at this point in the history
  • Loading branch information
s-urbaniak committed Jan 20, 2025
1 parent 4bde45d commit 8235ed4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 2 additions & 6 deletions internal/kubernetes/operator/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (
"errors"
"fmt"

"k8s.io/client-go/util/retry"

"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/kubernetes"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/kubernetes/operator/features"
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/kubernetes/operator/resources"
Expand All @@ -30,6 +28,7 @@ import (
akov2common "github.com/mongodb/mongodb-atlas-kubernetes/v2/api/v1/common"
"go.mongodb.org/atlas-sdk/v20241113004/admin"
corev1 "k8s.io/api/core/v1"
"k8s.io/client-go/util/retry"
"sigs.k8s.io/controller-runtime/pkg/client"
)

Expand Down Expand Up @@ -293,10 +292,7 @@ func (i *Install) ensureCredentialsAssignment(ctx context.Context) error {

project.Spec.ConnectionSecret = connectionSecret

if err := i.kubectl.Update(ctx, &project); err != nil {
return err
}
return nil
return i.kubectl.Update(ctx, &project)
})
if err != nil {
return fmt.Errorf("failed to update atlas project %s: %w", i.projectName, err)
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/atlas/kubernetes_operator_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestKubernetesOperatorInstall(t *testing.T) {
"--operatorVersion", "1.1.0")
cmd.Env = os.Environ()
_, inErr := e2e.RunAndGetStdOutAndErr(cmd)
require.Error(t, inErr, inErr)
require.Error(t, inErr)
assert.Equal(t, "Error: version 1.1.0 is not supported\n (exit status 1)", inErr.Error())
})

Expand All @@ -66,7 +66,7 @@ func TestKubernetesOperatorInstall(t *testing.T) {
"--operatorVersion", "100.0.0")
cmd.Env = os.Environ()
_, inErr := e2e.RunAndGetStdOutAndErr(cmd)
require.Error(t, inErr, inErr)
require.Error(t, inErr)
assert.Equal(t, "Error: version 100.0.0 is not supported\n (exit status 1)", inErr.Error())
})

Expand All @@ -78,7 +78,7 @@ func TestKubernetesOperatorInstall(t *testing.T) {
"--kubeconfig", "/path/to/non/existing/config")
cmd.Env = os.Environ()
_, inErr := e2e.RunAndGetStdOutAndErr(cmd)
require.Error(t, inErr, inErr)
require.Error(t, inErr)
assert.Equal(t, "Error: unable to prepare client configuration: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable\n (exit status 1)", inErr.Error())
})

Expand Down Expand Up @@ -180,7 +180,7 @@ func TestKubernetesOperatorInstall(t *testing.T) {
"--kubeContext", context)
cmd.Env = os.Environ()
resp, inErr := e2e.RunAndGetStdOutAndErr(cmd)
require.NoError(t, inErr, inErr)
require.NoError(t, inErr)
assert.Equal(t, "Atlas Kubernetes Operator installed successfully\n", string(resp))

checkDeployment(t, operator, operatorNamespace)
Expand Down

0 comments on commit 8235ed4

Please sign in to comment.