mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-10-22 07:51:30 +00:00
* ✨ Use the Helm chart in `tap` command to install Kubeshark * ⬆️ Set Go version to `1.19` in `go.mod` file * ✨ Add `Helm` struct`, `NewHelm` and `NewHelmDefault` methods * ⚡ Better logging and error return * ⚡ Pass the config as `values.yaml` to Helm install * 🔥 Remove `helm-chart`, `manifests` and `check` commands * ➖ Run `go mod tidy` * 🎨 Move `helm` package into `kubernetes` package * 🔥 Remove `# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT!` notice from the manifests and Helm templates * 🔥 Remove the unused `GenerateApplyConfiguration` and `buildWithDefaultLabels` methods
25 lines
334 B
Go
25 lines
334 B
Go
package utils
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"gopkg.in/yaml.v3"
|
|
)
|
|
|
|
const (
|
|
empty = ""
|
|
tab = "\t"
|
|
)
|
|
|
|
func PrettyYaml(data interface{}) (string, error) {
|
|
buffer := new(bytes.Buffer)
|
|
encoder := yaml.NewEncoder(buffer)
|
|
encoder.SetIndent(2)
|
|
|
|
err := encoder.Encode(data)
|
|
if err != nil {
|
|
return empty, err
|
|
}
|
|
return buffer.String(), nil
|
|
}
|