mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-16 06:46:12 +00:00
🔨 Move cli
folder contents into project root (#1253)
* Remove `logger` module * Remove `shared` module * Move `cli` folder contents into project root * Fix linter * Change the module name from `github.com/kubeshark/kubeshark/cli` to `github.com/kubeshark/kubeshark` * Set the default `Makefile` rule to `build` * Add `lint` rule * Fix the linter errors
This commit is contained in:
35
config/configStructs/logsConfig.go
Normal file
35
config/configStructs/logsConfig.go
Normal file
@@ -0,0 +1,35 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user