Documentation
¶
Overview ¶
This package is for low-level utility functions used by both controllers and CloudClient interface implementations.
This package is for low-level utility functions used by both controllers and CloudClient interface implementations.
Index ¶
- func ConvertFromRawExtension[T any](extension *runtime.RawExtension) (*T, error)
- func ConvertToRawBytes(t interface{}) ([]byte, error)
- func DeleteCPMS(ctx context.Context, kclient client.Client, ...) error
- func GetClusterBaseDomain(kclient client.Client) (string, error)
- func GetClusterName(kclient client.Client) (string, error)
- func GetClusterVersionObject(kclient client.Client) (*configv1.ClusterVersion, error)
- func GetControlPlaneMachineSet(kclient client.Client) (*machinev1.ControlPlaneMachineSet, error)
- func GetInfrastructureObject(kclient client.Client) (*configv1.Infrastructure, error)
- func GetMasterMachines(kclient client.Client) (*machineapi.MachineList, error)
- func GetPlatformType(kclient client.Client) (*configv1.PlatformType, error)
- func IsVersionHigherThan(input string) bool
- func SAhealthcheck(kclient client.Client) error
- func SetCPMSActive(ctx context.Context, kclient client.Client, ...) error
- func SetClusterVersion(kclient client.Client) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertFromRawExtension ¶
func ConvertFromRawExtension[T any](extension *runtime.RawExtension) (*T, error)
func ConvertToRawBytes ¶
func DeleteCPMS ¶
func DeleteCPMS(ctx context.Context, kclient client.Client, cpms *machinev1.ControlPlaneMachineSet) error
DeleteCPMS will remove the CPMS of the cluster - in OSD this will trigger the CPMS to be recreated in an inactive state.
func GetClusterBaseDomain ¶
GetClusterBaseDomain returns the installed clsuter's base domain name
func GetClusterName ¶
GetClusterName returns the installed cluster's name (max 27 characters)
func GetClusterVersionObject ¶
func GetClusterVersionObject(kclient client.Client) (*configv1.ClusterVersion, error)
GetClusterVersionObject returns the canonical ClusterVersion object To check current version: `output.Status.History[0].Version`
`history contains a list of the most recent versions applied to the cluster. This value may be empty during cluster startup, and then will be updated when a new update is being applied. The newest update is first in the list and it is ordered by recency`
Note: This can be queried inside the controllers, caching doesn't apply if the scope is global rather than namespaced.
func GetControlPlaneMachineSet ¶
func GetControlPlaneMachineSet(kclient client.Client) (*machinev1.ControlPlaneMachineSet, error)
GetControlPlaneMachineSet returns an OSD cluster's CPMS.
func GetInfrastructureObject ¶
func GetInfrastructureObject(kclient client.Client) (*configv1.Infrastructure, error)
GetInfrastructureObject returns the canonical Infrastructure object
func GetMasterMachines ¶
func GetMasterMachines(kclient client.Client) (*machineapi.MachineList, error)
GetMasterMachines returns a MachineList object whose .Items can be iterated over to perform actions on/with information from each master machine object.
func GetPlatformType ¶
func GetPlatformType(kclient client.Client) (*configv1.PlatformType, error)
GetPlatformType returns the cloud platform type for the cluster
func IsVersionHigherThan ¶
IsVersionHigherThan checks whether the given version is higher than the cluster version input is required to be a version such as: 4.10 or 4.10.1 Returns false(no action) if there's an exception.
func SAhealthcheck ¶
SAhealthcheck will perform a basic call to make sure ingresscontrollers is reachable covers: https://github.com/openshift/cloud-ingress-operator/blob/32e50ef2aa8571f9bb60aaf53ed9d1262cc2c083/deploy/20_cloud-ingress-operator_openshift-ingress-operator.Role.yaml#L39-L50
func SetCPMSActive ¶
func SetCPMSActive(ctx context.Context, kclient client.Client, cpms *machinev1.ControlPlaneMachineSet) error
SetCPMSActive will set a CPMS back to active. This is required after calling DeleteCPMS, as it will recreate the CPMS in an inactive state.
func SetClusterVersion ¶
SetClusterVersion sets the cluster version globally(to ENV as CLUSTER_VERSION)
Types ¶
This section is empty.