Documentation ¶
Index ¶
- Constants
- Variables
- func DirectCSIClient(token string) (*direct.Clientset, error)
- func GetK8sAPIServer() string
- func GetK8sConfig(token string) *rest.Config
- func GetLatestMinioImage(client HTTPClientI) (*string, error)
- func GetMinioImage() (*string, error)
- func GetNsFromFile() string
- func K8sClient(token string) (*kubernetes.Clientset, error)
- func OperatorClient(token string) (*operator.Clientset, error)
- type HTTPClient
- type HTTPClientI
Constants ¶
const ( ConsoleK8sAPIServer = "CONSOLE_K8S_API_SERVER" ConsoleK8SAPIServerTLSRootCA = "CONSOLE_K8S_API_SERVER_TLS_ROOT_CA" ConsoleMinioImage = "CONSOLE_MINIO_IMAGE" ConsoleMCImage = "CONSOLE_MC_IMAGE" )
Variables ¶
var Namespace = GetNsFromFile()
Namespace will run only once at console startup
Functions ¶
func DirectCSIClient ¶ added in v0.6.4
DirectCSIClient returns Direct CSI client using GetK8sConfig for its config
func GetK8sAPIServer ¶
func GetK8sAPIServer() string
func GetK8sConfig ¶
func GetLatestMinioImage ¶
func GetLatestMinioImage(client HTTPClientI) (*string, error)
GetLatestMinioImage returns the latest image URL on minio repository
func GetMinioImage ¶
GetMinioImage returns the image URL to be used when deploying a MinIO instance, if there is a preferred image to be used (configured via ENVIRONMENT VARIABLES) GetMinioImage will return that if not, GetMinioImage will try to obtain the image URL for the latest version of MinIO and return that
func GetNsFromFile ¶
func GetNsFromFile() string
GetNsFromFile assumes console is running inside a k8s pod and extract the current namespace from the /var/run/secrets/kubernetes.io/serviceaccount/namespace file
Types ¶
type HTTPClient ¶
HTTPClient Interface implementation
Define the structure of a http client and define the functions that are actually used
type HTTPClientI ¶
type HTTPClientI interface { Get(url string) (resp *http.Response, err error) Post(url, contentType string, body io.Reader) (resp *http.Response, err error) Do(req *http.Request) (*http.Response, error) }
HTTPClientI interface with all functions to be implemented by mock when testing, it should include all HttpClient respective api calls that are used within this project.