Skip to content

Commit

Permalink
bug: Fixes --profile (#40)
Browse files Browse the repository at this point in the history
* Removes config package and uses atlascli core config

* Bump atlas-cli-core
  • Loading branch information
cveticm authored Feb 14, 2025
1 parent 401ae09 commit 0f7e071
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 548 deletions.
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ require (
github.com/Masterminds/semver/v3 v3.3.1
github.com/PaesslerAG/jsonpath v0.1.1
github.com/go-test/deep v1.1.1
github.com/golang-jwt/jwt/v4 v4.5.1
github.com/golang/mock v1.6.0
github.com/google/go-github/v61 v61.0.0
github.com/google/uuid v1.6.0
github.com/mongodb-forks/digest v1.1.0
github.com/mongodb-labs/cobra2snooty v0.18.2
github.com/mongodb/atlas-cli-core v0.0.0-20250102164103-49387c8ee633
github.com/mongodb/atlas-cli-core v0.0.0-20250214162807-8f937b802e87
github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.7.0
github.com/spf13/afero v1.12.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.10.0
github.com/tangzero/inflector v1.0.0
go.mongodb.org/atlas v0.37.0
Expand Down Expand Up @@ -51,6 +49,7 @@ require (
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
Expand All @@ -76,6 +75,7 @@ require (
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.mongodb.org/atlas-sdk/v20231115008 v20231115008.5.0 // indirect
Expand All @@ -96,5 +96,4 @@ require (
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect

)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ github.com/mongodb-forks/digest v1.1.0 h1:7eUdsR1BtqLv0mdNm4OXs6ddWvR4X2/OsLwdKk
github.com/mongodb-forks/digest v1.1.0/go.mod h1:rb+EX8zotClD5Dj4NdgxnJXG9nwrlx3NWKJ8xttz1Dg=
github.com/mongodb-labs/cobra2snooty v0.18.2 h1:qWpLCMWbQb5FSZ5ehiWN2URmieMJhQtQPxT0uhIK62A=
github.com/mongodb-labs/cobra2snooty v0.18.2/go.mod h1:WnzqCFmx4f72Yj9dL/ulBUqcatfURGdKFf8DLT4h7zQ=
github.com/mongodb/atlas-cli-core v0.0.0-20250102164103-49387c8ee633 h1:aAP61m3j8m2kKURFbauAu/Hk7nV+k8puGakS0M03tqk=
github.com/mongodb/atlas-cli-core v0.0.0-20250102164103-49387c8ee633/go.mod h1:zeBvF+hvzhmHwvjT9QuLeGrKQlsY1YlQo8v25wWzQug=
github.com/mongodb/atlas-cli-core v0.0.0-20250214162807-8f937b802e87 h1:Y9Gh8mkiHbDE7pXPWprLgNo0onWLtrQe25sTfqvlS5c=
github.com/mongodb/atlas-cli-core v0.0.0-20250214162807-8f937b802e87/go.mod h1:zeBvF+hvzhmHwvjT9QuLeGrKQlsY1YlQo8v25wWzQug=
github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.7.0 h1:Fcj23AIwISOgQNjXqpvw3OA6FfKd+ZqwOzGxd9Sx/Gg=
github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.7.0/go.mod h1:aNJO0I6HBltZ+UHGoS+0mnOgLyLqnKhbVZ1UDiHe8kA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/kubernetes/config/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"context"
"fmt"

"github.com/mongodb/atlas-cli-core/config"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/cli"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/cli/require"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/config"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/flag"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/kubernetes/operator"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/kubernetes/operator/crds"
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (

coreConfig "github.com/mongodb/atlas-cli-core/config"

"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/cli"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/cli/kubernetes/config"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/cli/kubernetes/operator"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/flag"
Expand Down Expand Up @@ -51,7 +50,7 @@ func Builder() *cobra.Command {
if err != nil {
return fmt.Errorf("failed to load Atlas CLI configuration: %v", err)
}
if err := cli.InitProfile(profile); err != nil {
if err := coreConfig.InitProfile(profile); err != nil {
return fmt.Errorf("Failed to initialise Atlas CLI profile: %v", err)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/kubernetes/operator/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"fmt"

"github.com/google/go-github/v61/github"
"github.com/mongodb/atlas-cli-core/config"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/cli"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/cli/require"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/config"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/flag"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/kubernetes"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/kubernetes/operator"
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/org_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package cli

import (
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/config"
"github.com/mongodb/atlas-cli-core/config"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/flag"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/usage"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/validate"
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/output_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"reflect"
"strings"

"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/config"
"github.com/mongodb/atlas-cli-core/config"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/jsonpathwriter"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/jsonwriter"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/templatewriter"
Expand Down
41 changes: 0 additions & 41 deletions internal/cli/profile.go

This file was deleted.

2 changes: 1 addition & 1 deletion internal/cli/project_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package cli

import (
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/config"
"github.com/mongodb/atlas-cli-core/config"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/flag"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/usage"
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/validate"
Expand Down
Loading

0 comments on commit 0f7e071

Please sign in to comment.