Skip to content

Commit c7d953a

Browse files
committed
fix linting issues
1 parent 7e3fb6a commit c7d953a

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

kubernetes/controllers/servicelevelobjective.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func (r *ServiceLevelObjectiveReconciler) Reconcile(ctx context.Context, req ctr
7373
}
7474

7575
if r.MimirClient != nil {
76-
7776
mimirFinalizer := "mimir.servicelevelobjective.pyrra.dev/finalizer"
7877
if slo.ObjectMeta.DeletionTimestamp.IsZero() {
7978
// slo is not being deleted, add our finalizer if not already present
@@ -284,7 +283,7 @@ func makeConfigMap(name string, kubeObjective pyrrav1alpha1.ServiceLevelObjectiv
284283
}, nil
285284
}
286285

287-
func makeMimirRuleGroup(kubeObjective pyrrav1alpha1.ServiceLevelObjective, genericRules bool, writeAlertingRules bool) (*rulefmt.RuleGroup, error) {
286+
func makeMimirRuleGroup(kubeObjective pyrrav1alpha1.ServiceLevelObjective, genericRules, writeAlertingRules bool) (*rulefmt.RuleGroup, error) {
288287
objective, err := kubeObjective.Internal()
289288
if err != nil {
290289
return nil, fmt.Errorf("failed to get objective: %w", err)

mimir/client.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ import (
88
"net/url"
99
)
1010

11-
// Client is a simple client for the required Mimir API resources
11+
// Client is a simple client for the required Mimir API resources.
1212
type Client struct {
1313
client http.Client
1414
address *url.URL
1515
prometheusPrefix string
1616
}
1717

18-
// Config is used to configure the client
18+
// Config is used to configure the client.
1919
type Config struct {
2020
Address string
2121
PrometheusPrefix string
2222
BasicAuthUsername string
2323
BasicAuthPassword string
2424
}
2525

26-
// NewClient creates a new client with the given configuration
26+
// NewClient creates a new client with the given configuration.
2727
func NewClient(config Config) (*Client, error) {
2828
addr, err := url.Parse(config.Address)
2929
if err != nil {
@@ -51,20 +51,20 @@ func NewClient(config Config) (*Client, error) {
5151
}, nil
5252
}
5353

54-
// BasicAuthTransport is a transport that adds basic auth to the request
54+
// BasicAuthTransport is a transport that adds basic auth to the request.
5555
type BasicAuthTransport struct {
5656
Username string
5757
Password string
5858
Transport http.RoundTripper
5959
}
6060

61-
// RoundTrip adds basic auth to the request
61+
// RoundTrip adds basic auth to the request.
6262
func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error) {
6363
req.SetBasicAuth(t.Username, t.Password)
6464
return t.Transport.RoundTrip(req)
6565
}
6666

67-
// Ready checks if mimir is ready to serve traffic
67+
// Ready checks if mimir is ready to serve traffic.
6868
func (c *Client) Ready(ctx context.Context) error {
6969
path := c.address.JoinPath("/ready")
7070

mimir/rulegroup.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"gopkg.in/yaml.v3"
1212
)
1313

14-
// SetRuleGroup creates or updates a rule group
14+
// SetRuleGroup creates or updates a rule group.
1515
func (c *Client) SetRuleGroup(ctx context.Context, namespace string, ruleGroup rulefmt.RuleGroup) error {
1616
path := c.address.JoinPath(c.prometheusPrefix, "/config/v1/rules/", namespace)
1717

@@ -40,7 +40,7 @@ func (c *Client) SetRuleGroup(ctx context.Context, namespace string, ruleGroup r
4040
return nil
4141
}
4242

43-
// DeleteNamespace deletes all the rule groups in a namespace (including the namespace itself)
43+
// DeleteNamespace deletes all the rule groups in a namespace (including the namespace itself).
4444
func (c *Client) DeleteNamespace(ctx context.Context, namespace string) error {
4545
path := c.address.JoinPath(c.prometheusPrefix, "/config/v1/rules/", namespace)
4646

0 commit comments

Comments
 (0)