Documentation
¶
Index ¶
- Constants
- func CheckResourceExists(clientset kubernetes.Clientset, group, version, name string) bool
- func ControlPlaneNameFromNamespace(nsName string) (string, error)
- func DefaultString(value, defaultValue string) string
- func DropDatabase(ctx context.Context, cpName string, crClient client.Client) error
- func GVKToGVR(clientset *kubernetes.Clientset, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
- func GVRToGVK(clientset *kubernetes.Clientset, gvr schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func GenerateBootstrapSecretName(cpName string) string
- func GenerateDevLocalDNSName(name, domain string) string
- func GenerateHostedDNSName(namespace, name string) []string
- func GenerateNamespaceFromControlPlaneName(name string) string
- func GenerateObjectInfoString(obj unstructured.Unstructured) string
- func GenerateOperatorDeploymentName() string
- func GeneratePGConnectionString(dbPassword, dbName string) string
- func GeneratePSReplicaSetName(releaseName string) string
- func GeneratePSecretName(releaseName string) string
- func GetAPIServerDeploymentNameByControlPlaneType(controlPlaneType string) string
- func GetGroupVersionKindFromObject(obj *unstructured.Unstructured) schema.GroupVersionKind
- func GetKubeconfSecretKeyNameByControlPlaneType(controlPlaneType string) string
- func GetKubeconfSecretNameByControlPlaneType(controlPlaneType string) string
- func GetKubernetesClusterVersionInfo(kubeconfig string) (string, error)
- func GetPGDBPassword(crClient client.Client) (string, error)
- func IsAPIServerDeploymentExists(c client.Client, hcp tenancyv1alpha1.ControlPlane) (bool, error)
- func IsAPIServerDeploymentReady(log logr.Logger, c client.Client, hcp tenancyv1alpha1.ControlPlane) (bool, error)
- func IsClusterScoped(gvk schema.GroupVersionKind, apiResourceLists []*metav1.APIResourceList) (bool, error)
- func IsInCluster() bool
- func IsOpenShift(clientset kubernetes.Clientset) bool
- func IsTransientError(err error) bool
- func ParseVersionNumber(versionString string) string
- func PrintStatus(message string, done chan bool, wg *sync.WaitGroup, chattyStatus bool)
- func RenderYAML(yamlTemplate []byte, data interface{}) ([]byte, error)
- func ReplaceNotAllowedCharsInDBName(name string) string
- func SetClusterScopedOwnerRefs(c crc.Client, scheme *runtime.Scheme, hcp *tenancyv1alpha1.ControlPlane) error
- func ToUnstructured(raw []byte) (*unstructured.Unstructured, error)
- func WaitForDeploymentReady(clientset kubernetes.Clientset, name, namespace string) error
- func WaitForNamespaceDeletion(clientset kubernetes.Clientset, name string) error
- func WaitForStatefulSetReady(clientset kubernetes.Clientset, name, namespace string) error
- func ZeroFields(obj runtime.Object) runtime.Object
Constants ¶
View Source
const ( ManagedByKey = "app.kubernetes.io/managed-by" HelmReleaseNamespaceAnnotationKey = "meta.helm.sh/release-namespace" )
View Source
const ( APIServerDeploymentName = "kube-apiserver" // TODO: move to its reconciler component (k8s) OCMServerDeploymentName = "multicluster-controlplane" // TODO: move to its reconciler component (ocm) VClusterServerDeploymentName = "vcluster" // TODO: move to its reconciler component (vcluster) CMDeploymentName = "kube-controller-manager" ProjectName = "kubeflex" DBReleaseName = "postgres" SystemNamespace = "kubeflex-system" SystemConfigMap = "kubeflex-config" AdminConfSecret = "admin-kubeconfig" // TODO to replace as it is defined in reconciler component (k3s) OCMKubeConfigSecret = "multicluster-controlplane-kubeconfig" // TODO to replace as it is defined in reconciler component (k3s) VClusterKubeConfigSecret = "vc-vcluster" // TODO to replace as it is defined in reconciler component (k3s) VClusterNodePortServiceName = "vcluster-nodeport" // TODO to replace as it is defined in reconciler component (k3s) VClusterServiceName = "vcluster" // TODO to replace as it is defined in reconciler component (k3s) K3sKubeConfigSecret = "k3s-config" // TODO to replace as it is defined in reconciler component (k3s) K3sServerDeploymentName = "k3s-server" // TODO to replace as it is defined in reconciler component (k3s) KubeconfigSecretKeyDefault = "kubeconfig" KubeconfigSecretKeyInCluster = "kubeconfig-incluster" KubeconfigSecretKeyVCluster = "config" // NOTE reuse by k3s KubeconfigSecretKeyVClusterInCluster = "config-incluster" // NOTE reuse by k3s NamespaceSuffix = "-system" // TODO: change to SystemNamespaceSuffix )
View Source
const (
UnableToRetrieveCompleteAPIListError = "unable to retrieve the complete list of server APIs"
)
Variables ¶
This section is empty.
Functions ¶
func CheckResourceExists ¶ added in v0.2.5
func CheckResourceExists(clientset kubernetes.Clientset, group, version, name string) bool
func ControlPlaneNameFromNamespace ¶ added in v0.8.2
func DefaultString ¶ added in v0.8.0
func DropDatabase ¶ added in v0.2.5
func GVKToGVR ¶ added in v0.4.0
func GVKToGVR(clientset *kubernetes.Clientset, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)
func GVRToGVK ¶ added in v0.4.0
func GVRToGVK(clientset *kubernetes.Clientset, gvr schema.GroupVersionResource) (schema.GroupVersionKind, error)
func GenerateBootstrapSecretName ¶ added in v0.8.0
func GenerateDevLocalDNSName ¶
GenerateDevLocalDNSName: generates the local dns name for test/dev from the controlplane name
func GenerateHostedDNSName ¶ added in v0.2.1
func GenerateObjectInfoString ¶ added in v0.3.0
func GenerateObjectInfoString(obj unstructured.Unstructured) string
Used for generating a single string unique representation of the object for logging info. Namespace is not mentioned because the caller does not provide it.
func GenerateOperatorDeploymentName ¶
func GenerateOperatorDeploymentName() string
func GeneratePGConnectionString ¶ added in v0.2.5
func GeneratePSecretName ¶
func GetAPIServerDeploymentNameByControlPlaneType ¶ added in v0.2.0
func GetGroupVersionKindFromObject ¶ added in v0.3.0
func GetGroupVersionKindFromObject(obj *unstructured.Unstructured) schema.GroupVersionKind
func GetKubeconfSecretKeyNameByControlPlaneType ¶ added in v0.2.0
func GetKubeconfSecretNameByControlPlaneType ¶ added in v0.2.0
func IsAPIServerDeploymentExists ¶ added in v0.9.0
func IsAPIServerDeploymentExists(c client.Client, hcp tenancyv1alpha1.ControlPlane) (bool, error)
func IsAPIServerDeploymentReady ¶ added in v0.1.1
func IsAPIServerDeploymentReady(log logr.Logger, c client.Client, hcp tenancyv1alpha1.ControlPlane) (bool, error)
func IsClusterScoped ¶ added in v0.3.0
func IsClusterScoped(gvk schema.GroupVersionKind, apiResourceLists []*metav1.APIResourceList) (bool, error)
func IsInCluster ¶ added in v0.2.5
func IsInCluster() bool
func IsOpenShift ¶ added in v0.2.5
func IsOpenShift(clientset kubernetes.Clientset) bool
func IsTransientError ¶ added in v0.8.8
func ParseVersionNumber ¶
func PrintStatus ¶
PrintWithIcon prints a message with defined colors and a spinning icon in front that can be changed to checkmark when completed.
func RenderYAML ¶ added in v0.3.0
func ReplaceNotAllowedCharsInDBName ¶ added in v0.2.5
TODO: change func signature to be more explicit
func SetClusterScopedOwnerRefs ¶ added in v0.3.1
func SetClusterScopedOwnerRefs(c crc.Client, scheme *runtime.Scheme, hcp *tenancyv1alpha1.ControlPlane) error
func ToUnstructured ¶ added in v0.3.0
func ToUnstructured(raw []byte) (*unstructured.Unstructured, error)
func WaitForDeploymentReady ¶
func WaitForDeploymentReady(clientset kubernetes.Clientset, name, namespace string) error
func WaitForNamespaceDeletion ¶
func WaitForNamespaceDeletion(clientset kubernetes.Clientset, name string) error
func WaitForStatefulSetReady ¶
func WaitForStatefulSetReady(clientset kubernetes.Clientset, name, namespace string) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.