Documentation ¶
Index ¶
- Constants
- func AreAllPodsReady(podList *corev1.PodList) bool
- func ArePodIPsReady(pods *corev1.PodList) bool
- func CreateOrPatch(ctx context.Context, c client.Client, obj runtime.Object, ...) (controllerutil.OperationResult, error)
- func FindKubeConfig() string
- func FindStorageClass(name string, client crclient.Client) (*storagev1.StorageClass, error)
- func GetEnvVarIndex(envVarName string, env *[]corev1.EnvVar) int
- func GetOperatorNamespace() (string, error)
- func GetOperatorPodOwnerRef(ns string, client crclient.Client) (*metav1.OwnerReference, error)
- func GetPodDefaultImage(container corev1.Container) string
- func IsPodReady(pod corev1.Pod) bool
- func LookupResource(name, namespace string, resource runtime.Object, client client.Client, ...) (*reconcile.Result, error)
- func LookupServiceAccountTokenSecret(name, namespace string, client client.Client) (*corev1.Secret, error)
- func SetConfigDefaults(config *rest.Config) *rest.Config
- type ExecOptions
- type Kubernetes
- func (k Kubernetes) ExecWithOptions(options ExecOptions) (bytes.Buffer, string, error)
- func (k Kubernetes) GetExternalAddress(route *corev1.Service) string
- func (k Kubernetes) GetKubernetesRESTConfig(masterURL, secretName, namespace string, logger logr.Logger) (*restclient.Config, error)
- func (k Kubernetes) GetNodeHost(logger logr.Logger) (string, error)
- func (k Kubernetes) GetOpenShiftRESTConfig(masterURL, secretName, namespace string, logger logr.Logger) (*restclient.Config, error)
- func (k Kubernetes) GetSecret(secretName, namespace string) (*corev1.Secret, error)
- func (k Kubernetes) GetServingCertsMode() string
- func (k Kubernetes) IsGroupVersionSupported(groupVersion string, kind string) (bool, error)
- func (k Kubernetes) Logs(pod, namespace string) (logs string, err error)
- func (k Kubernetes) ResourcesList(namespace string, set labels.Set, list runtime.Object) error
Constants ¶
const ( // OperationResultUpdatedStatus means that an existing resource and its status is updated OperationResultUpdatedStatus controllerutil.OperationResult = "updatedStatus" // OperationResultUpdatedStatusOnly means that only an existing status is updated OperationResultUpdatedStatusOnly controllerutil.OperationResult = "updatedStatusOnly" EventReasonResourceNotReady = "ResourceNotReady" )
Variables ¶
This section is empty.
Functions ¶
func AreAllPodsReady ¶
func ArePodIPsReady ¶
func CreateOrPatch ¶
func CreateOrPatch(ctx context.Context, c client.Client, obj runtime.Object, f controllerutil.MutateFn) (controllerutil.OperationResult, error)
CreateOrPatch creates or patches the given object in the Kubernetes cluster. The object's desired state must be reconciled with the before state inside the passed in callback MutateFn.
The MutateFn is called regardless of creating or updating an object.
It returns the executed operation and an error.
func FindKubeConfig ¶
func FindKubeConfig() string
FindKubeConfig returns local Kubernetes configuration
func FindStorageClass ¶
FindStorageClass finds an existed storage class
func GetOperatorNamespace ¶
func GetOperatorPodOwnerRef ¶
func GetPodDefaultImage ¶
GetPodDefaultImage returns an Infinispan pod's default image. If the default image cannot be found, it returns the running image.
func IsPodReady ¶
func LookupResource ¶
func LookupResource(name, namespace string, resource runtime.Object, client client.Client, logger logr.Logger, eventRec record.EventRecorder) (*reconcile.Result, error)
LookupResource lookup for resource to be created by separate resource controller
Types ¶
type ExecOptions ¶
ExecOptions specify execution options
type Kubernetes ¶
Kubernetes abstracts interaction with a Kubernetes cluster
func NewKubernetesFromConfig ¶
func NewKubernetesFromConfig(config *rest.Config) (*Kubernetes, error)
NewKubernetesFromConfig creates a new Kubernetes from the Kubernetes master URL to connect to
func NewKubernetesFromController ¶
func NewKubernetesFromController(mgr manager.Manager) *Kubernetes
NewKubernetesFromController creates a new Kubernetes instance from controller runtime Manager
func (Kubernetes) ExecWithOptions ¶
func (k Kubernetes) ExecWithOptions(options ExecOptions) (bytes.Buffer, string, error)
ExecWithOptions executes command on pod command example { "/usr/bin/ls", "folderName" }
func (Kubernetes) GetExternalAddress ¶
func (k Kubernetes) GetExternalAddress(route *corev1.Service) string
GetExternalAddress extract LoadBalancer Hostname (typically for AWS load-balancers) or IP (typically for GCE or OpenStack load-balancers) address
func (Kubernetes) GetKubernetesRESTConfig ¶
func (k Kubernetes) GetKubernetesRESTConfig(masterURL, secretName, namespace string, logger logr.Logger) (*restclient.Config, error)
func (Kubernetes) GetNodeHost ¶
func (k Kubernetes) GetNodeHost(logger logr.Logger) (string, error)
func (Kubernetes) GetOpenShiftRESTConfig ¶
func (k Kubernetes) GetOpenShiftRESTConfig(masterURL, secretName, namespace string, logger logr.Logger) (*restclient.Config, error)
func (Kubernetes) GetSecret ¶
func (k Kubernetes) GetSecret(secretName, namespace string) (*corev1.Secret, error)
GetSecret returns secret associated with given secret name
func (Kubernetes) GetServingCertsMode ¶
func (k Kubernetes) GetServingCertsMode() string
GetServingCertsMode returns a label that identify the kind of serving certs service is available. Returns 'openshift.io' for service-ca on openshift
func (Kubernetes) IsGroupVersionSupported ¶
func (k Kubernetes) IsGroupVersionSupported(groupVersion string, kind string) (bool, error)
func (Kubernetes) ResourcesList ¶
ResourcesList returns a typed list of resource associated with the cluster