mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-04-07 11:17:36 +00:00
36 lines
1.4 KiB
Go
36 lines
1.4 KiB
Go
package mizu
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/up9inc/mizu/cli/mizu/configStructs"
|
|
)
|
|
|
|
const (
|
|
AgentImageConfigName = "agent-image"
|
|
MizuResourcesNamespaceConfigName = "mizu-resources-namespace"
|
|
TelemetryConfigName = "telemetry"
|
|
DumpLogsConfigName = "dump-logs"
|
|
KubeConfigPathName = "kube-config-path"
|
|
)
|
|
|
|
type ConfigStruct struct {
|
|
Tap configStructs.TapConfig `yaml:"tap"`
|
|
Fetch configStructs.FetchConfig `yaml:"fetch"`
|
|
Version configStructs.VersionConfig `yaml:"version"`
|
|
View configStructs.ViewConfig `yaml:"view"`
|
|
AgentImage string `yaml:"agent-image,omitempty" readonly:""`
|
|
MizuResourcesNamespace string `yaml:"mizu-resources-namespace" default:"mizu"`
|
|
Telemetry bool `yaml:"telemetry" default:"true"`
|
|
DumpLogs bool `yaml:"dump-logs" default:"false"`
|
|
KubeConfigPath string `yaml:"kube-config-path" default:""`
|
|
}
|
|
|
|
func (config *ConfigStruct) SetDefaults() {
|
|
config.AgentImage = fmt.Sprintf("gcr.io/up9-docker-hub/mizu/%s:%s", Branch, SemVer)
|
|
}
|
|
|
|
func (config *ConfigStruct) IsNsRestrictedMode() bool {
|
|
return config.MizuResourcesNamespace != "mizu" // Notice "mizu" string must match the default MizuResourcesNamespace
|
|
}
|