Documentation ¶
Index ¶
- Constants
- Variables
- func AppendIfNotPresent(origSlice []string, strItem string) (resultSlice []string)
- func AtLeastv125(rke2version string) (bool, error)
- func CompareVersions(v1 string, v2 string) bool
- func GetClusterByName(ctx context.Context, c client.Client, namespace, name string) (*clusterv1.Cluster, error)
- func GetControlPlaneByName(ctx context.Context, c client.Client, namespace, name string) (*controlplanev1.RKE2ControlPlane, error)
- func GetMapKeysAsString(m map[string][]byte) (keys string)
- func GetOwnerControlPlane(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*controlplanev1.RKE2ControlPlane, error)
- func IsRKE2Version(rke2Version string) bool
- func ProfileCompliant(profile bootstrapv1.CISProfile, version string) bool
- func Random(size int) (string, error)
- func Rke2ToKubeVersion(rk2Version string) (kubeVersion string, err error)
- func TokenName(clusterName string) string
Constants ¶
const (
// RKE2_CIS_VERSION_CHANGE is the version where the CIS benchmark changed in RKE2 (because of PSPs).
RKE2_CIS_VERSION_CHANGE = "v1.25.0"
)
Variables ¶
var ErrControlPlaneNotFound = fmt.Errorf("control plane not found")
ErrControlPlaneNotFound is returned when a control plane is not found.
Functions ¶
func AppendIfNotPresent ¶
AppendIfNotPresent appends a string to a slice only if the value does not already exist.
func AtLeastv125 ¶
AtLeastv125 returns true if the RKE2 version is at least v1.25.0.
func CompareVersions ¶
CompareVersions compares two string version supposing those would begin with 'v' or not.
func GetClusterByName ¶
func GetClusterByName(ctx context.Context, c client.Client, namespace, name string) (*clusterv1.Cluster, error)
GetClusterByName finds and return a Cluster object using the specified params.
func GetControlPlaneByName ¶
func GetControlPlaneByName(ctx context.Context, c client.Client, namespace, name string) (*controlplanev1.RKE2ControlPlane, error)
GetControlPlaneByName finds and return a ControlPlane object using the specified params.
func GetMapKeysAsString ¶
GetMapKeysAsString returns a comma separated string of keys from a map.
func GetOwnerControlPlane ¶
func GetOwnerControlPlane(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*controlplanev1.RKE2ControlPlane, error)
GetOwnerControlPlane returns the RKE2ControlPlane object that owns the object passed as parameter.
func IsRKE2Version ¶ added in v0.5.0
IsRKE2Version checks if a string is an RKE2 version.
func ProfileCompliant ¶
func ProfileCompliant(profile bootstrapv1.CISProfile, version string) bool
ProfileCompliant returns true if the CIS profile is compliant.
func Rke2ToKubeVersion ¶
Rke2ToKubeVersion converts an RKE2 version to a Kubernetes version.
Types ¶
This section is empty.