Documentation
¶
Index ¶
- Constants
- func ConvertAndSaveYamlToJSON(targetName string) (string, error)
- func CreateRequest(createCrdPath string, filePath string) (string, error)
- func GetClient() (*kubernetes.Clientset, error)
- func GetDynamicClient() (*dynamic.DynamicClient, error)
- func GetKubeConfigPath() (string, error)
- func LoadKubeConfig(kubeconfigFullPath string) (*api.Config, error)
- type ContextInfo
- type ContextType
Constants ¶
const ConfigFileName = "config.yml"
Variables ¶
This section is empty.
Functions ¶
func ConvertAndSaveYamlToJSON ¶
ConvertAndSaveYamlToJSON takes a YAML file path and a target file name, converts it to JSON, and does not convert if the JSON file already exists.
func GetClient ¶
func GetClient() (*kubernetes.Clientset, error)
GetClient creates and returns a Kubernetes client based on the specified KubeConfigPath file path.
func GetDynamicClient ¶
func GetDynamicClient() (*dynamic.DynamicClient, error)
GetDynamicClient creates and returns a Kubernetes dynamic client based on the specified KubeConfigPath file path.
func GetKubeConfigPath ¶
GetKubeConfigPath retrieves the kubeConfigPath based on the contents of the config file.
Types ¶
type ContextInfo ¶
type ContextInfo struct { ClientCert string ClientKey string CACert string APIServer string ContentType ContextType }
ContextInfo is a structure to hold client certificate, key, CA certificate, API server URL, and content type.
func GetContextInfo ¶
func GetContextInfo(config *api.Config) (*ContextInfo, error)
GetContextInfo extracts the client certificate, key, CA certificate, API server URL, and content type from the provided *api.Config for the current context.