Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into upgrade_azserect_…
Browse files Browse the repository at this point in the history
…client

# Conflicts:
#	internal/keystore/azure/client.go
  • Loading branch information
guozhi.li committed Mar 4, 2024
2 parents 2367a0a + 8ecd396 commit 20fb156
Show file tree
Hide file tree
Showing 12 changed files with 1,330 additions and 181 deletions.
Binary file added .github/grafana-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ The ciphertext part of the DEK would be stored alongside the encrypted data for
decryption.

</details>

## Docs

If you want to learn more about KES checkout our [documentation](https://min.io/docs/kes/).
Expand All @@ -119,6 +119,15 @@ If you want to learn more about KES checkout our [documentation](https://min.io/
- [Server API](https://min.io/docs/kes/concepts/server-api/)
- [Go SDK](https://pkg.go.dev/github.com/minio/kes-go)

### Monitoring

KES servers provide an API endpoint `/v1/metrics` that observability tools, like [Prometheus](https://prometheus.io/), can scrape.
Refer to the [monitoring documentation](https://min.io/docs/kes/concepts/monitoring/) for how to setup and capture KES metrics.

For a graphical Grafana dashboard refer to the following [example](examples/grafana/dashboard.json).

![](.github/grafana-dashboard.png)

## FAQs

<details><summary><b>I have received an <code>insufficient permissions</code> error</b></summary>
Expand Down
15 changes: 12 additions & 3 deletions cmd/kes/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ func installAutoCompletion() {
}

var filename string
var isZsh bool
switch {
case strings.HasSuffix(shell, "zsh"):
filename = ".zshrc"
isZsh = true
case strings.HasSuffix(shell, "bash"):
filename = ".bashrc"
default:
Expand Down Expand Up @@ -128,8 +130,14 @@ func installAutoCompletion() {
autoloadCmd = "autoload -U +X bashcompinit && bashcompinit"
completeCmd = fmt.Sprintf("complete -o default -C %s %s", binaryPath, os.Args[0])
)

hasAutoloadLine, hasCompleteLine := isCompletionInstalled(filename, autoloadCmd, completeCmd)
if hasAutoloadLine && hasCompleteLine {
if isZsh && (hasAutoloadLine && hasCompleteLine) {
cli.Println("Completion is already installed.")
return
}

if !isZsh && hasCompleteLine {
cli.Println("Completion is already installed.")
return
}
Expand All @@ -140,11 +148,12 @@ func installAutoCompletion() {
}
defer file.Close()

if !hasAutoloadLine {
if isZsh && !hasAutoloadLine {
if _, err = file.WriteString(autoloadCmd + "\n"); err != nil {
cli.Fatalf("failed to add '%s' to '%s': %v", autoloadCmd, filename, err)
}
}

if !hasCompleteLine {
if _, err = file.WriteString(completeCmd + "\n"); err != nil {
cli.Fatalf("failed to add '%s' to '%s': %v", completeCmd, filename, err)
Expand All @@ -157,7 +166,7 @@ func installAutoCompletion() {
cli.Printf("Added completion to '%s'\n", filename)
cli.Println()
cli.Printf("To uninstall completion remove the following lines from '%s':\n", filename)
if !hasAutoloadLine {
if isZsh && !hasAutoloadLine {
cli.Println(" ", autoloadCmd)
}
if !hasCompleteLine {
Expand Down
Loading

0 comments on commit 20fb156

Please sign in to comment.