Documentation ¶
Overview ¶
Package osd allows for the creation and management of OSD clusters.
Index ¶
- Constants
- Variables
- func HasQuotaFor(q *accounts.ResourceQuota, cfg *config.Config, ...) bool
- type OSD
- func (u *OSD) CheckQuota(cfg *config.Config) (bool, error)
- func (u *OSD) ClusterKubeconfig(clusterID string) (kubeconfig []byte, err error)
- func (u *OSD) ClusterState(clusterID string) (v1.ClusterState, error)
- func (u *OSD) CurrentAccount() (*accounts.Account, error)
- func (u *OSD) CurrentAccountQuota() (*accounts.ResourceQuotaList, error)
- func (u *OSD) DefaultVersion() (string, error)
- func (u *OSD) DeleteCluster(clusterID string) error
- func (u *OSD) Flavour(cfg *config.Config) string
- func (u *OSD) FullLogs(clusterID string, ids ...string) (map[string][]byte, error)
- func (u *OSD) GetCluster(clusterID string) (*v1.Cluster, error)
- func (u *OSD) LatestPrerelease(major, minor int64, str string) (string, error)
- func (u *OSD) LaunchCluster(cfg *config.Config) (string, error)
- func (u *OSD) Logs(clusterID string, length int, ids ...string) (logs map[string][]byte, err error)
- func (u *OSD) PreviousVersion(verStr string) (string, error)
- func (u *OSD) WaitForClusterReady(clusterID string, timeout time.Duration) error
Constants ¶
const ( // APIVersion is the version of the OSD API to use. APIVersion = "v1" // TokenURL specifies the endpoint used to create access tokens. TokenURL = "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token" // ClientID is used to identify the client to OSD. ClientID = "cloud-services" )
const (
// DefaultFlavour is used when no specialized configuration exists.
DefaultFlavour = "4"
)
const (
// ResourceAWSCluster is the quota resource type for a cluster on AWS.
ResourceAWSCluster = "cluster.aws"
)
const (
// VersionPrefix is the string that every OSD version begins with.
VersionPrefix = "openshift-"
)
Variables ¶
var Environments = environments{
"": "int",
"int": "https://api-integration.6943.hive-integration.openshiftapps.com",
"stage": "https://api.stage.openshift.com",
"prod": "https://api.openshift.com",
}
Environments are known instance of OSD.
Functions ¶
func HasQuotaFor ¶
func HasQuotaFor(q *accounts.ResourceQuota, cfg *config.Config, resourceType, machineType string) bool
HasQuotaFor the desired configuration. If machineT is empty a default will try to be selected.
Types ¶
type OSD ¶
type OSD struct {
// contains filtered or unexported fields
}
OSD acts as a client to manage an instance.
func (*OSD) CheckQuota ¶
CheckQuota determines if enough quota is available to launch with cfg.
func (*OSD) ClusterKubeconfig ¶
ClusterKubeconfig retrieves the kubeconfig of clusterID.
func (*OSD) ClusterState ¶
func (u *OSD) ClusterState(clusterID string) (v1.ClusterState, error)
ClusterState retrieves the state of clusterID.
func (*OSD) CurrentAccount ¶
CurrentAccount returns the current account being used.
func (*OSD) CurrentAccountQuota ¶
func (u *OSD) CurrentAccountQuota() (*accounts.ResourceQuotaList, error)
CurrentAccountQuota returns quota available for the current account's organization in the environment.
func (*OSD) DefaultVersion ¶
DefaultVersion returns the default version currently offered by OSD.
func (*OSD) DeleteCluster ¶
DeleteCluster requests the deletion of clusterID.
func (*OSD) GetCluster ¶
GetCluster returns the information about clusterID.
func (*OSD) LatestPrerelease ¶
LatestPrerelease gets latest prerelease containing str for major and minor versions. Negative versions match all.
func (*OSD) LaunchCluster ¶
LaunchCluster setups an new cluster using the OSD API and returns it's ID.
func (*OSD) Logs ¶
Logs provides all logs available for clusterID, ids can be optionally provided for only specific logs.
func (*OSD) PreviousVersion ¶
PreviousVersion returns the first available previous version for the given version.