Skip to content

Commit

Permalink
convert mongodb to v1 api
Browse files Browse the repository at this point in the history
Signed-off-by: sayedppqq <[email protected]>
  • Loading branch information
sayedppqq committed Jun 10, 2024
1 parent cb56ea2 commit 9037215
Show file tree
Hide file tree
Showing 256 changed files with 154,260 additions and 12,161 deletions.
28 changes: 13 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
k8s.io/klog/v2 v2.120.1
kmodules.xyz/client-go v0.30.1
kmodules.xyz/custom-resources v0.29.1
kubedb.dev/apimachinery v0.46.0
kubedb.dev/apimachinery v0.46.1-0.20240610093727-e6d4be3bcb55
sigs.k8s.io/controller-runtime v0.18.3
xorm.io/xorm v1.3.6
)
Expand All @@ -36,8 +36,8 @@ require (
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cert-manager/cert-manager v1.14.5 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cert-manager/cert-manager v1.15.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/eapache/go-resiliency v1.4.0 // indirect
Expand Down Expand Up @@ -80,7 +80,6 @@ require (
github.com/klauspost/compress v1.17.7 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand All @@ -90,9 +89,9 @@ require (
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.46.0 // indirect
github.com/prometheus/procfs v0.15.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/segmentio/asm v1.2.0 // indirect
Expand All @@ -103,16 +102,16 @@ require (
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 // indirect
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/otel v1.26.0 // indirect
go.opentelemetry.io/otel/trace v1.26.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
Expand All @@ -122,8 +121,7 @@ require (
gomodules.xyz/mergo v0.3.13 // indirect
gomodules.xyz/pointer v0.1.0 // indirect
gomodules.xyz/x v0.0.17 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -138,7 +136,7 @@ require (
kubeops.dev/petset v0.0.6 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/token v1.1.0 // indirect
sigs.k8s.io/gateway-api v1.0.0 // indirect
sigs.k8s.io/gateway-api v1.1.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
85 changes: 40 additions & 45 deletions go.sum

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions mongodb/kubedb_client_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import (
"context"
"errors"
"fmt"
"kubedb.dev/apimachinery/apis/kubedb"
"strings"
"time"

api "kubedb.dev/apimachinery/apis/kubedb/v1alpha2"
api "kubedb.dev/apimachinery/apis/kubedb/v1"

"go.mongodb.org/mongo-driver/mongo"
mgoptions "go.mongodb.org/mongo-driver/mongo/options"
Expand Down Expand Up @@ -144,7 +145,7 @@ func (o *KubeDBClientBuilder) GetMongoClient() (*Client, error) {

func (o *KubeDBClientBuilder) getURL() string {
nodeType := o.podName[:strings.LastIndex(o.podName, "-")]
if strings.HasSuffix(nodeType, api.NodeTypeArbiter) {
if strings.HasSuffix(nodeType, kubedb.NodeTypeArbiter) {
// nodeType looks like <DB_NAME>-shard<SHARD_NUMBER>-arbiter for shard, <DB_NAME>-arbiter otherwise.
// so excluding '-arbiter' will give us the stsName where this arbiter belongs as a member of rs
nodeType = nodeType[:strings.LastIndex(nodeType, "-")]
Expand Down
1 change: 0 additions & 1 deletion vendor/github.com/cert-manager/cert-manager/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9037215

Please sign in to comment.