mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-08-25 00:47:27 +00:00
* Rename `mizu` to `kubeshark` * Rename `up9inc` to `kubeshark` * Change the logo, title, motto and the main color * Replace the favicon * Update the docs link * Change the copyright text in C files * Remove a comment * Rewrite the `README.md` and update the logo and screenshots used in it * Add a `TODO` * Fix the grammar * Fix the bottom text in the filtering guide * Change the Docker Hub username of cross-compilation intermediate images * Add an install script * Fix `docker/login-action` in the CI * Delete `build-custom-branch.yml` GitHub workflow * Update `README.md` * Remove `install.sh` * Change the motto back to "Traffic viewer for Kubernetes"
36 lines
564 B
Go
36 lines
564 B
Go
package configStructs
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"path"
|
|
)
|
|
|
|
const (
|
|
FileLogsName = "file"
|
|
)
|
|
|
|
type LogsConfig struct {
|
|
FileStr string `yaml:"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 `kubeshark logs -f <full path dest zip file>)`", err)
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (config *LogsConfig) FilePath() string {
|
|
if config.FileStr == "" {
|
|
pwd, _ := os.Getwd()
|
|
return path.Join(pwd, "kubeshark_logs.zip")
|
|
}
|
|
|
|
return config.FileStr
|
|
}
|