From e6d14e30197ae5073732a3cb067dba7690f033c2 Mon Sep 17 00:00:00 2001 From: Roi Vazquez Date: Tue, 19 Dec 2023 14:52:32 +0100 Subject: [PATCH] wip --- Makefile | 2 +- .../saas-operator.clusterserviceversion.yaml | 8 ++++---- config/manager/kustomization.yaml | 2 +- controllers/shardedredisbackup_controller_test.go | 8 ++++---- controllers/system_controller.go | 2 -- controllers/twemproxyconfig_controller.go | 1 - main.go | 2 -- pkg/generators/apicast/deployment.go | 2 -- pkg/generators/apicast/generator.go | 2 +- pkg/generators/apicast/services.go | 4 ---- pkg/generators/autossl/deployment.go | 1 - pkg/generators/autossl/generator.go | 2 +- pkg/generators/autossl/service.go | 1 - pkg/generators/backend/cron_deployment.go | 2 -- pkg/generators/backend/generator.go | 2 +- pkg/generators/backend/listener_deployment.go | 2 -- pkg/generators/backend/services.go | 4 ---- pkg/generators/backend/worker_deployment.go | 2 -- pkg/generators/corsproxy/deployment.go | 1 - pkg/generators/corsproxy/generator.go | 2 +- pkg/generators/corsproxy/service.go | 1 - pkg/generators/echoapi/deployment.go | 1 - pkg/generators/echoapi/service.go | 1 - pkg/generators/mappingservice/deployment.go | 1 - pkg/generators/mappingservice/generator.go | 2 +- pkg/generators/mappingservice/service.go | 1 - pkg/generators/redisshard/configmaps.go | 4 ---- pkg/generators/redisshard/service.go | 2 -- pkg/generators/redisshard/statefulset.go | 2 -- pkg/generators/sentinel/configmap.go | 2 -- pkg/generators/sentinel/services.go | 5 ----- pkg/generators/sentinel/statefulset.go | 2 -- pkg/generators/system/app_deployment.go | 2 -- pkg/generators/system/app_service.go | 1 - pkg/generators/system/console_statefulset.go | 2 -- pkg/generators/system/generator.go | 2 +- pkg/generators/system/searchd_service.go | 1 - pkg/generators/system/searchd_statefulset.go | 2 -- pkg/generators/system/sidekiq_deployment.go | 2 -- pkg/generators/system/tekton_pipeline.go | 2 -- pkg/generators/system/tekton_task.go | 2 -- pkg/generators/twemproxyconfig/configmap.go | 3 +-- pkg/generators/zync/api_deployment.go | 10 ++++------ pkg/generators/zync/console_statefulset.go | 11 ++++------- pkg/generators/zync/generator.go | 2 +- pkg/generators/zync/que_deployment.go | 10 ++++------ pkg/generators/zync/services.go | 2 -- pkg/version/version.go | 2 +- 48 files changed, 31 insertions(+), 101 deletions(-) diff --git a/Makefile b/Makefile index 6d6c3ac8..661aa622 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) -VERSION ?= 0.21.0-alpha.15 +VERSION ?= 0.21.0-alpha.16 # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") diff --git a/bundle/manifests/saas-operator.clusterserviceversion.yaml b/bundle/manifests/saas-operator.clusterserviceversion.yaml index 9edafc53..597c8ab6 100644 --- a/bundle/manifests/saas-operator.clusterserviceversion.yaml +++ b/bundle/manifests/saas-operator.clusterserviceversion.yaml @@ -598,7 +598,7 @@ metadata: capabilities: Basic Install categories: Integration & Delivery containerImage: quay.io/3scale/saas-operator - createdAt: "2023-12-18T15:40:44Z" + createdAt: "2023-12-19T14:21:12Z" description: |- The 3scale SaaS Operator creates and maintains a SaaS-ready deployment of the Red Hat 3scale API Management on OpenShift. @@ -606,7 +606,7 @@ metadata: operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/3scale-ops/saas-operator support: Red Hat - name: saas-operator.v0.21.0-alpha.15 + name: saas-operator.v0.21.0-alpha.16 namespace: placeholder spec: apiservicedefinitions: {} @@ -4481,7 +4481,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.annotations['olm.targetNamespaces'] - image: quay.io/3scale/saas-operator:v0.21.0-alpha.15 + image: quay.io/3scale/saas-operator:v0.21.0-alpha.16 livenessProbe: httpGet: path: /healthz @@ -5045,4 +5045,4 @@ spec: provider: name: Red Hat url: https://www.3scale.net/ - version: 0.21.0-alpha.15 + version: 0.21.0-alpha.16 diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index ba50608a..0f9aa19e 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -13,4 +13,4 @@ kind: Kustomization images: - name: controller newName: quay.io/3scale/saas-operator - newTag: v0.21.0-alpha.15 + newTag: v0.21.0-alpha.16 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/generator.go b/pkg/generators/apicast/generator.go index f3e614ec..39d2e1ea 100644 --- a/pkg/generators/apicast/generator.go +++ b/pkg/generators/apicast/generator.go @@ -159,7 +159,7 @@ func (gen *Generator) Resources() ([]resource.TemplateInterface, error) { WithEnabled(!gen.GrafanaDashboardSpec.IsDeactivated()), } - return operatorutil.ConcatSlices[resource.TemplateInterface](staging, production, misc), nil + return operatorutil.ConcatSlices(staging, production, misc), nil } // EnvGenerator has methods to generate resources for an 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/generator.go b/pkg/generators/autossl/generator.go index 35f1e55b..cfb77ec5 100644 --- a/pkg/generators/autossl/generator.go +++ b/pkg/generators/autossl/generator.go @@ -94,7 +94,7 @@ func (gen *Generator) Resources() ([]resource.TemplateInterface, error) { grafanadashboard.New(gen.GetKey(), gen.GetLabels(), *gen.Spec.GrafanaDashboard, "dashboards/autossl.json.gtpl")). WithEnabled(!gen.Spec.GrafanaDashboard.IsDeactivated()), } - return operatorutil.ConcatSlices[resource.TemplateInterface](workload, misc), nil + return operatorutil.ConcatSlices(workload, misc), nil } func (gen *Generator) Services() []*resource.Template[*corev1.Service] { 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/generator.go b/pkg/generators/backend/generator.go index 83250be2..3b32db11 100644 --- a/pkg/generators/backend/generator.go +++ b/pkg/generators/backend/generator.go @@ -199,7 +199,7 @@ func (gen *Generator) Resources() ([]resource.TemplateInterface, error) { WithEnabled(gen.config.ErrorMonitoringKey != nil), } - return operatorutil.ConcatSlices[resource.TemplateInterface](listener_resources, worker_resources, cron_resources, misc), nil + return operatorutil.ConcatSlices(listener_resources, worker_resources, cron_resources, misc), nil } // ListenerGenerator has methods to generate resources for a 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/generator.go b/pkg/generators/corsproxy/generator.go index 8b91be1c..76a593e3 100644 --- a/pkg/generators/corsproxy/generator.go +++ b/pkg/generators/corsproxy/generator.go @@ -70,7 +70,7 @@ func (gen *Generator) Resources() ([]resource.TemplateInterface, error) { grafanadashboard.New(gen.GetKey(), gen.GetLabels(), *gen.Spec.GrafanaDashboard, "dashboards/cors-proxy.json.gtpl")). WithEnabled(!gen.Spec.GrafanaDashboard.IsDeactivated()), } - return operatorutil.ConcatSlices[resource.TemplateInterface](workload, misc), nil + return operatorutil.ConcatSlices(workload, misc), nil } func (gen *Generator) Services() []*resource.Template[*corev1.Service] { 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/generator.go b/pkg/generators/mappingservice/generator.go index f0933fa1..2163ab34 100644 --- a/pkg/generators/mappingservice/generator.go +++ b/pkg/generators/mappingservice/generator.go @@ -70,7 +70,7 @@ func (gen *Generator) Resources() ([]resource.TemplateInterface, error) { *gen.Spec.Config.ExternalSecret.SecretStoreRef.Name, *gen.Spec.Config.ExternalSecret.SecretStoreRef.Kind, *gen.Spec.Config.ExternalSecret.RefreshInterval, gen.GetLabels(), gen.Options)), } - return operatorutil.ConcatSlices[resource.TemplateInterface](workload, misc), nil + return operatorutil.ConcatSlices(workload, misc), nil } func (gen *Generator) Services() []*resource.Template[*corev1.Service] { 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/generator.go b/pkg/generators/system/generator.go index 904af5dc..04a3538e 100644 --- a/pkg/generators/system/generator.go +++ b/pkg/generators/system/generator.go @@ -357,7 +357,7 @@ func (gen *Generator) Resources() ([]resource.TemplateInterface, error) { ) } - return operatorutil.ConcatSlices[resource.TemplateInterface]( + return operatorutil.ConcatSlices( app_resources, sidekiq_default_resources, sidekiq_billing_resources, 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/generator.go b/pkg/generators/zync/generator.go index 402ad634..8bf0ec13 100644 --- a/pkg/generators/zync/generator.go +++ b/pkg/generators/zync/generator.go @@ -125,7 +125,7 @@ func (gen *Generator) Resources() ([]resource.TemplateInterface, error) { ), } - return operatorutil.ConcatSlices[resource.TemplateInterface]( + return operatorutil.ConcatSlices( app_resources, que_resources, gen.Console.StatefulSet(), 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{ diff --git a/pkg/version/version.go b/pkg/version/version.go index f4ab7118..a48ba482 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -1,7 +1,7 @@ package version const ( - version string = "v0.21.0-alpha.15" + version string = "v0.21.0-alpha.16" ) // Current returns the current marin3r operator version