mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-13 02:06:16 +00:00
* WIP
* WIP
* WIP
* WIP
* WIP
* Update tapRunner.go and k8sTapManager.go
* Update cleanRunner.go, common.go, and 8 more files...
* Update common.go, tapConfig.go, and 2 more files...
* Update config.go, config.go, and 5 more files...
* Update tapRunner.go, config.go, and 7 more files...
* Update cleanRunner.go, logs.go, and 2 more files...
* Update k8sTapManager.go, provider.go, and watch.go
* Update go.sum, go.mod, and go.sum
* Update go.mod and go.sum
* Update go.mod, go.sum, and 2 more files...
* Revert "Update go.mod, go.sum, and 2 more files..."
This reverts commit 8140311349
.
* Update funcWrappers.go, tapRunner.go, and 4 more files...
* Update main.go, tapRunner.go, and mizuTapperSyncer.go
36 lines
554 B
Go
36 lines
554 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 `mizu 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, "mizu_logs.zip")
|
|
}
|
|
|
|
return config.FileStr
|
|
}
|