From c54821870154c5a78d7b031c366ba4bcf4d61dde Mon Sep 17 00:00:00 2001 From: Jose Vazquez Date: Wed, 10 Jan 2024 17:24:51 +0100 Subject: [PATCH] CLOUDP-222001: Move pkg/utils under internal --- cmd/manager/main.go | 2 +- cmd/post-install/main.go | 2 +- {pkg/util => internal}/collection/collection.go | 0 {pkg/util => internal}/collection/collection_test.go | 0 {pkg/util => internal/compare}/comparation.go | 2 +- {pkg/util => internal}/compat/json_slice_merge.go | 0 .../compat/json_slice_merge_test.go | 2 +- {pkg/util => internal}/compat/jsoncopy.go | 0 {pkg/util => internal}/compat/jsoncopy_test.go | 2 +- {pkg/util => internal}/httputil/decoratedclient.go | 0 .../httputil/decoratedclient_test.go | 0 {pkg/util => internal}/httputil/digestclient.go | 0 {pkg/util => internal}/httputil/loggedclient.go | 0 {pkg/util => internal}/httputil/transportclient.go | 0 {pkg/util => internal}/kube/kube.go | 0 {pkg/util => internal}/kube/kube_test.go | 0 {pkg/util => internal}/set/identifiable.go | 0 {pkg/util => internal}/set/identifiable_test.go | 0 {pkg/util => internal}/stringutil/stringutil.go | 0 {pkg/util => internal}/timeutil/timeutil.go | 0 {pkg/util => internal}/timeutil/timeutil_test.go | 0 {pkg/util => internal}/toptr/toptr.go | 0 pkg/api/v1/alert_configurations.go | 12 ++++++------ pkg/api/v1/atlasbackupschedule_types_test.go | 2 +- pkg/api/v1/atlasdatabaseuser_types.go | 4 ++-- pkg/api/v1/atlasdatafederation_types.go | 4 ++-- pkg/api/v1/atlasdatafederation_types_test.go | 2 +- pkg/api/v1/atlasdeployment_types.go | 6 +++--- pkg/api/v1/atlasdeployment_types_test.go | 2 +- pkg/api/v1/atlasfederatedauth_types.go | 2 +- pkg/api/v1/atlasfederatedauth_types_test.go | 2 +- pkg/api/v1/atlasproject_types.go | 2 +- pkg/api/v1/atlasteam_types.go | 2 +- pkg/api/v1/auditing.go | 2 +- pkg/api/v1/common/common.go | 2 +- pkg/api/v1/custom_roles_test.go | 2 +- pkg/api/v1/encryption_at_rest.go | 2 +- pkg/api/v1/networkpeer.go | 2 +- pkg/api/v1/privateendpoint.go | 2 +- pkg/api/v1/project/ipaccesslist.go | 2 +- pkg/api/v1/project_settings.go | 2 +- pkg/api/v1/status/atlasdeployment.go | 2 +- pkg/api/v1/status/backuppolicy.go | 2 +- pkg/api/v1/status/backupschedule.go | 2 +- pkg/controller/atlas/provider.go | 2 +- pkg/controller/atlasdatabaseuser/databaseuser.go | 4 ++-- .../atlasdatabaseuser/databaseuser_test.go | 2 +- .../atlasdatafederation/connectionsecrets.go | 2 +- pkg/controller/atlasdatafederation/datafederation.go | 2 +- .../atlasdatafederation/datafederation_controller.go | 2 +- .../atlasdatafederation/private_endpoint.go | 2 +- .../atlasdeployment/advanced_deployment.go | 6 +++--- .../atlasdeployment/advanced_deployment_test.go | 2 +- .../atlasdeployment/atlasdeployment_controller.go | 4 ++-- .../atlasdeployment_controller_test.go | 4 ++-- pkg/controller/atlasdeployment/backup.go | 4 ++-- pkg/controller/atlasdeployment/deployment_test.go | 2 +- pkg/controller/atlasdeployment/managed_namespaces.go | 6 +++--- .../atlasdeployment/region_configuration.go | 4 ++-- .../atlasdeployment/region_configuration_test.go | 2 +- .../atlasdeployment/serverless_private_endpoint.go | 2 +- .../atlasproject/atlasproject_controller.go | 2 +- pkg/controller/atlasproject/auditing.go | 2 +- pkg/controller/atlasproject/auditing_test.go | 2 +- .../atlasproject/cloud_provider_integration.go | 2 +- pkg/controller/atlasproject/custom_roles_test.go | 2 +- pkg/controller/atlasproject/encryption_at_rest.go | 2 +- .../atlasproject/encryption_at_rest_test.go | 2 +- pkg/controller/atlasproject/integrations.go | 2 +- pkg/controller/atlasproject/ipaccess_list.go | 2 +- pkg/controller/atlasproject/maintenancewindow.go | 2 +- .../atlasproject/maintenancewindow_test.go | 2 +- pkg/controller/atlasproject/network_peering.go | 4 ++-- pkg/controller/atlasproject/private_endpoint.go | 2 +- pkg/controller/atlasproject/project_settings.go | 2 +- pkg/controller/atlasproject/project_settings_test.go | 2 +- pkg/controller/atlasproject/teams.go | 2 +- pkg/controller/connectionsecret/connectionsecrets.go | 4 ++-- pkg/controller/connectionsecret/ensuresecret.go | 2 +- pkg/controller/connectionsecret/ensuresecret_test.go | 2 +- pkg/controller/connectionsecret/listsecrets.go | 2 +- pkg/controller/customresource/finalizer.go | 2 +- pkg/controller/statushandler/handler.go | 2 +- pkg/controller/statushandler/patch_test.go | 2 +- pkg/controller/validate/validate.go | 2 +- pkg/controller/validate/validate_test.go | 2 +- pkg/controller/watch/event_handler.go | 2 +- pkg/controller/watch/resource_watcher_test.go | 2 +- .../watch/watched_resource_handler_test.go | 2 +- test/e2e/alert_config_test.go | 6 +++--- test/e2e/atlas_gov_test.go | 2 +- test/e2e/backup_config_test.go | 2 +- test/e2e/custom_roles_test.go | 2 +- test/e2e/db_users_test.go | 2 +- test/e2e/encryption_at_rest_test.go | 2 +- test/e2e/global_deployment_test.go | 2 +- test/e2e/multinamespace_test.go | 2 +- test/e2e/project_deletion_protection_test.go | 2 +- test/e2e/project_settings_test.go | 2 +- test/helper/access/ipaccesslist_matcher.go | 2 +- test/helper/e2e/actions/cloud/aws.go | 2 +- test/helper/e2e/actions/cloud/azure.go | 2 +- test/helper/e2e/actions/cloud/gcp.go | 2 +- test/helper/e2e/data/deployments.go | 2 +- test/helper/resources/customresources.go | 2 +- test/int/backup_protected_test.go | 4 ++-- test/int/clusterwide/integration_suite_test.go | 4 ++-- test/int/databaseuser_protected_test.go | 2 +- test/int/databaseuser_unprotected_test.go | 4 ++-- test/int/datafederation_test.go | 2 +- test/int/deployment_protected_test.go | 2 +- test/int/deployment_test.go | 6 +++--- test/int/deployment_unprotected_test.go | 2 +- test/int/federated_auth_test.go | 2 +- test/int/integration_suite_test.go | 4 ++-- test/int/project_protect_test.go | 2 +- test/int/project_test.go | 2 +- 117 files changed, 128 insertions(+), 128 deletions(-) rename {pkg/util => internal}/collection/collection.go (100%) rename {pkg/util => internal}/collection/collection_test.go (100%) rename {pkg/util => internal/compare}/comparation.go (97%) rename {pkg/util => internal}/compat/json_slice_merge.go (100%) rename {pkg/util => internal}/compat/json_slice_merge_test.go (97%) rename {pkg/util => internal}/compat/jsoncopy.go (100%) rename {pkg/util => internal}/compat/jsoncopy_test.go (91%) rename {pkg/util => internal}/httputil/decoratedclient.go (100%) rename {pkg/util => internal}/httputil/decoratedclient_test.go (100%) rename {pkg/util => internal}/httputil/digestclient.go (100%) rename {pkg/util => internal}/httputil/loggedclient.go (100%) rename {pkg/util => internal}/httputil/transportclient.go (100%) rename {pkg/util => internal}/kube/kube.go (100%) rename {pkg/util => internal}/kube/kube_test.go (100%) rename {pkg/util => internal}/set/identifiable.go (100%) rename {pkg/util => internal}/set/identifiable_test.go (100%) rename {pkg/util => internal}/stringutil/stringutil.go (100%) rename {pkg/util => internal}/timeutil/timeutil.go (100%) rename {pkg/util => internal}/timeutil/timeutil_test.go (100%) rename {pkg/util => internal}/toptr/toptr.go (100%) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 8e95ab0e3f..9100a41ed0 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -46,6 +46,7 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller" "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/featureflags" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasdatabaseuser" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasdatafederation" @@ -54,7 +55,6 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasproject" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/connectionsecret" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/watch" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/version" ) diff --git a/cmd/post-install/main.go b/cmd/post-install/main.go index 226478be25..e4494f975f 100644 --- a/cmd/post-install/main.go +++ b/cmd/post-install/main.go @@ -7,9 +7,9 @@ import ( "go.uber.org/zap" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/util/collection/collection.go b/internal/collection/collection.go similarity index 100% rename from pkg/util/collection/collection.go rename to internal/collection/collection.go diff --git a/pkg/util/collection/collection_test.go b/internal/collection/collection_test.go similarity index 100% rename from pkg/util/collection/collection_test.go rename to internal/collection/collection_test.go diff --git a/pkg/util/comparation.go b/internal/compare/comparation.go similarity index 97% rename from pkg/util/comparation.go rename to internal/compare/comparation.go index 7d6d74ac80..7a070f1adc 100644 --- a/pkg/util/comparation.go +++ b/internal/compare/comparation.go @@ -1,4 +1,4 @@ -package util +package compare func IsEqualWithoutOrder[T comparable](a, b []T) bool { if len(a) != len(b) { diff --git a/pkg/util/compat/json_slice_merge.go b/internal/compat/json_slice_merge.go similarity index 100% rename from pkg/util/compat/json_slice_merge.go rename to internal/compat/json_slice_merge.go diff --git a/pkg/util/compat/json_slice_merge_test.go b/internal/compat/json_slice_merge_test.go similarity index 97% rename from pkg/util/compat/json_slice_merge_test.go rename to internal/compat/json_slice_merge_test.go index 8dd1a0596e..f1d72c25a5 100644 --- a/pkg/util/compat/json_slice_merge_test.go +++ b/internal/compat/json_slice_merge_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - . "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" + . "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" ) func TestJSONSliceMerge(t *testing.T) { diff --git a/pkg/util/compat/jsoncopy.go b/internal/compat/jsoncopy.go similarity index 100% rename from pkg/util/compat/jsoncopy.go rename to internal/compat/jsoncopy.go diff --git a/pkg/util/compat/jsoncopy_test.go b/internal/compat/jsoncopy_test.go similarity index 91% rename from pkg/util/compat/jsoncopy_test.go rename to internal/compat/jsoncopy_test.go index 136d0065b9..eb7e75056f 100644 --- a/pkg/util/compat/jsoncopy_test.go +++ b/internal/compat/jsoncopy_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - . "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" + . "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" ) // JSONCopy will copy src to dst via JSON serialization/deserialization. diff --git a/pkg/util/httputil/decoratedclient.go b/internal/httputil/decoratedclient.go similarity index 100% rename from pkg/util/httputil/decoratedclient.go rename to internal/httputil/decoratedclient.go diff --git a/pkg/util/httputil/decoratedclient_test.go b/internal/httputil/decoratedclient_test.go similarity index 100% rename from pkg/util/httputil/decoratedclient_test.go rename to internal/httputil/decoratedclient_test.go diff --git a/pkg/util/httputil/digestclient.go b/internal/httputil/digestclient.go similarity index 100% rename from pkg/util/httputil/digestclient.go rename to internal/httputil/digestclient.go diff --git a/pkg/util/httputil/loggedclient.go b/internal/httputil/loggedclient.go similarity index 100% rename from pkg/util/httputil/loggedclient.go rename to internal/httputil/loggedclient.go diff --git a/pkg/util/httputil/transportclient.go b/internal/httputil/transportclient.go similarity index 100% rename from pkg/util/httputil/transportclient.go rename to internal/httputil/transportclient.go diff --git a/pkg/util/kube/kube.go b/internal/kube/kube.go similarity index 100% rename from pkg/util/kube/kube.go rename to internal/kube/kube.go diff --git a/pkg/util/kube/kube_test.go b/internal/kube/kube_test.go similarity index 100% rename from pkg/util/kube/kube_test.go rename to internal/kube/kube_test.go diff --git a/pkg/util/set/identifiable.go b/internal/set/identifiable.go similarity index 100% rename from pkg/util/set/identifiable.go rename to internal/set/identifiable.go diff --git a/pkg/util/set/identifiable_test.go b/internal/set/identifiable_test.go similarity index 100% rename from pkg/util/set/identifiable_test.go rename to internal/set/identifiable_test.go diff --git a/pkg/util/stringutil/stringutil.go b/internal/stringutil/stringutil.go similarity index 100% rename from pkg/util/stringutil/stringutil.go rename to internal/stringutil/stringutil.go diff --git a/pkg/util/timeutil/timeutil.go b/internal/timeutil/timeutil.go similarity index 100% rename from pkg/util/timeutil/timeutil.go rename to internal/timeutil/timeutil.go diff --git a/pkg/util/timeutil/timeutil_test.go b/internal/timeutil/timeutil_test.go similarity index 100% rename from pkg/util/timeutil/timeutil_test.go rename to internal/timeutil/timeutil_test.go diff --git a/pkg/util/toptr/toptr.go b/internal/toptr/toptr.go similarity index 100% rename from pkg/util/toptr/toptr.go rename to internal/toptr/toptr.go diff --git a/pkg/api/v1/alert_configurations.go b/pkg/api/v1/alert_configurations.go index ffe8eefdc8..10e0f23054 100644 --- a/pkg/api/v1/alert_configurations.go +++ b/pkg/api/v1/alert_configurations.go @@ -7,9 +7,9 @@ import ( "go.mongodb.org/atlas/mongodbatlas" "go.uber.org/zap" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compare" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" ) type AlertConfiguration struct { @@ -231,9 +231,9 @@ func (in *Notification) IsEqual(notification mongodbatlas.Notification) bool { in.ChannelName != notification.ChannelName || in.datadogAPIKey != notification.DatadogAPIKey || in.DatadogRegion != notification.DatadogRegion || - !util.PtrValuesEqual(in.DelayMin, notification.DelayMin) || + !compare.PtrValuesEqual(in.DelayMin, notification.DelayMin) || in.EmailAddress != notification.EmailAddress || - !util.PtrValuesEqual(in.EmailEnabled, notification.EmailEnabled) || + !compare.PtrValuesEqual(in.EmailEnabled, notification.EmailEnabled) || in.flowdockAPIToken != notification.FlowdockAPIToken || in.FlowName != notification.FlowName || in.IntervalMin != notification.IntervalMin || @@ -242,7 +242,7 @@ func (in *Notification) IsEqual(notification mongodbatlas.Notification) bool { in.OpsGenieRegion != notification.OpsGenieRegion || in.OrgName != notification.OrgName || in.serviceKey != notification.ServiceKey || - !util.PtrValuesEqual(in.SMSEnabled, notification.SMSEnabled) || + !compare.PtrValuesEqual(in.SMSEnabled, notification.SMSEnabled) || in.TeamID != notification.TeamID || in.TeamName != notification.TeamName || in.TypeName != notification.TypeName || @@ -252,7 +252,7 @@ func (in *Notification) IsEqual(notification mongodbatlas.Notification) bool { return false } - if !util.IsEqualWithoutOrder(in.Roles, notification.Roles) { + if !compare.IsEqualWithoutOrder(in.Roles, notification.Roles) { return false } diff --git a/pkg/api/v1/atlasbackupschedule_types_test.go b/pkg/api/v1/atlasbackupschedule_types_test.go index 42552cac9d..81b2bf3b54 100644 --- a/pkg/api/v1/atlasbackupschedule_types_test.go +++ b/pkg/api/v1/atlasbackupschedule_types_test.go @@ -6,7 +6,7 @@ import ( "github.com/go-test/deep" "go.mongodb.org/atlas/mongodbatlas" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" ) func Test_BackupScheduleToAtlas(t *testing.T) { diff --git a/pkg/api/v1/atlasdatabaseuser_types.go b/pkg/api/v1/atlasdatabaseuser_types.go index baa5f505df..399bcc6ef2 100644 --- a/pkg/api/v1/atlasdatabaseuser_types.go +++ b/pkg/api/v1/atlasdatabaseuser_types.go @@ -25,10 +25,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) // Important: diff --git a/pkg/api/v1/atlasdatafederation_types.go b/pkg/api/v1/atlasdatafederation_types.go index f48a04ee5f..1f680ca0de 100644 --- a/pkg/api/v1/atlasdatafederation_types.go +++ b/pkg/api/v1/atlasdatafederation_types.go @@ -21,11 +21,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) func init() { diff --git a/pkg/api/v1/atlasdatafederation_types_test.go b/pkg/api/v1/atlasdatafederation_types_test.go index a63a6c722e..6f42f6f985 100644 --- a/pkg/api/v1/atlasdatafederation_types_test.go +++ b/pkg/api/v1/atlasdatafederation_types_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/assert" "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) func TestAtlasDataFederation_ToAtlas(t *testing.T) { diff --git a/pkg/api/v1/atlasdeployment_types.go b/pkg/api/v1/atlasdeployment_types.go index e8b5c5739a..0ab2c61afa 100644 --- a/pkg/api/v1/atlasdeployment_types.go +++ b/pkg/api/v1/atlasdeployment_types.go @@ -31,9 +31,9 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/provider" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" ) func init() { diff --git a/pkg/api/v1/atlasdeployment_types_test.go b/pkg/api/v1/atlasdeployment_types_test.go index 86bc954ea9..307841f73d 100644 --- a/pkg/api/v1/atlasdeployment_types_test.go +++ b/pkg/api/v1/atlasdeployment_types_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "go.mongodb.org/atlas/mongodbatlas" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" ) var ( diff --git a/pkg/api/v1/atlasfederatedauth_types.go b/pkg/api/v1/atlasfederatedauth_types.go index 0b41131b9a..52a6b27bdd 100644 --- a/pkg/api/v1/atlasfederatedauth_types.go +++ b/pkg/api/v1/atlasfederatedauth_types.go @@ -8,9 +8,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) func init() { diff --git a/pkg/api/v1/atlasfederatedauth_types_test.go b/pkg/api/v1/atlasfederatedauth_types_test.go index fa66bcd943..fcbc0b6e01 100644 --- a/pkg/api/v1/atlasfederatedauth_types_test.go +++ b/pkg/api/v1/atlasfederatedauth_types_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) func Test_FederatedAuthSpec_ToAtlas(t *testing.T) { diff --git a/pkg/api/v1/atlasproject_types.go b/pkg/api/v1/atlasproject_types.go index 733310fdce..e9dd0c46f5 100644 --- a/pkg/api/v1/atlasproject_types.go +++ b/pkg/api/v1/atlasproject_types.go @@ -21,10 +21,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) // Important: diff --git a/pkg/api/v1/atlasteam_types.go b/pkg/api/v1/atlasteam_types.go index 5f12725f71..0e68c4651d 100644 --- a/pkg/api/v1/atlasteam_types.go +++ b/pkg/api/v1/atlasteam_types.go @@ -17,8 +17,8 @@ limitations under the License. package v1 import ( + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" "go.mongodb.org/atlas/mongodbatlas" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/api/v1/auditing.go b/pkg/api/v1/auditing.go index 6c13b28782..833b07a688 100644 --- a/pkg/api/v1/auditing.go +++ b/pkg/api/v1/auditing.go @@ -5,7 +5,7 @@ import ( "go.mongodb.org/atlas/mongodbatlas" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" ) // Auditing represents MongoDB Maintenance Windows diff --git a/pkg/api/v1/common/common.go b/pkg/api/v1/common/common.go index 0a52eaf349..696ca1ae48 100644 --- a/pkg/api/v1/common/common.go +++ b/pkg/api/v1/common/common.go @@ -7,7 +7,7 @@ import ( v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" ) /* diff --git a/pkg/api/v1/custom_roles_test.go b/pkg/api/v1/custom_roles_test.go index e58002f136..72b807fbe0 100644 --- a/pkg/api/v1/custom_roles_test.go +++ b/pkg/api/v1/custom_roles_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "go.mongodb.org/atlas/mongodbatlas" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" ) func TestAtlasCustomRoles_ToAtlas(t *testing.T) { diff --git a/pkg/api/v1/encryption_at_rest.go b/pkg/api/v1/encryption_at_rest.go index e25ff98266..750b12120b 100644 --- a/pkg/api/v1/encryption_at_rest.go +++ b/pkg/api/v1/encryption_at_rest.go @@ -1,7 +1,7 @@ package v1 import ( - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" "go.mongodb.org/atlas/mongodbatlas" diff --git a/pkg/api/v1/networkpeer.go b/pkg/api/v1/networkpeer.go index 9053226d04..104a0115cd 100644 --- a/pkg/api/v1/networkpeer.go +++ b/pkg/api/v1/networkpeer.go @@ -3,8 +3,8 @@ package v1 import ( "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/provider" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" ) type NetworkPeer struct { diff --git a/pkg/api/v1/privateendpoint.go b/pkg/api/v1/privateendpoint.go index fa42f78e22..238d12d6f7 100644 --- a/pkg/api/v1/privateendpoint.go +++ b/pkg/api/v1/privateendpoint.go @@ -5,9 +5,9 @@ import ( "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/provider" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" ) type PrivateEndpoint struct { diff --git a/pkg/api/v1/project/ipaccesslist.go b/pkg/api/v1/project/ipaccesslist.go index 6ac4397621..0aae356e84 100644 --- a/pkg/api/v1/project/ipaccesslist.go +++ b/pkg/api/v1/project/ipaccesslist.go @@ -5,7 +5,7 @@ import ( "go.mongodb.org/atlas/mongodbatlas" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" ) type IPAccessList struct { diff --git a/pkg/api/v1/project_settings.go b/pkg/api/v1/project_settings.go index 87114d5be5..19c60f464e 100644 --- a/pkg/api/v1/project_settings.go +++ b/pkg/api/v1/project_settings.go @@ -3,7 +3,7 @@ package v1 import ( "go.mongodb.org/atlas/mongodbatlas" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" ) type ProjectSettings struct { diff --git a/pkg/api/v1/status/atlasdeployment.go b/pkg/api/v1/status/atlasdeployment.go index d175b78f73..c582a6bf66 100644 --- a/pkg/api/v1/status/atlasdeployment.go +++ b/pkg/api/v1/status/atlasdeployment.go @@ -3,7 +3,7 @@ package status import ( "go.mongodb.org/atlas/mongodbatlas" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" ) // AtlasDeploymentStatus defines the observed state of AtlasDeployment. diff --git a/pkg/api/v1/status/backuppolicy.go b/pkg/api/v1/status/backuppolicy.go index 9e8b6133ac..4eb8337979 100644 --- a/pkg/api/v1/status/backuppolicy.go +++ b/pkg/api/v1/status/backuppolicy.go @@ -1,6 +1,6 @@ package status -import "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/collection" +import "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/collection" // +k8s:deepcopy-gen=false diff --git a/pkg/api/v1/status/backupschedule.go b/pkg/api/v1/status/backupschedule.go index a3a8fadf79..805c0a327c 100644 --- a/pkg/api/v1/status/backupschedule.go +++ b/pkg/api/v1/status/backupschedule.go @@ -1,6 +1,6 @@ package status -import "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/collection" +import "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/collection" // +k8s:deepcopy-gen=false diff --git a/pkg/controller/atlas/provider.go b/pkg/controller/atlas/provider.go index f9dcf26792..870e20fa96 100644 --- a/pkg/controller/atlas/provider.go +++ b/pkg/controller/atlas/provider.go @@ -13,8 +13,8 @@ import ( corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/httputil" akov2 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/httputil" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/version" ) diff --git a/pkg/controller/atlasdatabaseuser/databaseuser.go b/pkg/controller/atlasdatabaseuser/databaseuser.go index c046aa42fd..e6c6514b84 100644 --- a/pkg/controller/atlasdatabaseuser/databaseuser.go +++ b/pkg/controller/atlasdatabaseuser/databaseuser.go @@ -13,14 +13,14 @@ import ( corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/timeutil" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasdeployment" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/connectionsecret" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/timeutil" ) func (r *AtlasDatabaseUserReconciler) ensureDatabaseUser(ctx *workflow.Context, project mdbv1.AtlasProject, dbUser mdbv1.AtlasDatabaseUser) workflow.Result { diff --git a/pkg/controller/atlasdatabaseuser/databaseuser_test.go b/pkg/controller/atlasdatabaseuser/databaseuser_test.go index d91e9d84ca..a5a0b9fbef 100644 --- a/pkg/controller/atlasdatabaseuser/databaseuser_test.go +++ b/pkg/controller/atlasdatabaseuser/databaseuser_test.go @@ -16,11 +16,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/connectionsecret" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) func init() { diff --git a/pkg/controller/atlasdatafederation/connectionsecrets.go b/pkg/controller/atlasdatafederation/connectionsecrets.go index 2a1168e3d0..8ccb17abcf 100644 --- a/pkg/controller/atlasdatafederation/connectionsecrets.go +++ b/pkg/controller/atlasdatafederation/connectionsecrets.go @@ -7,11 +7,11 @@ import ( v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/stringutil" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/connectionsecret" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/stringutil" ) func (r *AtlasDataFederationReconciler) ensureConnectionSecrets(ctx *workflow.Context, project *mdbv1.AtlasProject, df *mdbv1.AtlasDataFederation) workflow.Result { diff --git a/pkg/controller/atlasdatafederation/datafederation.go b/pkg/controller/atlasdatafederation/datafederation.go index f0c60c5cab..d461015ca8 100644 --- a/pkg/controller/atlasdatafederation/datafederation.go +++ b/pkg/controller/atlasdatafederation/datafederation.go @@ -9,10 +9,10 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "go.uber.org/zap" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" ) func (r *AtlasDataFederationReconciler) ensureDataFederation(ctx *workflow.Context, project *mdbv1.AtlasProject, dataFederation *mdbv1.AtlasDataFederation) workflow.Result { diff --git a/pkg/controller/atlasdatafederation/datafederation_controller.go b/pkg/controller/atlasdatafederation/datafederation_controller.go index 6d50ff58ac..6d2daa7d7f 100644 --- a/pkg/controller/atlasdatafederation/datafederation_controller.go +++ b/pkg/controller/atlasdatafederation/datafederation_controller.go @@ -21,6 +21,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/predicate" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlas" @@ -28,7 +29,6 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/statushandler" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/watch" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) // AtlasDataFederationReconciler reconciles an DataFederation object diff --git a/pkg/controller/atlasdatafederation/private_endpoint.go b/pkg/controller/atlasdatafederation/private_endpoint.go index 0252459eb9..fce2e763a9 100644 --- a/pkg/controller/atlasdatafederation/private_endpoint.go +++ b/pkg/controller/atlasdatafederation/private_endpoint.go @@ -3,10 +3,10 @@ package atlasdatafederation import ( "context" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/set" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/set" ) func (r *AtlasDataFederationReconciler) ensurePrivateEndpoints(ctx *workflow.Context, project *mdbv1.AtlasProject, dataFederation *mdbv1.AtlasDataFederation) workflow.Result { diff --git a/pkg/controller/atlasdeployment/advanced_deployment.go b/pkg/controller/atlasdeployment/advanced_deployment.go index 58d1a73033..418386795e 100644 --- a/pkg/controller/atlasdeployment/advanced_deployment.go +++ b/pkg/controller/atlasdeployment/advanced_deployment.go @@ -13,13 +13,13 @@ import ( v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/stringutil" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/connectionsecret" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/stringutil" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) const FreeTier = "M0" diff --git a/pkg/controller/atlasdeployment/advanced_deployment_test.go b/pkg/controller/atlasdeployment/advanced_deployment_test.go index ffc45db1fd..34e9919448 100644 --- a/pkg/controller/atlasdeployment/advanced_deployment_test.go +++ b/pkg/controller/atlasdeployment/advanced_deployment_test.go @@ -5,8 +5,8 @@ import ( "go.uber.org/zap" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "github.com/stretchr/testify/assert" "go.mongodb.org/atlas/mongodbatlas" diff --git a/pkg/controller/atlasdeployment/atlasdeployment_controller.go b/pkg/controller/atlasdeployment/atlasdeployment_controller.go index 1bdad869b5..5e1bdff60b 100644 --- a/pkg/controller/atlasdeployment/atlasdeployment_controller.go +++ b/pkg/controller/atlasdeployment/atlasdeployment_controller.go @@ -38,6 +38,8 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/provider" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" @@ -48,8 +50,6 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/validate" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/watch" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) // AtlasDeploymentReconciler reconciles an AtlasDeployment object diff --git a/pkg/controller/atlasdeployment/atlasdeployment_controller_test.go b/pkg/controller/atlasdeployment/atlasdeployment_controller_test.go index 66c86f3dca..48c57488db 100644 --- a/pkg/controller/atlasdeployment/atlasdeployment_controller_test.go +++ b/pkg/controller/atlasdeployment/atlasdeployment_controller_test.go @@ -38,7 +38,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" atlas_mock "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/mocks/atlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" v1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" @@ -46,8 +48,6 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/watch" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) const ( diff --git a/pkg/controller/atlasdeployment/backup.go b/pkg/controller/atlasdeployment/backup.go index b98617c21f..cef957470e 100644 --- a/pkg/controller/atlasdeployment/backup.go +++ b/pkg/controller/atlasdeployment/backup.go @@ -10,12 +10,12 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/watch" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" "go.mongodb.org/atlas/mongodbatlas" "golang.org/x/sync/errgroup" diff --git a/pkg/controller/atlasdeployment/deployment_test.go b/pkg/controller/atlasdeployment/deployment_test.go index 11c90c64cd..0256ca14e4 100644 --- a/pkg/controller/atlasdeployment/deployment_test.go +++ b/pkg/controller/atlasdeployment/deployment_test.go @@ -3,9 +3,9 @@ package atlasdeployment import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" v1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) func CreateBasicDeployment(name string) *v1.AtlasDeployment { diff --git a/pkg/controller/atlasdeployment/managed_namespaces.go b/pkg/controller/atlasdeployment/managed_namespaces.go index aa36e8228a..e8191ab29b 100644 --- a/pkg/controller/atlasdeployment/managed_namespaces.go +++ b/pkg/controller/atlasdeployment/managed_namespaces.go @@ -6,10 +6,10 @@ import ( "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compare" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util" ) func EnsureManagedNamespaces(service *workflow.Context, groupID string, clusterType string, managedNamespace []mdbv1.ManagedNamespace, deploymentName string) workflow.Result { @@ -101,8 +101,8 @@ func isManagedNamespaceStateMatch(existing mongodbatlas.ManagedNamespace, desire if existing.Db == desired.Db && existing.Collection == desired.Collection && existing.CustomShardKey == desired.CustomShardKey && - util.PtrValuesEqual(existing.IsShardKeyUnique, desired.IsShardKeyUnique) && - util.PtrValuesEqual(existing.IsCustomShardKeyHashed, desired.IsCustomShardKeyHashed) && + compare.PtrValuesEqual(existing.IsShardKeyUnique, desired.IsShardKeyUnique) && + compare.PtrValuesEqual(existing.IsCustomShardKeyHashed, desired.IsCustomShardKeyHashed) && existing.NumInitialChunks == desired.NumInitialChunks { return true } diff --git a/pkg/controller/atlasdeployment/region_configuration.go b/pkg/controller/atlasdeployment/region_configuration.go index 78b5e7bdf7..b6f3b396e1 100644 --- a/pkg/controller/atlasdeployment/region_configuration.go +++ b/pkg/controller/atlasdeployment/region_configuration.go @@ -1,8 +1,8 @@ package atlasdeployment import ( - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "github.com/google/go-cmp/cmp" "go.mongodb.org/atlas/mongodbatlas" diff --git a/pkg/controller/atlasdeployment/region_configuration_test.go b/pkg/controller/atlasdeployment/region_configuration_test.go index cc3bb19075..1618b2ad79 100644 --- a/pkg/controller/atlasdeployment/region_configuration_test.go +++ b/pkg/controller/atlasdeployment/region_configuration_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) func TestSyncComputeConfiguration(t *testing.T) { diff --git a/pkg/controller/atlasdeployment/serverless_private_endpoint.go b/pkg/controller/atlasdeployment/serverless_private_endpoint.go index bb1f133f18..25b8ea919b 100644 --- a/pkg/controller/atlasdeployment/serverless_private_endpoint.go +++ b/pkg/controller/atlasdeployment/serverless_private_endpoint.go @@ -6,7 +6,7 @@ import ( "fmt" "sort" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/stringutil" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/stringutil" "go.uber.org/zap" diff --git a/pkg/controller/atlasproject/atlasproject_controller.go b/pkg/controller/atlasproject/atlasproject_controller.go index e97a71594e..e9a230ed4c 100644 --- a/pkg/controller/atlasproject/atlasproject_controller.go +++ b/pkg/controller/atlasproject/atlasproject_controller.go @@ -35,6 +35,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/predicate" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/authmode" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" @@ -43,7 +44,6 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/statushandler" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/watch" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) // AtlasProjectReconciler reconciles a AtlasProject object diff --git a/pkg/controller/atlasproject/auditing.go b/pkg/controller/atlasproject/auditing.go index a30780a7ee..e7741d9c5e 100644 --- a/pkg/controller/atlasproject/auditing.go +++ b/pkg/controller/atlasproject/auditing.go @@ -9,10 +9,10 @@ import ( "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" v1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) func ensureAuditing(workflowCtx *workflow.Context, project *v1.AtlasProject, protected bool) workflow.Result { diff --git a/pkg/controller/atlasproject/auditing_test.go b/pkg/controller/atlasproject/auditing_test.go index 3aba6c9209..f69647648b 100644 --- a/pkg/controller/atlasproject/auditing_test.go +++ b/pkg/controller/atlasproject/auditing_test.go @@ -10,10 +10,10 @@ import ( "go.mongodb.org/atlas/mongodbatlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/mocks/atlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) func TestCanAuditingReconcile(t *testing.T) { diff --git a/pkg/controller/atlasproject/cloud_provider_integration.go b/pkg/controller/atlasproject/cloud_provider_integration.go index c0d5bf40f1..4eef00fca7 100644 --- a/pkg/controller/atlasproject/cloud_provider_integration.go +++ b/pkg/controller/atlasproject/cloud_provider_integration.go @@ -8,11 +8,11 @@ import ( "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/set" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/set" ) func ensureCloudProviderIntegration(workflowCtx *workflow.Context, project *mdbv1.AtlasProject, protected bool) workflow.Result { diff --git a/pkg/controller/atlasproject/custom_roles_test.go b/pkg/controller/atlasproject/custom_roles_test.go index e39853f5ef..e37f2883ee 100644 --- a/pkg/controller/atlasproject/custom_roles_test.go +++ b/pkg/controller/atlasproject/custom_roles_test.go @@ -11,11 +11,11 @@ import ( "go.uber.org/zap" "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/mocks/atlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) func TestCalculateChanges(t *testing.T) { diff --git a/pkg/controller/atlasproject/encryption_at_rest.go b/pkg/controller/atlasproject/encryption_at_rest.go index a847c66206..9b0a665333 100644 --- a/pkg/controller/atlasproject/encryption_at_rest.go +++ b/pkg/controller/atlasproject/encryption_at_rest.go @@ -13,12 +13,12 @@ import ( v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/watch" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "go.mongodb.org/atlas/mongodbatlas" ) diff --git a/pkg/controller/atlasproject/encryption_at_rest_test.go b/pkg/controller/atlasproject/encryption_at_rest_test.go index 02ee58b659..c63565852b 100644 --- a/pkg/controller/atlasproject/encryption_at_rest_test.go +++ b/pkg/controller/atlasproject/encryption_at_rest_test.go @@ -14,11 +14,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/mocks/atlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) func TestCanEncryptionAtRestReconcile(t *testing.T) { diff --git a/pkg/controller/atlasproject/integrations.go b/pkg/controller/atlasproject/integrations.go index 988c9e15da..d053cd355c 100644 --- a/pkg/controller/atlasproject/integrations.go +++ b/pkg/controller/atlasproject/integrations.go @@ -15,8 +15,8 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/set" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/set" ) func (r *AtlasProjectReconciler) ensureIntegration(workflowCtx *workflow.Context, akoProject *mdbv1.AtlasProject, protected bool) workflow.Result { diff --git a/pkg/controller/atlasproject/ipaccess_list.go b/pkg/controller/atlasproject/ipaccess_list.go index 7d6667af31..3200951320 100644 --- a/pkg/controller/atlasproject/ipaccess_list.go +++ b/pkg/controller/atlasproject/ipaccess_list.go @@ -17,11 +17,11 @@ import ( "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/timeutil" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/timeutil" ) const ipAccessStatusPending = "PENDING" diff --git a/pkg/controller/atlasproject/maintenancewindow.go b/pkg/controller/atlasproject/maintenancewindow.go index 081772b778..5278968adf 100644 --- a/pkg/controller/atlasproject/maintenancewindow.go +++ b/pkg/controller/atlasproject/maintenancewindow.go @@ -6,7 +6,7 @@ import ( "errors" "fmt" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "go.mongodb.org/atlas/mongodbatlas" diff --git a/pkg/controller/atlasproject/maintenancewindow_test.go b/pkg/controller/atlasproject/maintenancewindow_test.go index 143323a4c1..a6cb7a4c45 100644 --- a/pkg/controller/atlasproject/maintenancewindow_test.go +++ b/pkg/controller/atlasproject/maintenancewindow_test.go @@ -10,11 +10,11 @@ import ( "go.mongodb.org/atlas/mongodbatlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/mocks/atlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) func TestValidateMaintenanceWindow(t *testing.T) { diff --git a/pkg/controller/atlasproject/network_peering.go b/pkg/controller/atlasproject/network_peering.go index fa18d71599..8afa669155 100644 --- a/pkg/controller/atlasproject/network_peering.go +++ b/pkg/controller/atlasproject/network_peering.go @@ -7,6 +7,7 @@ import ( "net/http" "strings" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compare" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "go.mongodb.org/atlas/mongodbatlas" @@ -16,7 +17,6 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/provider" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util" ) const ( @@ -165,7 +165,7 @@ func deleteUnusedContainers(context context.Context, containerService mongodbatl return err } for _, container := range containers { - if !util.Contains(doNotDelete, container.ID) { + if !compare.Contains(doNotDelete, container.ID) { response, errDelete := containerService.Delete(context, groupID, container.ID) if errDelete != nil && response.StatusCode != http.StatusConflict { // AWS peer does not contain container id return errDelete diff --git a/pkg/controller/atlasproject/private_endpoint.go b/pkg/controller/atlasproject/private_endpoint.go index c3eea8b7cb..66cb1b9238 100644 --- a/pkg/controller/atlasproject/private_endpoint.go +++ b/pkg/controller/atlasproject/private_endpoint.go @@ -13,11 +13,11 @@ import ( "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/set" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/provider" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/set" ) func ensurePrivateEndpoint(workflowCtx *workflow.Context, project *mdbv1.AtlasProject, protected bool) workflow.Result { diff --git a/pkg/controller/atlasproject/project_settings.go b/pkg/controller/atlasproject/project_settings.go index 633398f310..501f390d2f 100644 --- a/pkg/controller/atlasproject/project_settings.go +++ b/pkg/controller/atlasproject/project_settings.go @@ -5,7 +5,7 @@ import ( "fmt" "reflect" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "go.mongodb.org/atlas/mongodbatlas" diff --git a/pkg/controller/atlasproject/project_settings_test.go b/pkg/controller/atlasproject/project_settings_test.go index e4f18eda39..66d8199b82 100644 --- a/pkg/controller/atlasproject/project_settings_test.go +++ b/pkg/controller/atlasproject/project_settings_test.go @@ -10,10 +10,10 @@ import ( "go.mongodb.org/atlas/mongodbatlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/mocks/atlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) func TestProjectSettingsReconcile(t *testing.T) { diff --git a/pkg/controller/atlasproject/teams.go b/pkg/controller/atlasproject/teams.go index ab3c8fdf33..e4e11284ea 100644 --- a/pkg/controller/atlasproject/teams.go +++ b/pkg/controller/atlasproject/teams.go @@ -16,13 +16,13 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/statushandler" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/watch" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) type TeamDataContainer struct { diff --git a/pkg/controller/connectionsecret/connectionsecrets.go b/pkg/controller/connectionsecret/connectionsecrets.go index cfa7d43210..eec3698af9 100644 --- a/pkg/controller/connectionsecret/connectionsecrets.go +++ b/pkg/controller/connectionsecret/connectionsecrets.go @@ -10,10 +10,10 @@ import ( "k8s.io/client-go/tools/record" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/stringutil" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/stringutil" ) const ConnectionSecretsEnsuredEvent = "ConnectionSecretsEnsured" diff --git a/pkg/controller/connectionsecret/ensuresecret.go b/pkg/controller/connectionsecret/ensuresecret.go index aae1cad48c..9ec18f3607 100644 --- a/pkg/controller/connectionsecret/ensuresecret.go +++ b/pkg/controller/connectionsecret/ensuresecret.go @@ -10,7 +10,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" ) const ( diff --git a/pkg/controller/connectionsecret/ensuresecret_test.go b/pkg/controller/connectionsecret/ensuresecret_test.go index f93b7332d0..9bfc0ec9a6 100644 --- a/pkg/controller/connectionsecret/ensuresecret_test.go +++ b/pkg/controller/connectionsecret/ensuresecret_test.go @@ -12,8 +12,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) func TestAddCredentialsToConnectionURL(t *testing.T) { diff --git a/pkg/controller/connectionsecret/listsecrets.go b/pkg/controller/connectionsecret/listsecrets.go index 42f11c3490..c7ed006281 100644 --- a/pkg/controller/connectionsecret/listsecrets.go +++ b/pkg/controller/connectionsecret/listsecrets.go @@ -8,7 +8,7 @@ import ( "k8s.io/apimachinery/pkg/labels" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" ) // ListByDeploymentName returns all secrets in the specified namespace that have labels for 'projectID' and 'clusterName' diff --git a/pkg/controller/customresource/finalizer.go b/pkg/controller/customresource/finalizer.go index 5caa97e2c3..4dda229766 100644 --- a/pkg/controller/customresource/finalizer.go +++ b/pkg/controller/customresource/finalizer.go @@ -6,8 +6,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) const FinalizerLabel = "mongodbatlas/finalizer" diff --git a/pkg/controller/statushandler/handler.go b/pkg/controller/statushandler/handler.go index d0083bd9f1..0deac32a31 100644 --- a/pkg/controller/statushandler/handler.go +++ b/pkg/controller/statushandler/handler.go @@ -5,9 +5,9 @@ import ( "k8s.io/client-go/tools/record" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) // Update performs the update (in the form of patch) for the Atlas Custom Resource status. diff --git a/pkg/controller/statushandler/patch_test.go b/pkg/controller/statushandler/patch_test.go index f104eab692..251fedf5ee 100644 --- a/pkg/controller/statushandler/patch_test.go +++ b/pkg/controller/statushandler/patch_test.go @@ -11,9 +11,9 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "sigs.k8s.io/controller-runtime/pkg/client/fake" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) func Test_PatchUpdateStatus(t *testing.T) { diff --git a/pkg/controller/validate/validate.go b/pkg/controller/validate/validate.go index cb5bde14c9..37f2329fa7 100644 --- a/pkg/controller/validate/validate.go +++ b/pkg/controller/validate/validate.go @@ -7,7 +7,7 @@ import ( "reflect" "regexp" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/timeutil" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/timeutil" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" diff --git a/pkg/controller/validate/validate_test.go b/pkg/controller/validate/validate_test.go index 10ecf9c4c8..5f7b93cbe8 100644 --- a/pkg/controller/validate/validate_test.go +++ b/pkg/controller/validate/validate_test.go @@ -7,7 +7,7 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "github.com/stretchr/testify/assert" diff --git a/pkg/controller/watch/event_handler.go b/pkg/controller/watch/event_handler.go index 958ad876ac..6156a5e789 100644 --- a/pkg/controller/watch/event_handler.go +++ b/pkg/controller/watch/event_handler.go @@ -9,7 +9,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" ) // EventHandlerWithDelete is an extension of EnqueueRequestForObject that will _not_ trigger a reconciliation for a Delete event. diff --git a/pkg/controller/watch/resource_watcher_test.go b/pkg/controller/watch/resource_watcher_test.go index 52475536a3..9453aafdc7 100644 --- a/pkg/controller/watch/resource_watcher_test.go +++ b/pkg/controller/watch/resource_watcher_test.go @@ -7,7 +7,7 @@ import ( "go.uber.org/zap" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" ) func TestEnsureResourcesAreWatched(t *testing.T) { diff --git a/pkg/controller/watch/watched_resource_handler_test.go b/pkg/controller/watch/watched_resource_handler_test.go index ca3a81cded..3080ac8e44 100644 --- a/pkg/controller/watch/watched_resource_handler_test.go +++ b/pkg/controller/watch/watched_resource_handler_test.go @@ -13,7 +13,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" ) func TestHandleCreate(t *testing.T) { diff --git a/test/e2e/alert_config_test.go b/test/e2e/alert_config_test.go index 6ce07e2b5b..daaaf3e589 100644 --- a/test/e2e/alert_config_test.go +++ b/test/e2e/alert_config_test.go @@ -11,12 +11,12 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compare" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" v1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/connectionsecret" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/api/atlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/data" @@ -171,7 +171,7 @@ func alertConfigFlow(userData *model.TestDataProvider, alertConfigs []v1.AlertCo for _, alertConfig := range userData.Project.Status.AlertConfigurations { statusIDList = append(statusIDList, alertConfig.ID) } - Expect(util.IsEqualWithoutOrder(statusIDList, atlasIDList)).Should(BeTrue()) + Expect(compare.IsEqualWithoutOrder(statusIDList, atlasIDList)).Should(BeTrue()) } var _ = Describe("Alert configuration with secrets test", Label("alert-config"), func() { diff --git a/test/e2e/atlas_gov_test.go b/test/e2e/atlas_gov_test.go index 5c8521443a..182d3ef146 100644 --- a/test/e2e/atlas_gov_test.go +++ b/test/e2e/atlas_gov_test.go @@ -15,12 +15,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/connectionsecret" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/conditions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions/cloud" diff --git a/test/e2e/backup_config_test.go b/test/e2e/backup_config_test.go index 02da93bbf2..1b15642155 100644 --- a/test/e2e/backup_config_test.go +++ b/test/e2e/backup_config_test.go @@ -10,9 +10,9 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions/deploy" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/api/atlas" diff --git a/test/e2e/custom_roles_test.go b/test/e2e/custom_roles_test.go index 54d9381c01..49daf4218d 100644 --- a/test/e2e/custom_roles_test.go +++ b/test/e2e/custom_roles_test.go @@ -5,9 +5,9 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/types" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" v1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/data" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/model" diff --git a/test/e2e/db_users_test.go b/test/e2e/db_users_test.go index 4ae5d668e3..b97740c4ef 100644 --- a/test/e2e/db_users_test.go +++ b/test/e2e/db_users_test.go @@ -12,8 +12,8 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions/deploy" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/config" diff --git a/test/e2e/encryption_at_rest_test.go b/test/e2e/encryption_at_rest_test.go index 2930f561c2..3dbb975422 100644 --- a/test/e2e/encryption_at_rest_test.go +++ b/test/e2e/encryption_at_rest_test.go @@ -14,11 +14,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" v1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/connectionsecret" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions/cloud" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions/cloudaccess" diff --git a/test/e2e/global_deployment_test.go b/test/e2e/global_deployment_test.go index c8c2e873b9..1c4d25ba1d 100644 --- a/test/e2e/global_deployment_test.go +++ b/test/e2e/global_deployment_test.go @@ -8,9 +8,9 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" v1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/data" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/model" diff --git a/test/e2e/multinamespace_test.go b/test/e2e/multinamespace_test.go index 0c26a15868..2fda69028e 100644 --- a/test/e2e/multinamespace_test.go +++ b/test/e2e/multinamespace_test.go @@ -6,9 +6,9 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/stringutil" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/stringutil" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions/deploy" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/config" diff --git a/test/e2e/project_deletion_protection_test.go b/test/e2e/project_deletion_protection_test.go index b5badf703a..9224738ba0 100644 --- a/test/e2e/project_deletion_protection_test.go +++ b/test/e2e/project_deletion_protection_test.go @@ -24,10 +24,10 @@ import ( "go.mongodb.org/atlas/mongodbatlas" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions/cloudaccess" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/config" diff --git a/test/e2e/project_settings_test.go b/test/e2e/project_settings_test.go index c5eb6b70da..99fb52f19e 100644 --- a/test/e2e/project_settings_test.go +++ b/test/e2e/project_settings_test.go @@ -4,9 +4,9 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" v1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/actions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/data" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/model" diff --git a/test/helper/access/ipaccesslist_matcher.go b/test/helper/access/ipaccesslist_matcher.go index a809720687..fae147b2c5 100644 --- a/test/helper/access/ipaccesslist_matcher.go +++ b/test/helper/access/ipaccesslist_matcher.go @@ -5,8 +5,8 @@ import ( "github.com/onsi/gomega/types" "go.mongodb.org/atlas/mongodbatlas" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/timeutil" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/timeutil" ) // MatchIPAccessList returns the GomegaMatcher that checks if the 'actual' mongodbatlas.ProjectIPAccessList matches diff --git a/test/helper/e2e/actions/cloud/aws.go b/test/helper/e2e/actions/cloud/aws.go index 2d9741a968..1f99f0a9cd 100644 --- a/test/helper/e2e/actions/cloud/aws.go +++ b/test/helper/e2e/actions/cloud/aws.go @@ -14,7 +14,7 @@ import ( "github.com/aws/aws-sdk-go/service/sts" "github.com/onsi/ginkgo/v2/dsl/core" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" ) type AwsAction struct { diff --git a/test/helper/e2e/actions/cloud/azure.go b/test/helper/e2e/actions/cloud/azure.go index ce9de63c9b..24b11dcff9 100644 --- a/test/helper/e2e/actions/cloud/azure.go +++ b/test/helper/e2e/actions/cloud/azure.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2" "github.com/onsi/ginkgo/v2/dsl/core" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" ) const ( diff --git a/test/helper/e2e/actions/cloud/gcp.go b/test/helper/e2e/actions/cloud/gcp.go index 4ad57f8c5d..9fa95c94b4 100644 --- a/test/helper/e2e/actions/cloud/gcp.go +++ b/test/helper/e2e/actions/cloud/gcp.go @@ -14,7 +14,7 @@ import ( "github.com/onsi/ginkgo/v2/dsl/core" "k8s.io/apimachinery/pkg/util/rand" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" compute "cloud.google.com/go/compute/apiv1" "cloud.google.com/go/compute/apiv1/computepb" diff --git a/test/helper/e2e/data/deployments.go b/test/helper/e2e/data/deployments.go index b9e49a0940..7f3d84d070 100644 --- a/test/helper/e2e/data/deployments.go +++ b/test/helper/e2e/data/deployments.go @@ -5,7 +5,7 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/provider" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" v1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" diff --git a/test/helper/resources/customresources.go b/test/helper/resources/customresources.go index 138b0ad2d2..c5b0897d6c 100644 --- a/test/helper/resources/customresources.go +++ b/test/helper/resources/customresources.go @@ -8,9 +8,9 @@ import ( apiErrors "k8s.io/apimachinery/pkg/api/errors" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/conditions" ) diff --git a/test/int/backup_protected_test.go b/test/int/backup_protected_test.go index 97fb0a331b..ccf3fd2ea8 100644 --- a/test/int/backup_protected_test.go +++ b/test/int/backup_protected_test.go @@ -5,13 +5,13 @@ import ( "fmt" "time" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/resources" . "github.com/onsi/ginkgo/v2" diff --git a/test/int/clusterwide/integration_suite_test.go b/test/int/clusterwide/integration_suite_test.go index 129a4c037c..1c1ae88736 100644 --- a/test/int/clusterwide/integration_suite_test.go +++ b/test/int/clusterwide/integration_suite_test.go @@ -39,14 +39,14 @@ import ( ctrzap "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/predicate" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/httputil" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasdatabaseuser" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasdeployment" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasproject" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/watch" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/httputil" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/control" // +kubebuilder:scaffold:imports ) diff --git a/test/int/databaseuser_protected_test.go b/test/int/databaseuser_protected_test.go index 5e688d1286..b3bbda7290 100644 --- a/test/int/databaseuser_protected_test.go +++ b/test/int/databaseuser_protected_test.go @@ -15,12 +15,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/conditions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/resources" ) diff --git a/test/int/databaseuser_unprotected_test.go b/test/int/databaseuser_unprotected_test.go index 4fc4f37f38..c1878fe0c6 100644 --- a/test/int/databaseuser_unprotected_test.go +++ b/test/int/databaseuser_unprotected_test.go @@ -15,8 +15,8 @@ import ( apiErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/timeutil" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/connectionsecret" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/timeutil" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/atlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/conditions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/events" @@ -33,11 +33,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) const ( diff --git a/test/int/datafederation_test.go b/test/int/datafederation_test.go index c881436c55..f5fec9e42a 100644 --- a/test/int/datafederation_test.go +++ b/test/int/datafederation_test.go @@ -18,10 +18,10 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) var _ = Describe("AtlasDataFederation", Label("AtlasDataFederation"), func() { diff --git a/test/int/deployment_protected_test.go b/test/int/deployment_protected_test.go index 882b6f54ac..85bec48799 100644 --- a/test/int/deployment_protected_test.go +++ b/test/int/deployment_protected_test.go @@ -5,11 +5,11 @@ import ( "fmt" "time" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/resources" k8serrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/test/int/deployment_test.go b/test/int/deployment_test.go index b0d8cf0d51..186dc26554 100644 --- a/test/int/deployment_test.go +++ b/test/int/deployment_test.go @@ -12,8 +12,8 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/compat" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/connectionsecret" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/compat" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/atlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/conditions" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/resources" @@ -29,14 +29,14 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasdeployment" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) const ( diff --git a/test/int/deployment_unprotected_test.go b/test/int/deployment_unprotected_test.go index 463746d0b5..b6dc1ffd50 100644 --- a/test/int/deployment_unprotected_test.go +++ b/test/int/deployment_unprotected_test.go @@ -5,10 +5,10 @@ import ( "fmt" "time" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/resources" k8serrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/test/int/federated_auth_test.go b/test/int/federated_auth_test.go index fecd9fac91..04782c4d8a 100644 --- a/test/int/federated_auth_test.go +++ b/test/int/federated_auth_test.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/resources" . "github.com/onsi/ginkgo/v2" diff --git a/test/int/integration_suite_test.go b/test/int/integration_suite_test.go index e3c22a6d00..fcf036579a 100644 --- a/test/int/integration_suite_test.go +++ b/test/int/integration_suite_test.go @@ -50,14 +50,14 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/httputil" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasdatabaseuser" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasdeployment" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlasproject" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/watch" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/httputil" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" // +kubebuilder:scaffold:imports ) diff --git a/test/int/project_protect_test.go b/test/int/project_protect_test.go index e9789806ec..fc3206de23 100644 --- a/test/int/project_protect_test.go +++ b/test/int/project_protect_test.go @@ -17,9 +17,9 @@ import ( "go.mongodb.org/atlas/mongodbatlas" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/toptr" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/toptr" ) var _ = Describe("AtlasProject", Label("int", "AtlasProject", "protection-enabled"), func() { diff --git a/test/int/project_test.go b/test/int/project_test.go index cd26061db6..ad985fe3ca 100644 --- a/test/int/project_test.go +++ b/test/int/project_test.go @@ -27,12 +27,12 @@ import ( "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/customresource" + "github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/kube" mdbv1 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/project" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/atlas" "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/controller/workflow" - "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/util/kube" ) const (