Skip to content

Commit

Permalink
change auth secret const name
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumEnigmaa committed May 22, 2024
1 parent de887f7 commit 877f8d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions pkg/monitoring/mimir/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
)

const (
ingressSecretName = "mimir-gateway-ingress"
ingressSecretNamespace = "mimir"
authSecretName = "mimir-gateway-ingress"
authSecretNamespace = "mimir"
mimirSpecificSecretName = "mimir-basic-auth"
mimirSpecificSecretNamespace = "mimir"
)
Expand Down Expand Up @@ -93,8 +93,8 @@ func (ms *MimirService) CreateAuthSecret(ctx context.Context, logger logr.Logger

func (ms *MimirService) CreateIngressSecret(ctx context.Context, mc string, logger logr.Logger) error {
objectKey := client.ObjectKey{
Name: ingressSecretName,
Namespace: ingressSecretNamespace,
Name: authSecretName,
Namespace: authSecretNamespace,
}

current := &corev1.Secret{}
Expand All @@ -113,7 +113,7 @@ func (ms *MimirService) CreateIngressSecret(ctx context.Context, mc string, logg
return errors.WithStack(err)
}

secret, err := ms.SecretManager.GenerateGenericSecret(ingressSecretName, ingressSecretNamespace, "auth", htpasswd)
secret, err := ms.SecretManager.GenerateGenericSecret(authSecretName, authSecretNamespace, "auth", htpasswd)
if err != nil {
return errors.WithStack(err)
}
Expand All @@ -135,8 +135,8 @@ func (ms *MimirService) CreateIngressSecret(ctx context.Context, mc string, logg

func (ms *MimirService) DeleteIngressSecret(ctx context.Context) error {
objectKey := client.ObjectKey{
Name: ingressSecretName,
Namespace: ingressSecretNamespace,
Name: authSecretName,
Namespace: authSecretNamespace,
}
current := &corev1.Secret{}
// Get the current secret if it exists.
Expand Down
10 changes: 5 additions & 5 deletions pkg/monitoring/prometheusagent/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
)

const (
mimirSpecificSecretName = "mimir-basic-auth"
mimirSpecificSecretNamespace = "mimir"
remoteWriteName = "mimir"
authSecretName = "mimir-basic-auth"
authSecretNamespace = "mimir"
remoteWriteName = "mimir"
)

func GetMimirIngressPassword(ctx context.Context) (string, error) {
Expand All @@ -37,8 +37,8 @@ func GetMimirIngressPassword(ctx context.Context) (string, error) {
secret := &corev1.Secret{}

err = c.Get(ctx, client.ObjectKey{
Name: mimirSpecificSecretName,
Namespace: mimirSpecificSecretNamespace,
Name: authSecretName,
Namespace: authSecretNamespace,
}, secret)
if err != nil {
return "", err
Expand Down

0 comments on commit 877f8d4

Please sign in to comment.