Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into CLOUDP-234527_follo…
Browse files Browse the repository at this point in the history
…wup3
  • Loading branch information
fmenezes committed Mar 6, 2024
2 parents 55e24c2 + 4a6b2b8 commit 3404d16
Show file tree
Hide file tree
Showing 26 changed files with 95 additions and 354 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
release_tag=${{ steps.get-latest-tag.outputs.tag }}
echo "LATEST_VERSION=${release_tag#*/}" >> "$GITHUB_ENV"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226
uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c
- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
Expand Down Expand Up @@ -178,13 +178,13 @@ jobs:
- name: Verify Signature Docker Image
env:
IMAGE: ${{ env.IMAGE_REPOSITORY }}:latest
COSIGN_REPOSITORY: docker:io/mongodb/signatures
COSIGN_REPOSITORY: docker.io/mongodb/signatures
run: |
# Download MongoDB Atlas CLI Public Key
curl https://cosign.mongodb.com/atlas-cli.pem > atlas-cli.pem
docker pull "${IMAGE}"
# Verify the signature
if cosign verify --private-infrastructure --key=./atlas-cli.pem "docker.io/${IMAGE}";
if ! cosign verify --private-infrastructure --key=./atlas-cli.pem "docker.io/${IMAGE}";
then
echo "Error: Signature verification for ${IMAGE} failed."
exit 1
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:
- name: Verify Signature Quay Image
env:
IMAGE: ${{ env.QUAY }}/${{ env.IMAGE_REPOSITORY }}:latest
COSIGN_REPOSITORY: docker:io/mongodb/signatures
COSIGN_REPOSITORY: docker.io/mongodb/signatures
run: |
# Download MongoDB Atlas CLI Public Key
curl https://cosign.mongodb.com/atlas-cli.pem > atlas-cli.pem
Expand Down
4 changes: 4 additions & 0 deletions docs/atlascli/command/atlas-events-projects-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Options
- string
- false
- Minimum created date. This option returns events whose created date is greater than or equal to the specified value.
* - --omitCount
-
- false
- Flag that indicates whether the JSON response returns the total number of items (totalCount) in the JSON response.
* - -o, --output
- string
- false
Expand Down
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require (
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc
golang.org/x/mod v0.16.0
golang.org/x/tools v0.19.0
google.golang.org/api v0.167.0
google.golang.org/api v0.168.0
google.golang.org/protobuf v1.32.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.29.2
Expand Down Expand Up @@ -110,7 +110,7 @@ require (
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.1 // indirect
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand Down Expand Up @@ -147,11 +147,11 @@ require (
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.mongodb.org/atlas-sdk/v20231115004 v20231115004.1.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect
go.opentelemetry.io/otel v1.23.0 // indirect
go.opentelemetry.io/otel/metric v1.23.0 // indirect
go.opentelemetry.io/otel/trace v1.23.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/net v0.22.0 // indirect
Expand All @@ -164,8 +164,8 @@ require (
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240205150955-31a09d347014 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/grpc v1.61.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78 // indirect
google.golang.org/grpc v1.62.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
40 changes: 18 additions & 22 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY=
github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
Expand All @@ -119,8 +117,6 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
Expand Down Expand Up @@ -227,8 +223,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
github.com/googleapis/gax-go/v2 v2.12.1 h1:9F8GV9r9ztXyAi00gsMQHNoF51xPZm8uj1dpYt2ZETM=
github.com/googleapis/gax-go/v2 v2.12.1/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc=
github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA=
github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
Expand Down Expand Up @@ -399,18 +395,18 @@ go.mongodb.org/ops-manager v0.55.3 h1:ZckNLra9XfvUxWgRfdCVOr7QkeCPi7S4VNbcK5di/2
go.mongodb.org/ops-manager v0.55.3/go.mod h1:3KAtjSrHt4KB0mWLDRDlQpiyZypB+4EX9XXjx3gN5PA=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 h1:P+/g8GpuJGYbOp2tAdKrIPUX9JO02q8Q0YNlHolpibA=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0/go.mod h1:tIKj3DbO8N9Y2xo52og3irLsPI4GW02DSMtrVgNMgxg=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 h1:doUP+ExOpH3spVTLS0FcWGLnQrPct/hD/bCPbDRUEAU=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0/go.mod h1:rdENBZMT2OE6Ne/KLwpiXudnAsbdrdBaqBvTN8M8BgA=
go.opentelemetry.io/otel v1.23.0 h1:Df0pqjqExIywbMCMTxkAwzjLZtRf+bBKLbUcpxO2C9E=
go.opentelemetry.io/otel v1.23.0/go.mod h1:YCycw9ZeKhcJFrb34iVSkyT0iczq/zYDtZYFufObyB0=
go.opentelemetry.io/otel/metric v1.23.0 h1:pazkx7ss4LFVVYSxYew7L5I6qvLXHA0Ap2pwV+9Cnpo=
go.opentelemetry.io/otel/metric v1.23.0/go.mod h1:MqUW2X2a6Q8RN96E2/nqNoT+z9BSms20Jb7Bbp+HiTo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
go.opentelemetry.io/otel/trace v1.23.0 h1:37Ik5Ib7xfYVb4V1UtnT97T1jI+AoIYkJyPkuL4iJgI=
go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk=
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
Expand Down Expand Up @@ -532,8 +528,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.167.0 h1:CKHrQD1BLRii6xdkatBDXyKzM0mkawt2QP+H3LtPmSE=
google.golang.org/api v0.167.0/go.mod h1:4FcBc686KFi7QI/U51/2GKKevfZMpM17sCdibqe/bSA=
google.golang.org/api v0.168.0 h1:MBRe+Ki4mMN93jhDDbpuRLjRddooArz4FeSObvUMmjY=
google.golang.org/api v0.168.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
Expand All @@ -548,8 +544,8 @@ google.golang.org/genproto v0.0.0-20240205150955-31a09d347014 h1:g/4bk7P6TPMkAUb
google.golang.org/genproto v0.0.0-20240205150955-31a09d347014/go.mod h1:xEgQu1e4stdSSsxPDK8Azkrk/ECl5HvdPf6nbZrTS5M=
google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A=
google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 h1:hZB7eLIaYlW9qXRfCq/qDaPdbeY3757uARz5Vvfv+cY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:YUWgXUFRPfoYK1IHMuxH5K6nPEXSCzIMljnQ59lLRCk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78 h1:Xs9lu+tLXxLIfuci70nG4cpwaRC+mRQPUL7LoIeDJC4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
Expand All @@ -558,8 +554,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY=
google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk=
google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down
6 changes: 6 additions & 0 deletions internal/cli/atlas/events/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ func (opts *ListOpts) NewProjectListOptions() admin.ListProjectEventsApiParams {
if opts.PageNum > 0 {
p.PageNum = &opts.PageNum
}

if opts.OmitCount {
p.IncludeCount = pointer.Get(false)
}

return p
}

Expand Down Expand Up @@ -157,6 +162,7 @@ func ListBuilder() *cobra.Command {

cmd.Flags().IntVar(&opts.PageNum, flag.Page, cli.DefaultPage, usage.Page)
cmd.Flags().IntVar(&opts.ItemsPerPage, flag.Limit, cli.DefaultPageLimit, usage.Limit)
cmd.Flags().BoolVar(&opts.OmitCount, flag.OmitCount, false, usage.OmitCount)

cmd.Flags().StringSliceVar(&opts.EventType, flag.TypeFlag, nil, usage.Event)
cmd.Flags().StringVar(&opts.MaxDate, flag.MaxDate, "", usage.MaxDate)
Expand Down
1 change: 1 addition & 0 deletions internal/cli/atlas/events/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func TestListBuilder(t *testing.T) {
[]string{
flag.Limit,
flag.Page,
flag.OmitCount,
flag.Output,
flag.ProjectID,
flag.OrgID,
Expand Down
6 changes: 6 additions & 0 deletions internal/cli/atlas/events/projects_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ func (opts *projectListOpts) NewProjectListOptions() admin.ListProjectEventsApiP
if opts.PageNum > 0 {
p.PageNum = &opts.PageNum
}

if opts.OmitCount {
p.IncludeCount = pointer.Get(false)
}

return p
}

Expand Down Expand Up @@ -111,6 +116,7 @@ func ProjectListBuilder() *cobra.Command {

cmd.Flags().IntVar(&opts.PageNum, flag.Page, cli.DefaultPage, usage.Page)
cmd.Flags().IntVar(&opts.ItemsPerPage, flag.Limit, cli.DefaultPageLimit, usage.Limit)
cmd.Flags().BoolVar(&opts.OmitCount, flag.OmitCount, false, usage.OmitCount)

cmd.Flags().StringSliceVar(&opts.EventType, flag.TypeFlag, nil, usage.Event)
cmd.Flags().StringVar(&opts.MaxDate, flag.MaxDate, "", usage.MaxDate)
Expand Down
1 change: 1 addition & 0 deletions internal/cli/atlas/events/projects_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func TestProjectListBuilder(t *testing.T) {
flag.Limit,
flag.Page,
flag.Output,
flag.OmitCount,
flag.ProjectID,
flag.TypeFlag,
flag.MaxDate,
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/atlas/logs/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import (
"fmt"
"io"
"path/filepath"
"slices"
"strings"

"github.com/mongodb/mongodb-atlas-cli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/internal/cli/require"
"github.com/mongodb/mongodb-atlas-cli/internal/config"
"github.com/mongodb/mongodb-atlas-cli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/internal/search"
"github.com/mongodb/mongodb-atlas-cli/internal/store"
"github.com/mongodb/mongodb-atlas-cli/internal/usage"
"github.com/spf13/afero"
Expand Down Expand Up @@ -155,7 +155,7 @@ To find the hostnames for an Atlas project, use the process list command.
Args: cobra.MatchAll(
require.ExactArgs(argsN),
func(cmd *cobra.Command, args []string) error {
if !search.StringInSlice(cmd.ValidArgs, args[1]) {
if !slices.Contains(cmd.ValidArgs, args[1]) {
return fmt.Errorf("<logname> must be one of %s", cmd.ValidArgs)
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package config

import (
"github.com/mongodb/mongodb-atlas-cli/internal/cli/config"
"github.com/mongodb/mongodb-atlas-cli/internal/cli/require"
"github.com/spf13/cobra"
)
Expand All @@ -38,12 +37,12 @@ To find out more, see the documentation: https://dochub.mongodb.org/core/atlas-c

cmd.AddCommand(
InitBuilder(),
config.SetBuilder(),
config.ListBuilder(),
config.DescribeBuilder(),
config.RenameBuilder(),
config.DeleteBuilder(),
config.EditBuilder(),
SetBuilder(),
ListBuilder(),
DescribeBuilder(),
RenameBuilder(),
DeleteBuilder(),
EditBuilder(),
)

return cmd
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions internal/cli/config/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ package config

import (
"fmt"
"slices"
"strings"

"github.com/mongodb/mongodb-atlas-cli/internal/cli"
"github.com/mongodb/mongodb-atlas-cli/internal/cli/require"
"github.com/mongodb/mongodb-atlas-cli/internal/config"
"github.com/mongodb/mongodb-atlas-cli/internal/mongosh"
"github.com/mongodb/mongodb-atlas-cli/internal/search"
"github.com/mongodb/mongodb-atlas-cli/internal/validate"
"github.com/spf13/cobra"
)
Expand All @@ -46,10 +46,10 @@ func (opts *SetOpts) Run() error {
}
var value interface{}
value = opts.val
if search.StringInSlice(config.BooleanProperties(), opts.prop) {
if slices.Contains(config.BooleanProperties(), opts.prop) {
value = config.IsTrue(opts.val)
}
if search.StringInSlice(config.GlobalProperties(), opts.prop) {
if slices.Contains(config.GlobalProperties(), opts.prop) {
opts.store.SetGlobal(opts.prop, value)
} else {
opts.store.Set(opts.prop, value)
Expand Down Expand Up @@ -78,7 +78,7 @@ func SetBuilder() *cobra.Command {
if err := require.ExactArgs(argsN)(cmd, args); err != nil {
return err
}
if !search.StringInSlice(cmd.ValidArgs, args[0]) {
if !slices.Contains(cmd.ValidArgs, args[0]) {
return fmt.Errorf("invalid property: %q", args[0])
}
return nil
Expand Down
1 change: 1 addition & 0 deletions internal/cli/list_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const (
type ListOpts struct {
PageNum int
ItemsPerPage int
OmitCount bool
}

func (opts *ListOpts) NewListOptions() *mongodbatlas.ListOptions {
Expand Down
8 changes: 4 additions & 4 deletions internal/cli/root/atlas/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/backup"
"github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/cloudproviders"
"github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/clusters"
atlasconfig "github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/config"
"github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/customdbroles"
"github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/customdns"
"github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/datafederation"
Expand Down Expand Up @@ -60,6 +59,7 @@ import (
"github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/teams"
"github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/users"
"github.com/mongodb/mongodb-atlas-cli/internal/cli/auth"
cliconfig "github.com/mongodb/mongodb-atlas-cli/internal/cli/config"
"github.com/mongodb/mongodb-atlas-cli/internal/config"
"github.com/mongodb/mongodb-atlas-cli/internal/flag"
"github.com/mongodb/mongodb-atlas-cli/internal/homebrew"
Expand Down Expand Up @@ -92,8 +92,8 @@ const (
NoAuth AuthRequirements = 0
// RequiredAuth command requires authentication.
RequiredAuth AuthRequirements = 1
// command can work with or without authentication,
// and if access token token is found, try to refresh it.
// OptionalAuth command can work with or without authentication,
// and if access token is found, try to refresh it.
OptionalAuth AuthRequirements = 2
)

Expand Down Expand Up @@ -204,7 +204,7 @@ Use the --help flag with any command for more info on that command.`,
registerCmd.Hidden = true

rootCmd.AddCommand(
atlasconfig.Builder(),
cliconfig.Builder(),
auth.Builder(),
setup.Builder(),
projects.Builder(),
Expand Down
Loading

0 comments on commit 3404d16

Please sign in to comment.