Documentation ¶
Overview ¶
Package client encapsulates all calls to Kubernetes/OpenShift API into meaningful functions
Index ¶
Constants ¶
const (
// OpenShiftGroupName name included in OpenShift APIs
OpenShiftGroupName = "openshift.io"
)
Variables ¶
This section is empty.
Functions ¶
func GetKubeConfigFile ¶
func GetKubeConfigFile() string
GetKubeConfigFile gets the .kubeconfig file. Never returns an empty string, fallback to default path if not present in the known locations
Types ¶
type Builder ¶
type Builder interface { // UseConfig sets the restconfig to use for the different CLIs UseConfig(kubeconfig *restclient.Config) Builder // UseControllerClient sets a specific controllerclient UseControllerClient(controllerClient controllercli.Client) Builder // UseControllerDynamicMapper will set a dynamic mapper to the constructed controller client. Cannot be used with `UseControllerClient` UseControllerDynamicMapper() Builder // WithDiscoveryClient tells the builder to create the discovery client WithDiscoveryClient() Builder // WithBuildClient tells the builder to create the build client WithBuildClient() Builder // WithImageClient tells the builder to create the image client WithImageClient() Builder // WithDeploymentClient tells the builder to create the deployment client WithDeploymentClient() Builder // WithKubernetesClient tells the builder to create the kubernetes extension client WithKubernetesExtensionClient() Builder // WithAllClients is a shortcut to tell the builder to create all clients WithAllClients() Builder // Build build the final client structure Build() (*Client, error) }
Builder wraps information about what to create for a client before building it
func NewClientBuilder ¶
NewClientBuilder creates a builder to setup the client
type Client ¶
type Client struct { // ControlCli is a reference for the controller-runtime client, normally built by a Manager inside the controller context. ControlCli controllercli.Client BuildCli buildv1.BuildV1Interface ImageCli imagev1.ImageV1Interface Discovery discovery.DiscoveryInterface DeploymentCli appsv1.AppsV1Interface KubernetesExtensionCli kubernetes.Interface }
Client wraps clients functions from controller-runtime, Kube and OpenShift cli for generic API calls to the cluster
func NewForConsole ¶
NewForConsole will create a brand new client using the local machine
func NewForController ¶
func NewForController(manager controllerruntime.Manager) *Client
NewForController creates a new client based on the rest config and the controller client created by Operator SDK Panic if something goes wrong
func (*Client) HasServerGroup ¶
HasServerGroup detects if the given api group is supported by the server
func (*Client) IsOLMAvaialable ¶
IsOLMAvaialable detects if the cluster has OLM installed or not
func (*Client) IsOpenshift ¶
IsOpenshift detects if the application is running on OpenShift or not
Directories ¶
Path | Synopsis |
---|---|
Package kubernetes encapsulates all calls to the Kubernetes API into meaningful functions for use by the CLI and controllers
|
Package kubernetes encapsulates all calls to the Kubernetes API into meaningful functions for use by the CLI and controllers |
Package openshift encapsulates all calls to the OpenShift API (only yo specific OpenShift objects) into meaningful functions for use by the CLI and controllers
|
Package openshift encapsulates all calls to the OpenShift API (only yo specific OpenShift objects) into meaningful functions for use by the CLI and controllers |