Skip to content

Commit 8bde94b

Browse files
authored
cleanup: remove use of deprecated Go APIs (#1468)
1 parent 4ea4b42 commit 8bde94b

File tree

4 files changed

+53
-54
lines changed

4 files changed

+53
-54
lines changed

controllers/replica_set_controller.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,10 +581,7 @@ func guessEnterprise(mdb mdbv1.MongoDBCommunity) bool {
581581
}
582582
}
583583
if len(overriddenImage) > 0 {
584-
if strings.Contains(overriddenImage, construct.OfficialMongodbEnterpriseServerImageName) {
585-
return true
586-
}
587-
return false
584+
return strings.Contains(overriddenImage, construct.OfficialMongodbEnterpriseServerImageName)
588585
}
589586
return os.Getenv(construct.MongodbImageEnv) == construct.OfficialMongodbEnterpriseServerImageName
590587
}

licenses.csv

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
cloud.google.com/go/compute/metadata,https://github.com/googleapis/google-cloud-go/blob/v0.97.0/LICENSE,Apache-2.0
2-
github.com/PuerkitoBio/purell,https://github.com/PuerkitoBio/purell/blob/v1.1.1/LICENSE,BSD-3-Clause
3-
github.com/PuerkitoBio/urlesc,https://github.com/PuerkitoBio/urlesc/blob/de5bf2ad4578/LICENSE,BSD-3-Clause
41
github.com/beorn7/perks/quantile,https://github.com/beorn7/perks/blob/v1.0.1/LICENSE,MIT
52
github.com/blang/semver,https://github.com/blang/semver/blob/v3.5.1/LICENSE,MIT
6-
github.com/cespare/xxhash/v2,https://github.com/cespare/xxhash/blob/v2.1.2/LICENSE.txt,MIT
3+
github.com/cespare/xxhash/v2,https://github.com/cespare/xxhash/blob/v2.2.0/LICENSE.txt,MIT
74
github.com/davecgh/go-spew/spew,https://github.com/davecgh/go-spew/blob/v1.1.1/LICENSE,ISC
8-
github.com/emicklei/go-restful/v3,https://github.com/emicklei/go-restful/blob/v3.8.0/LICENSE,MIT
9-
github.com/evanphx/json-patch,https://github.com/evanphx/json-patch/blob/v4.12.0/LICENSE,BSD-3-Clause
10-
github.com/fsnotify/fsnotify,https://github.com/fsnotify/fsnotify/blob/v1.5.1/LICENSE,BSD-3-Clause
11-
github.com/go-logr/logr,https://github.com/go-logr/logr/blob/v1.2.4/LICENSE,Apache-2.0
12-
github.com/go-openapi/jsonpointer,https://github.com/go-openapi/jsonpointer/blob/v0.19.5/LICENSE,Apache-2.0
13-
github.com/go-openapi/jsonreference,https://github.com/go-openapi/jsonreference/blob/v0.19.5/LICENSE,Apache-2.0
14-
github.com/go-openapi/swag,https://github.com/go-openapi/swag/blob/v0.19.14/LICENSE,Apache-2.0
5+
github.com/emicklei/go-restful/v3,https://github.com/emicklei/go-restful/blob/v3.11.0/LICENSE,MIT
6+
github.com/evanphx/json-patch,https://github.com/evanphx/json-patch/blob/v5.6.0/LICENSE,BSD-3-Clause
7+
github.com/evanphx/json-patch/v5,https://github.com/evanphx/json-patch/blob/v5.6.0/v5/LICENSE,BSD-3-Clause
8+
github.com/fsnotify/fsnotify,https://github.com/fsnotify/fsnotify/blob/v1.6.0/LICENSE,BSD-3-Clause
9+
github.com/go-logr/logr,https://github.com/go-logr/logr/blob/v1.4.1/LICENSE,Apache-2.0
10+
github.com/go-openapi/jsonpointer,https://github.com/go-openapi/jsonpointer/blob/v0.19.6/LICENSE,Apache-2.0
11+
github.com/go-openapi/jsonreference,https://github.com/go-openapi/jsonreference/blob/v0.20.2/LICENSE,Apache-2.0
12+
github.com/go-openapi/swag,https://github.com/go-openapi/swag/blob/v0.22.3/LICENSE,Apache-2.0
1513
github.com/gogo/protobuf,https://github.com/gogo/protobuf/blob/v1.3.2/LICENSE,BSD-3-Clause
1614
github.com/golang/groupcache/lru,https://github.com/golang/groupcache/blob/41bb18bfe9da/LICENSE,Apache-2.0
17-
github.com/golang/protobuf,https://github.com/golang/protobuf/blob/v1.5.2/LICENSE,BSD-3-Clause
15+
github.com/golang/protobuf,https://github.com/golang/protobuf/blob/v1.5.3/LICENSE,BSD-3-Clause
1816
github.com/golang/snappy,https://github.com/golang/snappy/blob/v0.0.3/LICENSE,BSD-3-Clause
19-
github.com/google/gnostic,https://github.com/google/gnostic/blob/v0.5.7-v3refs/LICENSE,Apache-2.0
17+
github.com/google/gnostic-models,https://github.com/google/gnostic-models/blob/v0.6.8/LICENSE,Apache-2.0
2018
github.com/google/go-cmp/cmp,https://github.com/google/go-cmp/blob/v0.5.9/LICENSE,BSD-3-Clause
21-
github.com/google/gofuzz,https://github.com/google/gofuzz/blob/v1.1.0/LICENSE,Apache-2.0
19+
github.com/google/gofuzz,https://github.com/google/gofuzz/blob/v1.2.0/LICENSE,Apache-2.0
2220
github.com/google/uuid,https://github.com/google/uuid/blob/v1.3.0/LICENSE,BSD-3-Clause
2321
github.com/hashicorp/errwrap,https://github.com/hashicorp/errwrap/blob/v1.0.0/LICENSE,MPL-2.0
2422
github.com/hashicorp/go-multierror,https://github.com/hashicorp/go-multierror/blob/v1.1.1/LICENSE,MPL-2.0
@@ -28,8 +26,8 @@ github.com/json-iterator/go,https://github.com/json-iterator/go/blob/v1.1.12/LIC
2826
github.com/klauspost/compress,https://github.com/klauspost/compress/blob/v1.13.6/LICENSE,Apache-2.0
2927
github.com/klauspost/compress/internal/snapref,https://github.com/klauspost/compress/blob/v1.13.6/internal/snapref/LICENSE,BSD-3-Clause
3028
github.com/klauspost/compress/zstd/internal/xxhash,https://github.com/klauspost/compress/blob/v1.13.6/zstd/internal/xxhash/LICENSE.txt,MIT
31-
github.com/mailru/easyjson,https://github.com/mailru/easyjson/blob/v0.7.6/LICENSE,MIT
32-
github.com/matttproud/golang_protobuf_extensions/pbutil,https://github.com/matttproud/golang_protobuf_extensions/blob/c182affec369/LICENSE,Apache-2.0
29+
github.com/mailru/easyjson,https://github.com/mailru/easyjson/blob/v0.7.7/LICENSE,MIT
30+
github.com/matttproud/golang_protobuf_extensions/pbutil,https://github.com/matttproud/golang_protobuf_extensions/blob/v1.0.4/LICENSE,Apache-2.0
3331
github.com/moby/spdystream,https://github.com/moby/spdystream/blob/v0.2.0/LICENSE,Apache-2.0
3432
github.com/modern-go/concurrent,https://github.com/modern-go/concurrent/blob/bacd9c7ef1dd/LICENSE,Apache-2.0
3533
github.com/modern-go/reflect2,https://github.com/modern-go/reflect2/blob/v1.0.2/LICENSE,Apache-2.0
@@ -125,6 +123,7 @@ github.com/mongodb/mongodb-kubernetes-operator/test/e2e/replica_set_custom_role,
125123
github.com/mongodb/mongodb-kubernetes-operator/test/e2e/replica_set_enterprise_upgrade,Unknown,Unknown
126124
github.com/mongodb/mongodb-kubernetes-operator/test/e2e/replica_set_enterprise_upgrade_4_5,Unknown,Unknown
127125
github.com/mongodb/mongodb-kubernetes-operator/test/e2e/replica_set_enterprise_upgrade_5_6,Unknown,Unknown
126+
github.com/mongodb/mongodb-kubernetes-operator/test/e2e/replica_set_enterprise_upgrade_6_7,Unknown,Unknown
128127
github.com/mongodb/mongodb-kubernetes-operator/test/e2e/replica_set_mongod_config,Unknown,Unknown
129128
github.com/mongodb/mongodb-kubernetes-operator/test/e2e/replica_set_mongod_port_change_with_arbiters,Unknown,Unknown
130129
github.com/mongodb/mongodb-kubernetes-operator/test/e2e/replica_set_mongod_readiness,Unknown,Unknown
@@ -152,12 +151,12 @@ github.com/montanaflynn/stats,https://github.com/montanaflynn/stats/blob/1bf9dbc
152151
github.com/munnerz/goautoneg,https://github.com/munnerz/goautoneg/blob/a7dc8b61c822/LICENSE,BSD-3-Clause
153152
github.com/pkg/errors,https://github.com/pkg/errors/blob/v0.9.1/LICENSE,BSD-2-Clause
154153
github.com/pmezard/go-difflib/difflib,https://github.com/pmezard/go-difflib/blob/v1.0.0/LICENSE,BSD-3-Clause
155-
github.com/prometheus/client_golang/prometheus,https://github.com/prometheus/client_golang/blob/v1.12.1/LICENSE,Apache-2.0
156-
github.com/prometheus/client_model/go,https://github.com/prometheus/client_model/blob/v0.2.0/LICENSE,Apache-2.0
157-
github.com/prometheus/common,https://github.com/prometheus/common/blob/v0.32.1/LICENSE,Apache-2.0
158-
github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg,https://github.com/prometheus/common/blob/v0.32.1/internal/bitbucket.org/ww/goautoneg/README.txt,BSD-3-Clause
159-
github.com/prometheus/procfs,https://github.com/prometheus/procfs/blob/v0.7.3/LICENSE,Apache-2.0
160-
github.com/spf13/cast,https://github.com/spf13/cast/blob/v1.5.1/LICENSE,MIT
154+
github.com/prometheus/client_golang/prometheus,https://github.com/prometheus/client_golang/blob/v1.16.0/LICENSE,Apache-2.0
155+
github.com/prometheus/client_model/go,https://github.com/prometheus/client_model/blob/v0.4.0/LICENSE,Apache-2.0
156+
github.com/prometheus/common,https://github.com/prometheus/common/blob/v0.44.0/LICENSE,Apache-2.0
157+
github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg,https://github.com/prometheus/common/blob/v0.44.0/internal/bitbucket.org/ww/goautoneg/README.txt,BSD-3-Clause
158+
github.com/prometheus/procfs,https://github.com/prometheus/procfs/blob/v0.10.1/LICENSE,Apache-2.0
159+
github.com/spf13/cast,https://github.com/spf13/cast/blob/v1.6.0/LICENSE,MIT
161160
github.com/spf13/pflag,https://github.com/spf13/pflag/blob/v1.0.5/LICENSE,BSD-3-Clause
162161
github.com/stretchr/objx,https://github.com/stretchr/objx/blob/v0.5.1/LICENSE,MIT
163162
github.com/stretchr/testify,https://github.com/stretchr/testify/blob/v1.8.4/LICENSE,MIT
@@ -166,36 +165,38 @@ github.com/xdg-go/scram,https://github.com/xdg-go/scram/blob/v1.1.2/LICENSE,Apac
166165
github.com/xdg-go/stringprep,https://github.com/xdg-go/stringprep/blob/v1.0.4/LICENSE,Apache-2.0
167166
github.com/xdg/stringprep,https://github.com/xdg/stringprep/blob/v1.0.3/LICENSE,Apache-2.0
168167
github.com/youmark/pkcs8,https://github.com/youmark/pkcs8/blob/1be2e3e5546d/LICENSE,MIT
169-
go.mongodb.org/mongo-driver,https://github.com/mongodb/mongo-go-driver/blob/v1.12.1/LICENSE,Apache-2.0
170-
go.uber.org/multierr,https://github.com/uber-go/multierr/blob/v1.10.0/LICENSE.txt,MIT
168+
go.mongodb.org/mongo-driver,https://github.com/mongodb/mongo-go-driver/blob/v1.13.1/LICENSE,Apache-2.0
169+
go.uber.org/multierr,https://github.com/uber-go/multierr/blob/v1.11.0/LICENSE.txt,MIT
171170
go.uber.org/zap,https://github.com/uber-go/zap/blob/v1.26.0/LICENSE.txt,MIT
172-
golang.org/x/crypto,https://cs.opensource.google/go/x/crypto/+/v0.14.0:LICENSE,BSD-3-Clause
171+
golang.org/x/crypto,https://cs.opensource.google/go/x/crypto/+/v0.17.0:LICENSE,BSD-3-Clause
172+
golang.org/x/exp/maps,https://cs.opensource.google/go/x/exp/+/a9213eeb:LICENSE,BSD-3-Clause
173173
golang.org/x/net,https://cs.opensource.google/go/x/net/+/v0.17.0:LICENSE,BSD-3-Clause
174-
golang.org/x/oauth2,https://cs.opensource.google/go/x/oauth2/+/d3ed0bb2:LICENSE,BSD-3-Clause
175-
golang.org/x/sync,https://cs.opensource.google/go/x/sync/+/v0.1.0:LICENSE,BSD-3-Clause
176-
golang.org/x/sys/unix,https://cs.opensource.google/go/x/sys/+/v0.13.0:LICENSE,BSD-3-Clause
177-
golang.org/x/term,https://cs.opensource.google/go/x/term/+/v0.13.0:LICENSE,BSD-3-Clause
178-
golang.org/x/text,https://cs.opensource.google/go/x/text/+/v0.13.0:LICENSE,BSD-3-Clause
179-
golang.org/x/time/rate,https://cs.opensource.google/go/x/time/+/90d013bb:LICENSE,BSD-3-Clause
180-
gomodules.xyz/jsonpatch/v2,https://github.com/gomodules/jsonpatch/blob/v2.2.0/v2/LICENSE,Apache-2.0
181-
google.golang.org/protobuf,https://github.com/protocolbuffers/protobuf-go/blob/v1.28.0/LICENSE,BSD-3-Clause
174+
golang.org/x/oauth2,https://cs.opensource.google/go/x/oauth2/+/v0.8.0:LICENSE,BSD-3-Clause
175+
golang.org/x/sync,https://cs.opensource.google/go/x/sync/+/v0.2.0:LICENSE,BSD-3-Clause
176+
golang.org/x/sys/unix,https://cs.opensource.google/go/x/sys/+/v0.15.0:LICENSE,BSD-3-Clause
177+
golang.org/x/term,https://cs.opensource.google/go/x/term/+/v0.15.0:LICENSE,BSD-3-Clause
178+
golang.org/x/text,https://cs.opensource.google/go/x/text/+/v0.14.0:LICENSE,BSD-3-Clause
179+
golang.org/x/time/rate,https://cs.opensource.google/go/x/time/+/v0.3.0:LICENSE,BSD-3-Clause
180+
gomodules.xyz/jsonpatch/v2,https://github.com/gomodules/jsonpatch/blob/v2.4.0/v2/LICENSE,Apache-2.0
181+
google.golang.org/protobuf,https://github.com/protocolbuffers/protobuf-go/blob/v1.30.0/LICENSE,BSD-3-Clause
182182
gopkg.in/inf.v0,https://github.com/go-inf/inf/blob/v0.9.1/LICENSE,BSD-3-Clause
183183
gopkg.in/natefinch/lumberjack.v2,https://github.com/natefinch/lumberjack/blob/v2.2.1/LICENSE,MIT
184184
gopkg.in/yaml.v2,https://github.com/go-yaml/yaml/blob/v2.4.0/LICENSE,Apache-2.0
185185
gopkg.in/yaml.v3,https://github.com/go-yaml/yaml/blob/v3.0.1/LICENSE,MIT
186-
k8s.io/api,https://github.com/kubernetes/api/blob/v0.25.12/LICENSE,Apache-2.0
187-
k8s.io/apiextensions-apiserver/pkg,https://github.com/kubernetes/apiextensions-apiserver/blob/v0.24.14/LICENSE,Apache-2.0
188-
k8s.io/apimachinery/pkg,https://github.com/kubernetes/apimachinery/blob/v0.25.12/LICENSE,Apache-2.0
189-
k8s.io/apimachinery/third_party/forked/golang,https://github.com/kubernetes/apimachinery/blob/v0.25.12/third_party/forked/golang/LICENSE,BSD-3-Clause
190-
k8s.io/client-go,https://github.com/kubernetes/client-go/blob/v0.25.12/LICENSE,Apache-2.0
191-
k8s.io/client-go/third_party/forked/golang/template,https://github.com/kubernetes/client-go/blob/v0.25.12/third_party/forked/golang/LICENSE,BSD-3-Clause
192-
k8s.io/component-base/config,https://github.com/kubernetes/component-base/blob/v0.24.14/LICENSE,Apache-2.0
193-
k8s.io/klog/v2,https://github.com/kubernetes/klog/blob/v2.70.1/LICENSE,Apache-2.0
194-
k8s.io/kube-openapi/pkg,https://github.com/kubernetes/kube-openapi/blob/67bda5d908f1/LICENSE,Apache-2.0
195-
k8s.io/kube-openapi/pkg/validation/spec,https://github.com/kubernetes/kube-openapi/blob/67bda5d908f1/pkg/validation/spec/LICENSE,Apache-2.0
196-
k8s.io/utils,https://github.com/kubernetes/utils/blob/ee6ede2d64ed/LICENSE,Apache-2.0
197-
k8s.io/utils/internal/third_party/forked/golang/net,https://github.com/kubernetes/utils/blob/ee6ede2d64ed/internal/third_party/forked/golang/LICENSE,BSD-3-Clause
198-
sigs.k8s.io/controller-runtime,https://github.com/kubernetes-sigs/controller-runtime/blob/v0.12.3/LICENSE,Apache-2.0
199-
sigs.k8s.io/json,https://github.com/kubernetes-sigs/json/blob/f223a00ba0e2/LICENSE,Apache-2.0
186+
k8s.io/api,https://github.com/kubernetes/api/blob/v0.28.3/LICENSE,Apache-2.0
187+
k8s.io/apiextensions-apiserver/pkg,https://github.com/kubernetes/apiextensions-apiserver/blob/v0.28.3/LICENSE,Apache-2.0
188+
k8s.io/apimachinery/pkg,https://github.com/kubernetes/apimachinery/blob/v0.28.3/LICENSE,Apache-2.0
189+
k8s.io/apimachinery/third_party/forked/golang,https://github.com/kubernetes/apimachinery/blob/v0.28.3/third_party/forked/golang/LICENSE,BSD-3-Clause
190+
k8s.io/client-go,https://github.com/kubernetes/client-go/blob/v0.28.3/LICENSE,Apache-2.0
191+
k8s.io/component-base/config,https://github.com/kubernetes/component-base/blob/v0.28.3/LICENSE,Apache-2.0
192+
k8s.io/klog/v2,https://github.com/kubernetes/klog/blob/v2.100.1/LICENSE,Apache-2.0
193+
k8s.io/kube-openapi/pkg,https://github.com/kubernetes/kube-openapi/blob/2695361300d9/LICENSE,Apache-2.0
194+
k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json,https://github.com/kubernetes/kube-openapi/blob/2695361300d9/pkg/internal/third_party/go-json-experiment/json/LICENSE,BSD-3-Clause
195+
k8s.io/kube-openapi/pkg/validation/spec,https://github.com/kubernetes/kube-openapi/blob/2695361300d9/pkg/validation/spec/LICENSE,Apache-2.0
196+
k8s.io/utils,https://github.com/kubernetes/utils/blob/d93618cff8a2/LICENSE,Apache-2.0
197+
k8s.io/utils/internal/third_party/forked/golang/net,https://github.com/kubernetes/utils/blob/d93618cff8a2/internal/third_party/forked/golang/LICENSE,BSD-3-Clause
198+
sigs.k8s.io/controller-runtime,https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/LICENSE,Apache-2.0
199+
sigs.k8s.io/json,https://github.com/kubernetes-sigs/json/blob/bc3834ca7abd/LICENSE,Apache-2.0
200200
sigs.k8s.io/structured-merge-diff/v4,https://github.com/kubernetes-sigs/structured-merge-diff/blob/v4.2.3/LICENSE,Apache-2.0
201-
sigs.k8s.io/yaml,https://github.com/kubernetes-sigs/yaml/blob/v1.3.0/LICENSE,MIT
201+
sigs.k8s.io/yaml,https://github.com/kubernetes-sigs/yaml/blob/v1.4.0/LICENSE,Apache-2.0
202+
sigs.k8s.io/yaml/goyaml.v2,https://github.com/kubernetes-sigs/yaml/blob/v1.4.0/goyaml.v2/LICENSE,Apache-2.0

test/e2e/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (c *E2ETestClient) Execute(pod corev1.Pod, containerName, command string) (
170170
if err != nil {
171171
return "", err
172172
}
173-
err = exec.Stream(remotecommand.StreamOptions{
173+
err = exec.StreamWithContext(context.Background(), remotecommand.StreamOptions{
174174
Stdout: buf,
175175
Stderr: errBuf,
176176
})

test/e2e/util/mongotester/mongotester.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ func (m *Tester) connectivityCheck(shouldSucceed bool, opts ...OptionApplier) fu
252252
}
253253

254254
attempts := 0
255+
255256
// There can be a short time before the user can auth as the user
256-
err := wait.Poll(connectivityOpts.IntervalTime, connectivityOpts.TimeoutTime, func() (done bool, err error) {
257+
err := wait.PollUntilContextTimeout(ctx, connectivityOpts.IntervalTime, connectivityOpts.TimeoutTime, true, func(ctx context.Context) (done bool, err error) {
257258
attempts++
258259
collection := m.mongoClient.Database(connectivityOpts.Database).Collection(connectivityOpts.Collection)
259260
_, err = collection.InsertOne(ctx, bson.M{"name": "pi", "value": 3.14159})

0 commit comments

Comments
 (0)