Documentation
¶
Index ¶
- Variables
- func AddShutDownHook(stopFunc func())
- func CheckDockerDaemon() error
- func ExecuteCommand(cmd string) (stdout, stderr string, err error)
- func ExpandFilePath(path string) string
- func ExportEnvVars(envFile string)
- func GetManifests(manifests string) (files []string, err error)
- func OperateManifest(c *kubernetes.Clientset, dc dynamic.Interface, manifest string, ...) error
- func PathExist(_path string) bool
- func ReadFileContent(filename string) (string, error)
- func ResolveAbs(p string) string
- func ResolveAbsWithBase(p, baseFile string) string
- func UserHomeDir() string
- type HookScriptTemplate
- type K8sClusterInfo
- func (c *K8sClusterInfo) CopyClusterToNamespace(namespace string) *K8sClusterInfo
- func (c *K8sClusterInfo) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
- func (c *K8sClusterInfo) ToRESTConfig() (*rest.Config, error)
- func (c *K8sClusterInfo) ToRESTMapper() (meta.RESTMapper, error)
- func (c *K8sClusterInfo) ToRawKubeConfigLoader() clientcmd.ClientConfig
- type ResourceLogFollower
- type WaitSet
Constants ¶
This section is empty.
Variables ¶
var ( CfgFile string WorkDir string LogDir string BatchMode bool )
Functions ¶
func AddShutDownHook ¶ added in v1.1.0
func AddShutDownHook(stopFunc func())
func CheckDockerDaemon ¶
func CheckDockerDaemon() error
CheckDockerDaemon checks if docker daemon is running.
func ExecuteCommand ¶
ExecuteCommand executes the given command and returns the result.
func ExpandFilePath ¶
ExpandFilePath expands the leading `~` to absolute path
func ExportEnvVars ¶ added in v1.1.0
func ExportEnvVars(envFile string)
func GetManifests ¶
GetManifests recursively gets all yml and yaml files from manifests string.
func OperateManifest ¶
func OperateManifest(c *kubernetes.Clientset, dc dynamic.Interface, manifest string, operation apiv1.Operation) error
OperateManifest operates manifest in k8s cluster which kind created.
func ReadFileContent ¶
ReadFileContent reads the file content.
func ResolveAbs ¶
ResolveAbs resolves the relative path (relative to CfgFile) to an absolute file path.
func ResolveAbsWithBase ¶ added in v1.1.0
ResolveAbsWithBase resolves the relative path (relative to appoint file path) to an absolute file path.
func UserHomeDir ¶
func UserHomeDir() string
UserHomeDir returns the current user's home directory absolute path, which is usually represented as `~` in most shells
Types ¶
type HookScriptTemplate ¶
type HookScriptTemplate struct {
EnvFile string
}
type K8sClusterInfo ¶
type K8sClusterInfo struct { Client *kubernetes.Clientset Interface dynamic.Interface // contains filtered or unexported fields }
K8sClusterInfo created when connect to cluster
func ConnectToK8sCluster ¶
func ConnectToK8sCluster(kubeConfigPath string) (info *K8sClusterInfo, err error)
ConnectToK8sCluster gets clientSet and dynamic client from k8s config file.
func (*K8sClusterInfo) CopyClusterToNamespace ¶ added in v1.1.0
func (c *K8sClusterInfo) CopyClusterToNamespace(namespace string) *K8sClusterInfo
func (*K8sClusterInfo) ToDiscoveryClient ¶ added in v1.1.0
func (c *K8sClusterInfo) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
func (*K8sClusterInfo) ToRESTConfig ¶ added in v1.1.0
func (c *K8sClusterInfo) ToRESTConfig() (*rest.Config, error)
func (*K8sClusterInfo) ToRESTMapper ¶ added in v1.1.0
func (c *K8sClusterInfo) ToRESTMapper() (meta.RESTMapper, error)
func (*K8sClusterInfo) ToRawKubeConfigLoader ¶ added in v1.1.0
func (c *K8sClusterInfo) ToRawKubeConfigLoader() clientcmd.ClientConfig
type ResourceLogFollower ¶ added in v1.1.0
func NewResourceLogFollower ¶ added in v1.1.0
func NewResourceLogFollower(ctx context.Context, basePath string) *ResourceLogFollower
func (*ResourceLogFollower) BuildLogWriter ¶ added in v1.1.0
func (l *ResourceLogFollower) BuildLogWriter(path string) (*os.File, error)
func (*ResourceLogFollower) Close ¶ added in v1.1.0
func (l *ResourceLogFollower) Close()
func (*ResourceLogFollower) ConsumeLog ¶ added in v1.1.0
func (l *ResourceLogFollower) ConsumeLog(logWriter *os.File, stream io.ReadCloser) <-chan struct{}
func (*ResourceLogFollower) IsFollowed ¶ added in v1.1.0
func (l *ResourceLogFollower) IsFollowed(path string) bool