rosa

package
v2.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package rosa provides a way to interact with the Red Hat OpenShift Service on AWS (ROSA) API.

Index

Constants

This section is empty.

Variables

View Source
var MinSupportedVersion = semver.MustParse("4.14.0")

MinSupportedVersion is the minimum supported version for ROSA.

Functions

func CheckExistingScheduledUpgrade

func CheckExistingScheduledUpgrade(client *ocm.Client, cluster *cmv1.Cluster) (*cmv1.ControlPlaneUpgradePolicy, error)

CheckExistingScheduledUpgrade checks and returns the current upgrade schedule if any.

func CreateAdminUserIfNotExist

func CreateAdminUserIfNotExist(client *ocm.Client, clusterID, username, password string) error

CreateAdminUserIfNotExist creates a new admin user withe username/password in the cluster if username doesn't already exist. the user is granted admin privileges by being added to a special IDP called `cluster-admin` which will be created if it doesn't already exist.

func CreateUserIfNotExist

func CreateUserIfNotExist(client *ocm.Client, clusterID string, group, username string) (*cmv1.User, error)

CreateUserIfNotExist creates a new user with `username` and adds it to the group if it doesn't already exist.

func IsNodePoolReady added in v2.4.1

func IsNodePoolReady(nodePool *cmv1.NodePool) bool

IsNodePoolReady checkes whether the nodepool is provisoned and all replicas are available. If autosacling is enabled, NodePool must have replicas >= autosacling.MinReplica to be considered ready.

func MachinePoolSupportedVersionsRange

func MachinePoolSupportedVersionsRange(controlPlaneVersion string) (*semver.Version, *semver.Version, error)

MachinePoolSupportedVersionsRange returns the supported range of versions for a machine pool based on the control plane version.

func NewOCMClient

func NewOCMClient(ctx context.Context, rosaScope *scope.ROSAControlPlaneScope) (*ocm.Client, error)

NewOCMClient creates a new OCM client.

func RawVersionID

func RawVersionID(version *cmv1.Version) string

RawVersionID returns the rawID from the provided OCM version object.

func ScheduleControlPlaneUpgrade

func ScheduleControlPlaneUpgrade(client *ocm.Client, cluster *cmv1.Cluster, version string, nextRun time.Time) (*cmv1.ControlPlaneUpgradePolicy, error)

ScheduleControlPlaneUpgrade schedules a new control plane upgrade to the specified version at the specified time.

func ScheduleNodePoolUpgrade added in v2.4.1

func ScheduleNodePoolUpgrade(client *ocm.Client, clusterID string, nodePool *cmv1.NodePool, version string, nextRun time.Time) (*cmv1.NodePoolUpgradePolicy, error)

ScheduleNodePoolUpgrade schedules a new nodePool upgrade to the specified version at the specified time.

Types

type TokenResponse

type TokenResponse struct {
	AccessToken string
	ExpiresIn   time.Duration
}

TokenResponse contains the access token and the duration until it expires.

func RequestToken

func RequestToken(ctx context.Context, apiURL, username, password string, config *restclient.Config) (*TokenResponse, error)

RequestToken requests an OAuth access token for the specified API server using username/password credentials. returns a TokenResponse which contains the AccessToken and the ExpiresIn duration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL