Skip to content

Commit

Permalink
use capital letters for function names
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumEnigmaa committed May 20, 2024
1 parent fe30ae2 commit 8e4fe91
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/monitoring/mimir/ingress/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/giantswarm/observability-operator/pkg/monitoring/mimir"
)

func (ms *MimirService) buildIngressSecret(username string, password string) (*corev1.Secret, error) {
func (ms *MimirService) BuildIngressSecret(username string, password string) (*corev1.Secret, error) {
// Uses htpasswd to generate the password hash.
secretData, err := exec.Command("htpasswd", "-bn", username, password).Output()
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions pkg/monitoring/mimir/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (ms *MimirService) ReconcileMimirConfig(ctx context.Context, mc string) err
logger := log.FromContext(ctx).WithValues("cluster", mc)
logger.Info("ensuring mimir config")

err := ms.createOrUpdateIngressSecret(ctx, mc, logger)
err := ms.CreateOrUpdateIngressSecret(ctx, mc, logger)
if err != nil {
logger.Error(err, "failed to create or update mimir config")
return errors.WithStack(err)
Expand All @@ -32,7 +32,7 @@ func (ms *MimirService) ReconcileMimirConfig(ctx context.Context, mc string) err
return nil
}

func (ms *MimirService) createOrUpdateIngressSecret(ctx context.Context, mc string, logger logr.Logger) error {
func (ms *MimirService) CreateOrUpdateIngressSecret(ctx context.Context, mc string, logger logr.Logger) error {
objectKey := client.ObjectKey{
Name: "mimir-gateway-ingress",
Namespace: "mimir",
Expand All @@ -44,12 +44,12 @@ func (ms *MimirService) createOrUpdateIngressSecret(ctx context.Context, mc stri
// CREATE SECRET
logger.Info("building ingress secret")

password, err := getMimirIngressPassword(ctx, mc)
password, err := GetMimirIngressPassword(ctx, mc)
if err != nil {
return errors.WithStack(err)
}

secret, err := ms.buildIngressSecret(mc, password)
secret, err := ms.BuildIngressSecret(mc, password)
if err != nil {
return errors.WithStack(err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/monitoring/mimir/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

// Checks whether Mimir is enabled in the cluster by listing the pods in the Mimir namespace.
func isMimirEnabled(ctx context.Context) bool {
func IsMimirEnabled(ctx context.Context) bool {
cfg, err := config.GetConfig()
if err != nil {
log.Fatal(err)
Expand All @@ -35,7 +35,7 @@ func isMimirEnabled(ctx context.Context) bool {
return len(mimirPods.Items) > 0
}

func getMimirIngressPassword(ctx context.Context, mc string) (string, error) {
func GetMimirIngressPassword(ctx context.Context, mc string) (string, error) {
cfg, err := config.GetConfig()
if err != nil {
return "", err
Expand Down
2 changes: 1 addition & 1 deletion pkg/monitoring/prometheusagent/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (pas PrometheusAgentService) createOrUpdateSecret(ctx context.Context,
Name: getPrometheusAgentRemoteWriteSecretName(cluster),
Namespace: cluster.GetNamespace(),
}
mimirEnabled := isMimirEnabled(ctx)
mimirEnabled := IsMimirEnabled(ctx)

current := &corev1.Secret{}
// Get the current secret if it exists.
Expand Down

0 comments on commit 8e4fe91

Please sign in to comment.