cluster

package
v0.3.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConsoleK8sAPIServer          = "CONSOLE_K8S_API_SERVER"
	ConsoleK8SAPIServerTLSRootCA = "CONSOLE_K8S_API_SERVER_TLS_ROOT_CA"
	ConsoleMinioImage            = "CONSOLE_MINIO_IMAGE"
	ConsoleMCImage               = "CONSOLE_MC_IMAGE"
	ConsoleNamespace             = "CONSOLE_NAMESPACE"
)

Variables

This section is empty.

Functions

func GetK8sAPIServer

func GetK8sAPIServer() string

func GetK8sConfig

func GetK8sConfig(token string) *rest.Config

func GetLatestMinioImage

func GetLatestMinioImage(client HTTPClientI) (*string, error)

GetLatestMinioImage returns the latest image URL on minio repository

func GetMCImage

func GetMCImage() (*string, error)

func GetMinioImage

func GetMinioImage() (*string, error)

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 GetNs

func GetNs() string

Returns the namespace in which the controller is installed

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

func K8sClient

func K8sClient(token string) (*kubernetes.Clientset, error)

K8sClient returns kubernetes client using GetK8sConfig for its config

func OperatorClient

func OperatorClient(token string) (*operator.Clientset, error)

OperatorClient returns an operator client using GetK8sConfig for its config

Types

type HTTPClient

type HTTPClient struct {
	Client *http.Client
}

HTTPClient Interface implementation

Define the structure of a http client and define the functions that are actually used

func (*HTTPClient) Get

func (c *HTTPClient) Get(url string) (resp *http.Response, err error)

Get implements http.Client.Get()

type HTTPClientI

type HTTPClientI interface {
	Get(url string) (resp *http.Response, err 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL