From eaa4892560e92275ff19263b6a761c711332f552 Mon Sep 17 00:00:00 2001 From: Murad Biashimov Date: Thu, 14 Sep 2023 11:27:06 +0200 Subject: [PATCH] chore: sort imports (#498) --- Makefile | 7 ++++++- .../integration/clickhouse_kafka/zz_generated.deepcopy.go | 2 -- .../clickhouse_postgresql/zz_generated.deepcopy.go | 2 -- .../integration/datadog/zz_generated.deepcopy.go | 2 -- .../zz_generated.deepcopy.go | 2 -- .../integration/kafka_connect/zz_generated.deepcopy.go | 2 -- .../integration/kafka_logs/zz_generated.deepcopy.go | 2 -- .../integration/kafka_mirrormaker/zz_generated.deepcopy.go | 2 -- .../userconfig/integration/logs/zz_generated.deepcopy.go | 2 -- .../integration/metrics/zz_generated.deepcopy.go | 2 -- .../userconfig/service/cassandra/zz_generated.deepcopy.go | 2 -- .../userconfig/service/clickhouse/zz_generated.deepcopy.go | 2 -- .../userconfig/service/grafana/zz_generated.deepcopy.go | 2 -- .../userconfig/service/kafka/zz_generated.deepcopy.go | 2 -- .../service/kafka_connect/zz_generated.deepcopy.go | 2 -- .../userconfig/service/mysql/zz_generated.deepcopy.go | 2 -- .../userconfig/service/opensearch/zz_generated.deepcopy.go | 2 -- .../userconfig/service/pg/zz_generated.deepcopy.go | 2 -- .../userconfig/service/redis/zz_generated.deepcopy.go | 2 -- api/v1alpha1/zz_generated.deepcopy.go | 5 +++-- controllers/common.go | 3 +-- controllers/secret_finalizer_gc_controller.go | 3 +-- generators/userconfigs/pg/zz_generated.deepcopy.go | 2 -- 23 files changed, 11 insertions(+), 45 deletions(-) diff --git a/Makefile b/Makefile index e86d4426..40cca3da 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,7 @@ boilerplate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." .PHONY: generate -generate: boilerplate userconfigs manifests docs charts +generate: boilerplate userconfigs imports manifests docs charts .PHONY: fmt fmt: ## Run go fmt against code. @@ -340,3 +340,8 @@ endif --set resources.requests.memory=0 \ --set webhooks.enabled=${WEBHOOKS_ENABLED} \ aiven-operator charts/aiven-operator + +# On MACOS requires gnu-sed. Run `brew info gnu-sed` and follow instructions to replace default sed. +imports: + find . -type f -name '*.go' -exec sed -zi 's/"\n\+\t"/"\n"/g' {} + + goimports -local "github.com/aiven/aiven-operator" -w . diff --git a/api/v1alpha1/userconfig/integration/clickhouse_kafka/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration/clickhouse_kafka/zz_generated.deepcopy.go index bab9b08d..d9bebc94 100644 --- a/api/v1alpha1/userconfig/integration/clickhouse_kafka/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/integration/clickhouse_kafka/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package clickhousekafkauserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClickhouseKafkaUserConfig) DeepCopyInto(out *ClickhouseKafkaUserConfig) { *out = *in diff --git a/api/v1alpha1/userconfig/integration/clickhouse_postgresql/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration/clickhouse_postgresql/zz_generated.deepcopy.go index ecaf7252..b9685087 100644 --- a/api/v1alpha1/userconfig/integration/clickhouse_postgresql/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/integration/clickhouse_postgresql/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package clickhousepostgresqluserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClickhousePostgresqlUserConfig) DeepCopyInto(out *ClickhousePostgresqlUserConfig) { *out = *in diff --git a/api/v1alpha1/userconfig/integration/datadog/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration/datadog/zz_generated.deepcopy.go index 5235d2c3..3d607aec 100644 --- a/api/v1alpha1/userconfig/integration/datadog/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/integration/datadog/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package datadoguserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatadogTags) DeepCopyInto(out *DatadogTags) { *out = *in diff --git a/api/v1alpha1/userconfig/integration/external_aws_cloudwatch_metrics/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration/external_aws_cloudwatch_metrics/zz_generated.deepcopy.go index eceff734..37ba2e67 100644 --- a/api/v1alpha1/userconfig/integration/external_aws_cloudwatch_metrics/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/integration/external_aws_cloudwatch_metrics/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package externalawscloudwatchmetricsuserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DroppedMetrics) DeepCopyInto(out *DroppedMetrics) { *out = *in diff --git a/api/v1alpha1/userconfig/integration/kafka_connect/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration/kafka_connect/zz_generated.deepcopy.go index be0a9abf..e95b19c6 100644 --- a/api/v1alpha1/userconfig/integration/kafka_connect/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/integration/kafka_connect/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package kafkaconnectuserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KafkaConnect) DeepCopyInto(out *KafkaConnect) { *out = *in diff --git a/api/v1alpha1/userconfig/integration/kafka_logs/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration/kafka_logs/zz_generated.deepcopy.go index 18041ccf..86dddf66 100644 --- a/api/v1alpha1/userconfig/integration/kafka_logs/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/integration/kafka_logs/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package kafkalogsuserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KafkaLogsUserConfig) DeepCopyInto(out *KafkaLogsUserConfig) { *out = *in diff --git a/api/v1alpha1/userconfig/integration/kafka_mirrormaker/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration/kafka_mirrormaker/zz_generated.deepcopy.go index 1bd20178..555a58b3 100644 --- a/api/v1alpha1/userconfig/integration/kafka_mirrormaker/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/integration/kafka_mirrormaker/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package kafkamirrormakeruserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KafkaMirrormaker) DeepCopyInto(out *KafkaMirrormaker) { *out = *in diff --git a/api/v1alpha1/userconfig/integration/logs/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration/logs/zz_generated.deepcopy.go index a255c98e..71dedb0a 100644 --- a/api/v1alpha1/userconfig/integration/logs/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/integration/logs/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package logsuserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LogsUserConfig) DeepCopyInto(out *LogsUserConfig) { *out = *in diff --git a/api/v1alpha1/userconfig/integration/metrics/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration/metrics/zz_generated.deepcopy.go index 475a5e81..6006343d 100644 --- a/api/v1alpha1/userconfig/integration/metrics/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/integration/metrics/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package metricsuserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MetricsUserConfig) DeepCopyInto(out *MetricsUserConfig) { *out = *in diff --git a/api/v1alpha1/userconfig/service/cassandra/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/service/cassandra/zz_generated.deepcopy.go index fca24b76..27472421 100644 --- a/api/v1alpha1/userconfig/service/cassandra/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/service/cassandra/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package cassandrauserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cassandra) DeepCopyInto(out *Cassandra) { *out = *in diff --git a/api/v1alpha1/userconfig/service/clickhouse/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/service/clickhouse/zz_generated.deepcopy.go index 941daadf..3f9dae09 100644 --- a/api/v1alpha1/userconfig/service/clickhouse/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/service/clickhouse/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package clickhouseuserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClickhouseUserConfig) DeepCopyInto(out *ClickhouseUserConfig) { *out = *in diff --git a/api/v1alpha1/userconfig/service/grafana/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/service/grafana/zz_generated.deepcopy.go index 50c9dd42..457e178a 100644 --- a/api/v1alpha1/userconfig/service/grafana/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/service/grafana/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package grafanauserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthAzuread) DeepCopyInto(out *AuthAzuread) { *out = *in diff --git a/api/v1alpha1/userconfig/service/kafka/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/service/kafka/zz_generated.deepcopy.go index a411b013..38dfcf95 100644 --- a/api/v1alpha1/userconfig/service/kafka/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/service/kafka/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package kafkauserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IpFilter) DeepCopyInto(out *IpFilter) { *out = *in diff --git a/api/v1alpha1/userconfig/service/kafka_connect/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/service/kafka_connect/zz_generated.deepcopy.go index 0fee1958..4ae945a2 100644 --- a/api/v1alpha1/userconfig/service/kafka_connect/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/service/kafka_connect/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package kafkaconnectuserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IpFilter) DeepCopyInto(out *IpFilter) { *out = *in diff --git a/api/v1alpha1/userconfig/service/mysql/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/service/mysql/zz_generated.deepcopy.go index a10c4c8e..63770883 100644 --- a/api/v1alpha1/userconfig/service/mysql/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/service/mysql/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package mysqluserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IpFilter) DeepCopyInto(out *IpFilter) { *out = *in diff --git a/api/v1alpha1/userconfig/service/opensearch/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/service/opensearch/zz_generated.deepcopy.go index d0c30684..b37d92a4 100644 --- a/api/v1alpha1/userconfig/service/opensearch/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/service/opensearch/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package opensearchuserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthFailureListeners) DeepCopyInto(out *AuthFailureListeners) { *out = *in diff --git a/api/v1alpha1/userconfig/service/pg/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/service/pg/zz_generated.deepcopy.go index 3247d6db..5737cfad 100644 --- a/api/v1alpha1/userconfig/service/pg/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/service/pg/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package pguserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IpFilter) DeepCopyInto(out *IpFilter) { *out = *in diff --git a/api/v1alpha1/userconfig/service/redis/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/service/redis/zz_generated.deepcopy.go index 97b653d1..6582d2ba 100644 --- a/api/v1alpha1/userconfig/service/redis/zz_generated.deepcopy.go +++ b/api/v1alpha1/userconfig/service/redis/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package redisuserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IpFilter) DeepCopyInto(out *IpFilter) { *out = *in diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index c30d01dc..3fa865d1 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -8,6 +8,9 @@ package v1alpha1 import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + clickhouse_kafka "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integration/clickhouse_kafka" clickhouse_postgresql "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integration/clickhouse_postgresql" datadog "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integration/datadog" @@ -26,8 +29,6 @@ import ( opensearch "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/service/opensearch" pg "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/service/pg" redis "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/service/redis" - "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/controllers/common.go b/controllers/common.go index d2db27f2..ae33e537 100644 --- a/controllers/common.go +++ b/controllers/common.go @@ -8,6 +8,7 @@ import ( "strconv" "strings" + "github.com/aiven/aiven-go-client" "github.com/liip/sheriff" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -15,8 +16,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "github.com/aiven/aiven-go-client" - "github.com/aiven/aiven-operator/api/v1alpha1" ) diff --git a/controllers/secret_finalizer_gc_controller.go b/controllers/secret_finalizer_gc_controller.go index 8ad74ec9..94ebd144 100644 --- a/controllers/secret_finalizer_gc_controller.go +++ b/controllers/secret_finalizer_gc_controller.go @@ -15,14 +15,13 @@ import ( "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "github.com/aiven/aiven-operator/api/v1alpha1" ) diff --git a/generators/userconfigs/pg/zz_generated.deepcopy.go b/generators/userconfigs/pg/zz_generated.deepcopy.go index 4bd3895f..deff35ec 100644 --- a/generators/userconfigs/pg/zz_generated.deepcopy.go +++ b/generators/userconfigs/pg/zz_generated.deepcopy.go @@ -7,8 +7,6 @@ package pgtestuserconfig -import () - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IpFilter) DeepCopyInto(out *IpFilter) { *out = *in