Documentation
¶
Index ¶
- Variables
- func CheckDockerDaemon() error
- func ExecuteCommand(cmd string) (stdout, stderr string, err error)
- func ExpandFilePath(path string) 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 UserHomeDir() string
- type HookScriptTemplate
- type K8sClusterInfo
- type SimpleRESTClientGetter
- func (c *SimpleRESTClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
- func (c *SimpleRESTClientGetter) ToRESTConfig() (*rest.Config, error)
- func (c *SimpleRESTClientGetter) ToRESTMapper() (meta.RESTMapper, error)
- func (c *SimpleRESTClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig
- type WaitSet
Constants ¶
This section is empty.
Variables ¶
var ( CfgFile string WorkDir string )
Functions ¶
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 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 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
}
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.
type SimpleRESTClientGetter ¶
SimpleRESTClientGetter implements genericclioptions.RESTClientGetter, so that we can use kubectl's functions just by passing kubeConfig and namespace.
func NewSimpleRESTClientGetter ¶
func NewSimpleRESTClientGetter(namespace, kubeConfig string) *SimpleRESTClientGetter
func (*SimpleRESTClientGetter) ToDiscoveryClient ¶
func (c *SimpleRESTClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
func (*SimpleRESTClientGetter) ToRESTConfig ¶
func (c *SimpleRESTClientGetter) ToRESTConfig() (*rest.Config, error)
func (*SimpleRESTClientGetter) ToRESTMapper ¶
func (c *SimpleRESTClientGetter) ToRESTMapper() (meta.RESTMapper, error)
func (*SimpleRESTClientGetter) ToRawKubeConfigLoader ¶
func (c *SimpleRESTClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig