Skip to content

Commit

Permalink
remove finalizers from secrets and configmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumEnigmaa committed May 28, 2024
1 parent e8fc1dd commit dca9ba4
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 21 deletions.
5 changes: 0 additions & 5 deletions pkg/common/secret/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package secret
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/giantswarm/observability-operator/pkg/monitoring"
)

type Manager interface {
Expand All @@ -20,9 +18,6 @@ func (m SimpleManager) GenerateGenericSecret(secretName string, secretNamespace
ObjectMeta: metav1.ObjectMeta{
Name: secretName,
Namespace: secretNamespace,
Finalizers: []string{
monitoring.MonitoringFinalizer,
},
},
Data: map[string][]byte{
key: []byte(value),
Expand Down
3 changes: 0 additions & 3 deletions pkg/monitoring/mimir/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import (
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/log"

"github.com/giantswarm/observability-operator/pkg/common/password"
"github.com/giantswarm/observability-operator/pkg/common/secret"
"github.com/giantswarm/observability-operator/pkg/monitoring"
"github.com/giantswarm/observability-operator/pkg/monitoring/prometheusagent"
)

Expand Down Expand Up @@ -149,7 +147,6 @@ func (ms *MimirService) DeleteIngressSecret(ctx context.Context) error {

// Delete the finalizer
desired := current.DeepCopy()
controllerutil.RemoveFinalizer(desired, monitoring.MonitoringFinalizer)
err = ms.Client.Patch(ctx, current, client.MergeFrom(desired))
if err != nil {
return errors.WithStack(err)
Expand Down
4 changes: 0 additions & 4 deletions pkg/monitoring/prometheusagent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"sigs.k8s.io/yaml"

"github.com/giantswarm/observability-operator/pkg/common"
"github.com/giantswarm/observability-operator/pkg/monitoring"
"github.com/giantswarm/observability-operator/pkg/monitoring/mimir/querier"
"github.com/giantswarm/observability-operator/pkg/monitoring/prometheusagent/shards"
)
Expand Down Expand Up @@ -74,9 +73,6 @@ func (pas PrometheusAgentService) buildRemoteWriteConfig(ctx context.Context,
ObjectMeta: metav1.ObjectMeta{
Name: getPrometheusAgentRemoteWriteConfigName(cluster),
Namespace: cluster.Namespace,
Finalizers: []string{
monitoring.MonitoringFinalizer,
},
},
Data: map[string]string{
"values": string(config),
Expand Down
5 changes: 0 additions & 5 deletions pkg/monitoring/prometheusagent/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/yaml"

"github.com/giantswarm/observability-operator/pkg/monitoring"
)

const (
Expand Down Expand Up @@ -97,9 +95,6 @@ func (pas PrometheusAgentService) buildRemoteWriteSecret(ctx context.Context,
ObjectMeta: metav1.ObjectMeta{
Name: getPrometheusAgentRemoteWriteSecretName(cluster),
Namespace: cluster.Namespace,
Finalizers: []string{
monitoring.MonitoringFinalizer,
},
},
Data: map[string][]byte{
"values": marshalledValues,
Expand Down
4 changes: 0 additions & 4 deletions pkg/monitoring/prometheusagent/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/log"

"github.com/giantswarm/observability-operator/pkg/common"
"github.com/giantswarm/observability-operator/pkg/common/organization"
"github.com/giantswarm/observability-operator/pkg/common/password"
"github.com/giantswarm/observability-operator/pkg/monitoring"
)

type PrometheusAgentService struct {
Expand Down Expand Up @@ -179,7 +177,6 @@ func (pas PrometheusAgentService) deleteConfigMap(ctx context.Context, cluster *

// Delete the finalizer
desired := current.DeepCopy()
controllerutil.RemoveFinalizer(desired, monitoring.MonitoringFinalizer)
err = pas.Client.Patch(ctx, desired, client.MergeFrom(current))
if err != nil {
return errors.WithStack(err)
Expand Down Expand Up @@ -209,7 +206,6 @@ func (pas PrometheusAgentService) deleteSecret(ctx context.Context, cluster *clu

// Delete the finalizer
desired := current.DeepCopy()
controllerutil.RemoveFinalizer(desired, monitoring.MonitoringFinalizer)
err = pas.Client.Patch(ctx, current, client.MergeFrom(desired))
if err != nil {
return errors.WithStack(err)
Expand Down

0 comments on commit dca9ba4

Please sign in to comment.