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 ¶ added in v0.10.0
func GetKubeConfigFile() string
GetKubeConfigFile gets the .kubeconfig file. Never returns an empty string, fallback to default path if not present in the known locations
func MustEnsureClient ¶
func MustEnsureClient(c *Client) controllercli.Client
MustEnsureClient will try to read the kube.yaml file from the host and connect to the cluster, if the Client or the Core Client is null. Will panic if the connection won't be possible
Types ¶
type Builder ¶ added in v0.7.0
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 ¶ added in v0.7.0
func NewClientBuilder() Builder
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 ¶ added in v0.6.0
func NewForConsole() *Client
NewForConsole will create a brand new client using the local machine
func NewForController ¶ added in v0.6.0
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 ¶ added in v0.6.0
HasServerGroup detects if the given api group is supported by the server
func (*Client) IsKogitoCRDsAvailable ¶ added in v1.1.0
IsKogitoCRDsAvailable detects if the CRDs for kogito-operator are available or not
func (*Client) IsOLMAvaialable ¶ added in v1.1.0
IsOLMAvaialable detects if the cluster has OLM installed or not
func (*Client) IsOpenshift ¶ added in v0.4.0
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 meta has functions that creates and/or define meta information of Kubernetes/OpenShift objects
|
Package meta has functions that creates and/or define meta information of Kubernetes/OpenShift objects |
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 |