Documentation ¶
Index ¶
- Variables
- func InterfaceToMap(m interface{}) (map[string]string, error)
- func InterfaceToString(i interface{}) (string, error)
- func KubeConfigPath() (string, error)
- func PanicWithRed(err error)
- type KubeClient
- type KubeConfig
- func (k *KubeConfig) ChangeContextName(ctxName, changedCtxName string) error
- func (k *KubeConfig) DeleteContext(ctxName string) error
- func (k *KubeConfig) GetContexts() ([]*KubeContext, error)
- func (k *KubeConfig) GetCurrentContext() (*KubeContext, error)
- func (k *KubeConfig) RawBytes() ([]byte, error)
- func (k *KubeConfig) SetCurrentContext(ctxName string) error
- func (k *KubeConfig) SetNamespace(ctxName, namespace string) error
- func (k *KubeConfig) Sync() error
- type KubeContext
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidParams = errors.New("[err] invalid params") ErrInvalidFileFormat = errors.New("[err] invalid file format") ErrNotFoundPath = errors.New("[err] not found path") ErrUnknownValue = errors.New("[err] unknown value") ErrNotFoundContext = errors.New("[err] not found context") )
Functions ¶
func InterfaceToMap ¶ added in v0.1.9
InterfaceToMap converts interface{} type to map[string]string
func InterfaceToString ¶
InterfaceToString converts a value having interface type to string
func KubeConfigPath ¶
KubeConfigPath returns a config path for kubernetes.
func PanicWithRed ¶
func PanicWithRed(err error)
PanicWithRed is to print error message with red color and to exit process.
Types ¶
type KubeClient ¶
type KubeClient struct {
*kubernetes.Clientset
}
type KubeConfig ¶
type KubeConfig struct {
// contains filtered or unexported fields
}
KubeConfig is a struct for kubernetes config file.
func NewKubeConfig ¶
func NewKubeConfig(path string) (*KubeConfig, error)
NewKubeConfig returns struct for kubernetes config file.
func (*KubeConfig) ChangeContextName ¶
func (k *KubeConfig) ChangeContextName(ctxName, changedCtxName string) error
ChangeContextName changes context name in context section.
func (*KubeConfig) DeleteContext ¶ added in v0.2.0
func (k *KubeConfig) DeleteContext(ctxName string) error
DeleteContext deletes context.
func (*KubeConfig) GetContexts ¶
func (k *KubeConfig) GetContexts() ([]*KubeContext, error)
GetContexts returns kubernetes context list.
func (*KubeConfig) GetCurrentContext ¶
func (k *KubeConfig) GetCurrentContext() (*KubeContext, error)
GetCurrentContext returns current context.
func (*KubeConfig) RawBytes ¶
func (k *KubeConfig) RawBytes() ([]byte, error)
RawBytes returns kubernetes config raw bytes.
func (*KubeConfig) SetCurrentContext ¶
func (k *KubeConfig) SetCurrentContext(ctxName string) error
SetCurrentContext sets current context by passing param.
func (*KubeConfig) SetNamespace ¶
func (k *KubeConfig) SetNamespace(ctxName, namespace string) error
SetNamespace sets namespace in context.
type KubeContext ¶
KubeContext is a struct for kubernetes context.
func (*KubeContext) GetNamespace ¶
func (k *KubeContext) GetNamespace() string
GetNamespace returns namespace