Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/tool/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

const (
rulerAPIPath = "/api/v1/rules"
rulerAPIPath = "/loki/api/v1/rules"
legacyAPIPath = "/api/prom/rules"
)

Expand Down
10 changes: 5 additions & 5 deletions pkg/tool/client/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,31 @@ func TestLokiClient(t *testing.T) {
test: "regular-characters",
namespace: "my-namespace",
name: "my-name",
expURLPath: "/api/v1/rules/my-namespace/my-name",
expURLPath: "/loki/api/v1/rules/my-namespace/my-name",
},
{
test: "special-characters-spaces",
namespace: "My: Namespace",
name: "My: Name",
expURLPath: "/api/v1/rules/My:%20Namespace/My:%20Name",
expURLPath: "/loki/api/v1/rules/My:%20Namespace/My:%20Name",
},
{
test: "special-characters-slashes",
namespace: "My/Namespace",
name: "My/Name",
expURLPath: "/api/v1/rules/My%2FNamespace/My%2FName",
expURLPath: "/loki/api/v1/rules/My%2FNamespace/My%2FName",
},
{
test: "special-characters-slash-first",
namespace: "My/Namespace",
name: "/first-char-slash",
expURLPath: "/api/v1/rules/My%2FNamespace/%2Ffirst-char-slash",
expURLPath: "/loki/api/v1/rules/My%2FNamespace/%2Ffirst-char-slash",
},
{
test: "special-characters-slash-first",
namespace: "My/Namespace",
name: "last-char-slash/",
expURLPath: "/api/v1/rules/My%2FNamespace/last-char-slash%2F",
expURLPath: "/loki/api/v1/rules/My%2FNamespace/last-char-slash%2F",
},
} {
t.Run(tc.test, func(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions pkg/tool/commands/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,17 @@ func (r *RuleCommand) Register(app *kingpin.Application) {

c.Flag("tls-ca-path", "TLS CA certificate to verify Loki API as part of mTLS, alternatively set LOKI_TLS_CA_PATH.").
Default("").
Envar("LOKI_TLS_CA_CERT").
Envar("LOKI_TLS_CA_PATH").
StringVar(&r.ClientConfig.TLS.CAPath)

c.Flag("tls-cert-path", "TLS client certificate to authenticate with Loki API as part of mTLS, alternatively set Loki_TLS_CERT_PATH.").
c.Flag("tls-cert-path", "TLS client certificate to authenticate with Loki API as part of mTLS, alternatively set LOKI_TLS_CERT_PATH.").
Default("").
Envar("LOKI_TLS_CLIENT_CERT").
Envar("LOKI_TLS_CERT_PATH").
StringVar(&r.ClientConfig.TLS.CertPath)

c.Flag("tls-key-path", "TLS client certificate private key to authenticate with Loki API as part of mTLS, alternatively set LOKI_TLS_KEY_PATH.").
Default("").
Envar("LOKI_TLS_CLIENT_KEY").
Envar("LOKI_TLS_KEY_PATH").
StringVar(&r.ClientConfig.TLS.KeyPath)

}
Expand Down
Loading