Documentation ¶
Overview ¶
Package rosa provides a way to interact with the Red Hat OpenShift Service on AWS (ROSA) API.
Index ¶
- Variables
- func CheckExistingScheduledUpgrade(client *ocm.Client, cluster *cmv1.Cluster) (*cmv1.ControlPlaneUpgradePolicy, error)
- func CreateAdminUserIfNotExist(client *ocm.Client, clusterID, username, password string) error
- func CreateUserIfNotExist(client *ocm.Client, clusterID string, group, username string) (*cmv1.User, error)
- func IsNodePoolReady(nodePool *cmv1.NodePool) bool
- func MachinePoolSupportedVersionsRange(controlPlaneVersion string) (*semver.Version, *semver.Version, error)
- func NewOCMClient(ctx context.Context, rosaScope *scope.ROSAControlPlaneScope) (*ocm.Client, error)
- func RawVersionID(version *cmv1.Version) string
- func ScheduleControlPlaneUpgrade(client *ocm.Client, cluster *cmv1.Cluster, version string, nextRun time.Time) (*cmv1.ControlPlaneUpgradePolicy, error)
- func ScheduleNodePoolUpgrade(client *ocm.Client, clusterID string, nodePool *cmv1.NodePool, version string, ...) (*cmv1.NodePoolUpgradePolicy, error)
- type ExternalAuthClient
- func (c *ExternalAuthClient) Close() error
- func (c *ExternalAuthClient) CreateBreakGlassCredential(clusterID string, breakGlassCredential *cmv1.BreakGlassCredential) (*cmv1.BreakGlassCredential, error)
- func (c *ExternalAuthClient) CreateExternalAuth(clusterID string, externalAuth *cmv1.ExternalAuth) (*cmv1.ExternalAuth, error)
- func (c *ExternalAuthClient) DeleteExternalAuth(clusterID string, externalAuthID string) error
- func (c *ExternalAuthClient) GetExternalAuth(clusterID string, externalAuthID string) (*cmv1.ExternalAuth, bool, error)
- func (c *ExternalAuthClient) ListExternalAuths(clusterID string) ([]*cmv1.ExternalAuth, error)
- func (c *ExternalAuthClient) PollKubeconfig(ctx context.Context, clusterID string, credentialID string) (kubeconfig string, err error)
- func (c *ExternalAuthClient) UpdateExternalAuth(clusterID string, externalAuth *cmv1.ExternalAuth) (*cmv1.ExternalAuth, error)
- type TokenResponse
Constants ¶
This section is empty.
Variables ¶
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 ¶
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
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 ¶
NewOCMClient creates a new OCM client.
func RawVersionID ¶
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 ExternalAuthClient ¶ added in v2.5.0
type ExternalAuthClient struct {
// contains filtered or unexported fields
}
ExternalAuthClient handles externalAuth operations.
func NewExternalAuthClient ¶ added in v2.5.0
func NewExternalAuthClient(ctx context.Context, rosaScope *scope.ROSAControlPlaneScope) (*ExternalAuthClient, error)
NewExternalAuthClient creates and return a new client to handle externalAuth operations.
func (*ExternalAuthClient) Close ¶ added in v2.5.0
func (c *ExternalAuthClient) Close() error
Close closes the underlying ocm connection.
func (*ExternalAuthClient) CreateBreakGlassCredential ¶ added in v2.5.0
func (c *ExternalAuthClient) CreateBreakGlassCredential(clusterID string, breakGlassCredential *cmv1.BreakGlassCredential) (*cmv1.BreakGlassCredential, error)
CreateBreakGlassCredential creates a break glass credential.
func (*ExternalAuthClient) CreateExternalAuth ¶ added in v2.5.0
func (c *ExternalAuthClient) CreateExternalAuth(clusterID string, externalAuth *cmv1.ExternalAuth) (*cmv1.ExternalAuth, error)
CreateExternalAuth creates a new external auth porivder.
func (*ExternalAuthClient) DeleteExternalAuth ¶ added in v2.5.0
func (c *ExternalAuthClient) DeleteExternalAuth(clusterID string, externalAuthID string) error
DeleteExternalAuth deletes the specified external auth porivder.
func (*ExternalAuthClient) GetExternalAuth ¶ added in v2.5.0
func (c *ExternalAuthClient) GetExternalAuth(clusterID string, externalAuthID string) (*cmv1.ExternalAuth, bool, error)
GetExternalAuth retrieves the specified external auth porivder.
func (*ExternalAuthClient) ListExternalAuths ¶ added in v2.5.0
func (c *ExternalAuthClient) ListExternalAuths(clusterID string) ([]*cmv1.ExternalAuth, error)
ListExternalAuths lists all external auth porivder for the cluster.
func (*ExternalAuthClient) PollKubeconfig ¶ added in v2.5.0
func (c *ExternalAuthClient) PollKubeconfig(ctx context.Context, clusterID string, credentialID string) (kubeconfig string, err error)
PollKubeconfig continuously polls for the kubeconfig of the provided break glass credential.
func (*ExternalAuthClient) UpdateExternalAuth ¶ added in v2.5.0
func (c *ExternalAuthClient) UpdateExternalAuth(clusterID string, externalAuth *cmv1.ExternalAuth) (*cmv1.ExternalAuth, error)
UpdateExternalAuth updates an existing external auth porivder.
type TokenResponse ¶
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.