mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-23 06:48:47 +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
38 lines
643 B
Go
38 lines
643 B
Go
package configStructs
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"path"
|
|
|
|
"github.com/kubeshark/kubeshark/misc"
|
|
)
|
|
|
|
const (
|
|
FileLogsName = "file"
|
|
)
|
|
|
|
type LogsConfig struct {
|
|
FileStr string `yaml:"file" json:"file"`
|
|
}
|
|
|
|
func (config *LogsConfig) Validate() error {
|
|
if config.FileStr == "" {
|
|
_, err := os.Getwd()
|
|
if err != nil {
|
|
return fmt.Errorf("failed to get PWD, %v (try using `%s logs -f <full path dest zip file>)`", err, misc.Program)
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (config *LogsConfig) FilePath() string {
|
|
if config.FileStr == "" {
|
|
pwd, _ := os.Getwd()
|
|
return path.Join(pwd, fmt.Sprintf("%s_logs.zip", misc.Program))
|
|
}
|
|
|
|
return config.FileStr
|
|
}
|