Skip to content

Commit

Permalink
small enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumEnigmaa committed May 21, 2024
1 parent 82f38fa commit 6b94f5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions pkg/monitoring/mimir/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ type MimirService struct {
client.Client
}

const (
ingressSecretName = "mimir-gateway-ingress"
ingressSecretNamespace = "mimir"
)

func (ms *MimirService) ReconcileMimirConfig(ctx context.Context, mc string) error {
logger := log.FromContext(ctx).WithValues("cluster", mc)
logger.Info("ensuring mimir config")
Expand All @@ -36,8 +41,8 @@ func (ms *MimirService) ReconcileMimirConfig(ctx context.Context, mc string) err

func (ms *MimirService) CreateOrUpdateIngressSecret(ctx context.Context, mc string, logger logr.Logger) error {
objectKey := client.ObjectKey{
Name: "mimir-gateway-ingress",
Namespace: "mimir",
Name: ingressSecretName,
Namespace: ingressSecretNamespace,
}

current := &corev1.Secret{}
Expand Down Expand Up @@ -89,8 +94,8 @@ func (ms *MimirService) CreateOrUpdateIngressSecret(ctx context.Context, mc stri

func (ms *MimirService) DeleteIngressSecret(ctx context.Context) error {
objectKey := client.ObjectKey{
Name: "mimir-gateway-ingress",
Namespace: "mimir",
Name: ingressSecretName,
Namespace: ingressSecretNamespace,
}
current := &corev1.Secret{}
// Get the current secret if it exists.
Expand Down
2 changes: 1 addition & 1 deletion pkg/monitoring/mimir/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func GetMimirIngressPassword(ctx context.Context, mc string) (string, error) {

err = c.Get(ctx, client.ObjectKey{
Name: fmt.Sprintf("%s-remote-write-secret", mc),
Namespace: "org-giantswarm",
Namespace: "org-gintswarm",
}, secret)
if err != nil {
return "", err
Expand Down

0 comments on commit 6b94f5d

Please sign in to comment.