diff --git a/controllers/shardedredisbackup_controller_test.go b/controllers/shardedredisbackup_controller_test.go index 74610467..e2cd9b84 100644 --- a/controllers/shardedredisbackup_controller_test.go +++ b/controllers/shardedredisbackup_controller_test.go @@ -22,7 +22,7 @@ import ( "time" "github.com/3scale-ops/basereconciler/reconciler" - reconciler_util "github.com/3scale-ops/basereconciler/util" + "github.com/3scale-ops/basereconciler/util" saasv1alpha1 "github.com/3scale-ops/saas-operator/api/v1alpha1" testutil "github.com/3scale-ops/saas-operator/test/util" "github.com/google/go-cmp/cmp" @@ -47,7 +47,7 @@ func TestShardedRedisBackupReconciler_reconcileBackupList(t *testing.T) { args: args{ nextRun: testutil.MustParseRFC3339("2023-09-01T00:01:00Z"), instance: &saasv1alpha1.ShardedRedisBackup{ - Spec: saasv1alpha1.ShardedRedisBackupSpec{HistoryLimit: reconciler_util.Pointer(int32(10))}, + Spec: saasv1alpha1.ShardedRedisBackupSpec{HistoryLimit: util.Pointer(int32(10))}, Status: saasv1alpha1.ShardedRedisBackupStatus{}, }, shards: []string{"shard01", "shard02"}, @@ -76,7 +76,7 @@ func TestShardedRedisBackupReconciler_reconcileBackupList(t *testing.T) { args: args{ nextRun: testutil.MustParseRFC3339("2023-09-01T00:01:00Z"), instance: &saasv1alpha1.ShardedRedisBackup{ - Spec: saasv1alpha1.ShardedRedisBackupSpec{HistoryLimit: reconciler_util.Pointer(int32(10))}, + Spec: saasv1alpha1.ShardedRedisBackupSpec{HistoryLimit: util.Pointer(int32(10))}, Status: saasv1alpha1.ShardedRedisBackupStatus{ Backups: []saasv1alpha1.BackupStatus{ { @@ -119,7 +119,7 @@ func TestShardedRedisBackupReconciler_reconcileBackupList(t *testing.T) { args: args{ nextRun: testutil.MustParseRFC3339("2023-09-01T00:02:00Z"), instance: &saasv1alpha1.ShardedRedisBackup{ - Spec: saasv1alpha1.ShardedRedisBackupSpec{HistoryLimit: reconciler_util.Pointer(int32(10))}, + Spec: saasv1alpha1.ShardedRedisBackupSpec{HistoryLimit: util.Pointer(int32(10))}, Status: saasv1alpha1.ShardedRedisBackupStatus{ Backups: []saasv1alpha1.BackupStatus{ { diff --git a/controllers/system_controller.go b/controllers/system_controller.go index a6717655..4f780290 100644 --- a/controllers/system_controller.go +++ b/controllers/system_controller.go @@ -24,7 +24,6 @@ import ( saasv1alpha1 "github.com/3scale-ops/saas-operator/api/v1alpha1" "github.com/3scale-ops/saas-operator/pkg/generators/system" externalsecretsv1beta1 "github.com/external-secrets/external-secrets/apis/externalsecrets/v1beta1" - "github.com/go-logr/logr" grafanav1alpha1 "github.com/grafana-operator/grafana-operator/v4/api/integreatly/v1alpha1" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" @@ -40,7 +39,6 @@ import ( // SystemReconciler reconciles a System object type SystemReconciler struct { *reconciler.Reconciler - Log logr.Logger } // +kubebuilder:rbac:groups=saas.3scale.net,namespace=placeholder,resources=systems,verbs=get;list;watch;create;update;patch;delete diff --git a/controllers/twemproxyconfig_controller.go b/controllers/twemproxyconfig_controller.go index 8f676ec2..c42fd28e 100644 --- a/controllers/twemproxyconfig_controller.go +++ b/controllers/twemproxyconfig_controller.go @@ -48,7 +48,6 @@ import ( // TwemproxyConfigReconciler reconciles a TwemproxyConfig object type TwemproxyConfigReconciler struct { *reconciler.Reconciler - Log logr.Logger SentinelEvents threads.Manager Pool *redis.ServerPool } diff --git a/main.go b/main.go index 7edc3cc5..105e5194 100644 --- a/main.go +++ b/main.go @@ -166,8 +166,6 @@ func main() { os.Exit(1) } - /* WORKLOADS RECONCILER BASED CONTROLLERS*/ - if err = (&controllers.ApicastReconciler{ Reconciler: reconciler.NewFromManager(mgr). WithLogger(ctrl.Log.WithName("controllers").WithName("Apicast")), diff --git a/pkg/generators/apicast/deployment.go b/pkg/generators/apicast/deployment.go index ba3e71cb..498edcb5 100644 --- a/pkg/generators/apicast/deployment.go +++ b/pkg/generators/apicast/deployment.go @@ -11,8 +11,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// Deployment returns a function that will return a Deployment -// resource when called func (gen *EnvGenerator) deployment() *appsv1.Deployment { dep := &appsv1.Deployment{ diff --git a/pkg/generators/apicast/services.go b/pkg/generators/apicast/services.go index c43879c1..a8c1a68c 100644 --- a/pkg/generators/apicast/services.go +++ b/pkg/generators/apicast/services.go @@ -7,8 +7,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// GatewayService returns a function that will return the -// gateway Service resource when called func (gen *EnvGenerator) gatewayService() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ @@ -32,8 +30,6 @@ func (gen *EnvGenerator) gatewayService() *corev1.Service { } } -// MgmtService returns a function that will return the -// management Service resource when called func (gen *EnvGenerator) mgmtService() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/autossl/deployment.go b/pkg/generators/autossl/deployment.go index dd1fe06a..8a04b22b 100644 --- a/pkg/generators/autossl/deployment.go +++ b/pkg/generators/autossl/deployment.go @@ -10,7 +10,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// deployment returns a function that will return a *appsv1.Deployment for autossl func (gen *Generator) deployment() *appsv1.Deployment { return &appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ diff --git a/pkg/generators/autossl/service.go b/pkg/generators/autossl/service.go index 63a3cad1..0aaa8ae3 100644 --- a/pkg/generators/autossl/service.go +++ b/pkg/generators/autossl/service.go @@ -7,7 +7,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// service returns a function that will return the corev1.Service for autossl func (gen *Generator) service() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/backend/cron_deployment.go b/pkg/generators/backend/cron_deployment.go index 6c47f1b9..e55e49d4 100644 --- a/pkg/generators/backend/cron_deployment.go +++ b/pkg/generators/backend/cron_deployment.go @@ -10,8 +10,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// Deployment returns a function that will return a Deployment -// resource when called func (gen *CronGenerator) deployment() *appsv1.Deployment { return &appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ diff --git a/pkg/generators/backend/listener_deployment.go b/pkg/generators/backend/listener_deployment.go index 6e349694..5e087793 100644 --- a/pkg/generators/backend/listener_deployment.go +++ b/pkg/generators/backend/listener_deployment.go @@ -12,8 +12,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// Deployment returns a function that will return a Deployment -// resource when called func (gen *ListenerGenerator) deployment() *appsv1.Deployment { dep := &appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ diff --git a/pkg/generators/backend/services.go b/pkg/generators/backend/services.go index 54c4f6d5..319d94f8 100644 --- a/pkg/generators/backend/services.go +++ b/pkg/generators/backend/services.go @@ -7,8 +7,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// service returns a function that will return the -// public service resource when called func (gen *ListenerGenerator) service() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ @@ -32,8 +30,6 @@ func (gen *ListenerGenerator) service() *corev1.Service { } } -// internalService returns a function that will return the -// internal Service resource when called func (gen *ListenerGenerator) internalService() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/backend/worker_deployment.go b/pkg/generators/backend/worker_deployment.go index 17be6906..16a0e8ba 100644 --- a/pkg/generators/backend/worker_deployment.go +++ b/pkg/generators/backend/worker_deployment.go @@ -11,8 +11,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// Deployment returns a function that will return a Deployment -// resource when called func (gen *WorkerGenerator) deployment() *appsv1.Deployment { dep := &appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ diff --git a/pkg/generators/corsproxy/deployment.go b/pkg/generators/corsproxy/deployment.go index f5d3ca6b..e4cf667b 100644 --- a/pkg/generators/corsproxy/deployment.go +++ b/pkg/generators/corsproxy/deployment.go @@ -10,7 +10,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// deployment returns a function that will return a *appsv1.Deployment for echo-api func (gen *Generator) deployment() *appsv1.Deployment { return &appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ diff --git a/pkg/generators/corsproxy/service.go b/pkg/generators/corsproxy/service.go index 7ae1d578..5a532c0c 100644 --- a/pkg/generators/corsproxy/service.go +++ b/pkg/generators/corsproxy/service.go @@ -7,7 +7,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// service returns a function that will return the corev1.Service for echo-api func (gen *Generator) service() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/echoapi/deployment.go b/pkg/generators/echoapi/deployment.go index de39db2a..fd743678 100644 --- a/pkg/generators/echoapi/deployment.go +++ b/pkg/generators/echoapi/deployment.go @@ -11,7 +11,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// deployment returns a function that will return a *appsv1.Deployment for echo-api func (gen *Generator) deployment() *appsv1.Deployment { dep := &appsv1.Deployment{ diff --git a/pkg/generators/echoapi/service.go b/pkg/generators/echoapi/service.go index 321ee07d..b78f0637 100644 --- a/pkg/generators/echoapi/service.go +++ b/pkg/generators/echoapi/service.go @@ -7,7 +7,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// service returns a function that will return the corev1.Service for echo-api func (gen *Generator) service() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/mappingservice/deployment.go b/pkg/generators/mappingservice/deployment.go index 87ca3849..e4276eb8 100644 --- a/pkg/generators/mappingservice/deployment.go +++ b/pkg/generators/mappingservice/deployment.go @@ -10,7 +10,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// deployment returns a function that will return a *appsv1.Deployment for echo-api func (gen *Generator) deployment() *appsv1.Deployment { return &appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ diff --git a/pkg/generators/mappingservice/service.go b/pkg/generators/mappingservice/service.go index 729ff97f..1a3ff8c9 100644 --- a/pkg/generators/mappingservice/service.go +++ b/pkg/generators/mappingservice/service.go @@ -7,7 +7,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// service returns a function that will return the corev1.Service for echo-api func (gen *Generator) service() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/redisshard/configmaps.go b/pkg/generators/redisshard/configmaps.go index 4ced0af3..90a9a4c2 100644 --- a/pkg/generators/redisshard/configmaps.go +++ b/pkg/generators/redisshard/configmaps.go @@ -6,8 +6,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// RedisConfigConfigMap returns a function that will return a ConfigMap -// resource when called func (gen *Generator) redisConfigConfigMap() *corev1.ConfigMap { return &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ @@ -24,8 +22,6 @@ func (gen *Generator) redisConfigConfigMap() *corev1.ConfigMap { } } -// RedisReadinessScriptConfigMap returns a function that will return a ConfigMap -// resource when called func (gen *Generator) redisReadinessScriptConfigMap() *corev1.ConfigMap { return &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/redisshard/service.go b/pkg/generators/redisshard/service.go index 169ec2cd..46254f66 100644 --- a/pkg/generators/redisshard/service.go +++ b/pkg/generators/redisshard/service.go @@ -5,8 +5,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// Service returns a function that will return a Service -// resource when called func (gen *Generator) service() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/redisshard/statefulset.go b/pkg/generators/redisshard/statefulset.go index 0f1f097b..779ae47e 100644 --- a/pkg/generators/redisshard/statefulset.go +++ b/pkg/generators/redisshard/statefulset.go @@ -11,8 +11,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// StatefulSet returns a function that will return -// a StatefulSet resource when called func (gen *Generator) statefulSet() *appsv1.StatefulSet { return &appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/sentinel/configmap.go b/pkg/generators/sentinel/configmap.go index 0331aa71..bc299716 100644 --- a/pkg/generators/sentinel/configmap.go +++ b/pkg/generators/sentinel/configmap.go @@ -6,8 +6,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// configMap returns a function that will return a configMap -// resource when called func (gen *Generator) configMap() *corev1.ConfigMap { return &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/sentinel/services.go b/pkg/generators/sentinel/services.go index b1626b3c..fed235cc 100644 --- a/pkg/generators/sentinel/services.go +++ b/pkg/generators/sentinel/services.go @@ -13,8 +13,6 @@ const ( statefulsetPodSelectorLabelKey string = "statefulset.kubernetes.io/pod-name" ) -// statefulSetService returns a function function that returns a Service -// resource when called func (gen *Generator) statefulSetService() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ @@ -31,9 +29,6 @@ func (gen *Generator) statefulSetService() *corev1.Service { } } -// podServices returns a function that returns a Service that points -// ot a specific StatefulSet Pod when called -// resource when called func (gen *Generator) podServices(index int) *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/sentinel/statefulset.go b/pkg/generators/sentinel/statefulset.go index 1737df67..86bf7d16 100644 --- a/pkg/generators/sentinel/statefulset.go +++ b/pkg/generators/sentinel/statefulset.go @@ -16,8 +16,6 @@ var ( healthCommand string = fmt.Sprintf("redis-cli -p %d PING", saasv1alpha1.SentinelPort) ) -// statefulSet returns a function that will return -// a StatefulSet resource when called func (gen *Generator) statefulSet() *appsv1.StatefulSet { return &appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/system/app_deployment.go b/pkg/generators/system/app_deployment.go index 92c4c5c0..6a4e43a8 100644 --- a/pkg/generators/system/app_deployment.go +++ b/pkg/generators/system/app_deployment.go @@ -12,8 +12,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// Deployment returns a function that will return a Deployment -// resource when called func (gen *AppGenerator) deployment() *appsv1.Deployment { dep := &appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ diff --git a/pkg/generators/system/app_service.go b/pkg/generators/system/app_service.go index 38bbe74a..f4f608eb 100644 --- a/pkg/generators/system/app_service.go +++ b/pkg/generators/system/app_service.go @@ -7,7 +7,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// service returns a function that will return the corev1.Service for system func (gen *AppGenerator) service() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/system/console_statefulset.go b/pkg/generators/system/console_statefulset.go index 287184be..59aed072 100644 --- a/pkg/generators/system/console_statefulset.go +++ b/pkg/generators/system/console_statefulset.go @@ -12,8 +12,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// StatefulSet returns a basereconciler.GeneratorFunction function that will return -// a StatefulSet resource when called func (gen *ConsoleGenerator) statefulset() *appsv1.StatefulSet { sts := &appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/system/searchd_service.go b/pkg/generators/system/searchd_service.go index d6a0d580..66fc2295 100644 --- a/pkg/generators/system/searchd_service.go +++ b/pkg/generators/system/searchd_service.go @@ -7,7 +7,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// service returns a function that will return the corev1.Service for searchd func (gen *SearchdGenerator) service() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/system/searchd_statefulset.go b/pkg/generators/system/searchd_statefulset.go index 2445bd48..9a7432bd 100644 --- a/pkg/generators/system/searchd_statefulset.go +++ b/pkg/generators/system/searchd_statefulset.go @@ -12,8 +12,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// StatefulSet returns a basereconciler.GeneratorFunction function that will return -// a StatefulSet resource when called func (gen *SearchdGenerator) statefulset() *appsv1.StatefulSet { return &appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/system/sidekiq_deployment.go b/pkg/generators/system/sidekiq_deployment.go index 9a18bd6d..94484974 100644 --- a/pkg/generators/system/sidekiq_deployment.go +++ b/pkg/generators/system/sidekiq_deployment.go @@ -12,8 +12,6 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -// Deployment returns a basereconciler.GeneratorFunction function that will return a Deployment -// resource when called func (gen *SidekiqGenerator) deployment() *appsv1.Deployment { dep := &appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ diff --git a/pkg/generators/system/tekton_pipeline.go b/pkg/generators/system/tekton_pipeline.go index 28f2f6ef..06d91183 100644 --- a/pkg/generators/system/tekton_pipeline.go +++ b/pkg/generators/system/tekton_pipeline.go @@ -7,8 +7,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// pipeline returns a basereconciler.GeneratorFunction function that will return a -// Tekton Pipeline resource for a Task when called func (gen *SystemTektonGenerator) pipeline() *pipelinev1beta1.Pipeline { pipeline := &pipelinev1beta1.Pipeline{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/system/tekton_task.go b/pkg/generators/system/tekton_task.go index c6f90425..8d89f31d 100644 --- a/pkg/generators/system/tekton_task.go +++ b/pkg/generators/system/tekton_task.go @@ -11,8 +11,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// task returns a basereconciler.GeneratorFunction function that will return a -// Tekton Task resource when called func (gen *SystemTektonGenerator) task() *pipelinev1beta1.Task { task := &pipelinev1beta1.Task{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/generators/twemproxyconfig/configmap.go b/pkg/generators/twemproxyconfig/configmap.go index 9c98fd51..b23746c0 100644 --- a/pkg/generators/twemproxyconfig/configmap.go +++ b/pkg/generators/twemproxyconfig/configmap.go @@ -15,8 +15,7 @@ const ( HealthBindAddress string = "127.0.0.1:22333" ) -// configMap returns a function that will return a ConfigMap -// resource when called. This ConfigMap holds the twemproxy config file. +// configMap returns a ConfigMap that holds the twemproxy config file. func (gen *Generator) configMap(toYAML bool) *corev1.ConfigMap { config := make(map[string]twemproxy.ServerPoolConfig, len(gen.Spec.ServerPools)+1) for _, pool := range gen.Spec.ServerPools { diff --git a/pkg/generators/zync/api_deployment.go b/pkg/generators/zync/api_deployment.go index 5289d902..e2b02a71 100644 --- a/pkg/generators/zync/api_deployment.go +++ b/pkg/generators/zync/api_deployment.go @@ -7,11 +7,9 @@ import ( "github.com/3scale-ops/saas-operator/pkg/resource_builders/pod" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/intstr" ) -// deployment returns a function that will return a *appsv1.Deployment for zync func (gen *APIGenerator) deployment() *appsv1.Deployment { dep := &appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ @@ -44,8 +42,8 @@ func (gen *APIGenerator) deployment() *appsv1.Deployment { envVars = append(envVars, corev1.EnvVar{ Name: "POD_NAME", - ValueFrom: &v1.EnvVarSource{ - FieldRef: &v1.ObjectFieldSelector{ + ValueFrom: &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ FieldPath: "metadata.name", APIVersion: "v1", }, @@ -53,8 +51,8 @@ func (gen *APIGenerator) deployment() *appsv1.Deployment { }, corev1.EnvVar{ Name: "POD_NAMESPACE", - ValueFrom: &v1.EnvVarSource{ - FieldRef: &v1.ObjectFieldSelector{ + ValueFrom: &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ FieldPath: "metadata.namespace", APIVersion: "v1", }, diff --git a/pkg/generators/zync/console_statefulset.go b/pkg/generators/zync/console_statefulset.go index 55e6664c..644957e2 100644 --- a/pkg/generators/zync/console_statefulset.go +++ b/pkg/generators/zync/console_statefulset.go @@ -7,12 +7,9 @@ import ( "github.com/3scale-ops/saas-operator/pkg/resource_builders/pod" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// StatefulSet returns a basereconciler.GeneratorFunction function that will return -// a StatefulSet resource when called func (gen *ConsoleGenerator) statefulset() *appsv1.StatefulSet { sts := &appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ @@ -55,8 +52,8 @@ func (gen *ConsoleGenerator) statefulset() *appsv1.StatefulSet { envVars = append(envVars, corev1.EnvVar{ Name: "POD_NAME", - ValueFrom: &v1.EnvVarSource{ - FieldRef: &v1.ObjectFieldSelector{ + ValueFrom: &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ FieldPath: "metadata.name", APIVersion: "v1", }, @@ -64,8 +61,8 @@ func (gen *ConsoleGenerator) statefulset() *appsv1.StatefulSet { }, corev1.EnvVar{ Name: "POD_NAMESPACE", - ValueFrom: &v1.EnvVarSource{ - FieldRef: &v1.ObjectFieldSelector{ + ValueFrom: &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ FieldPath: "metadata.namespace", APIVersion: "v1", }, diff --git a/pkg/generators/zync/que_deployment.go b/pkg/generators/zync/que_deployment.go index 72f60453..3f281914 100644 --- a/pkg/generators/zync/que_deployment.go +++ b/pkg/generators/zync/que_deployment.go @@ -7,11 +7,9 @@ import ( "github.com/3scale-ops/saas-operator/pkg/resource_builders/pod" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/intstr" ) -// deployment returns a function that will return a *appsv1.Deployment for zync-que func (gen *QueGenerator) deployment() *appsv1.Deployment { dep := &appsv1.Deployment{ Spec: appsv1.DeploymentSpec{ @@ -48,8 +46,8 @@ func (gen *QueGenerator) deployment() *appsv1.Deployment { envVars = append(envVars, corev1.EnvVar{ Name: "POD_NAME", - ValueFrom: &v1.EnvVarSource{ - FieldRef: &v1.ObjectFieldSelector{ + ValueFrom: &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ FieldPath: "metadata.name", APIVersion: "v1", }, @@ -57,8 +55,8 @@ func (gen *QueGenerator) deployment() *appsv1.Deployment { }, corev1.EnvVar{ Name: "POD_NAMESPACE", - ValueFrom: &v1.EnvVarSource{ - FieldRef: &v1.ObjectFieldSelector{ + ValueFrom: &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ FieldPath: "metadata.namespace", APIVersion: "v1", }, diff --git a/pkg/generators/zync/services.go b/pkg/generators/zync/services.go index 8afc9cda..1f9ef70c 100644 --- a/pkg/generators/zync/services.go +++ b/pkg/generators/zync/services.go @@ -2,13 +2,11 @@ package zync import ( "github.com/3scale-ops/saas-operator/pkg/resource_builders/service" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" ) -// service returns a function that will return the corev1.Service for zync func (gen *APIGenerator) service() *corev1.Service { return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{