ocm

package
v1.2.29-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 42 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ANY                 = "any"
	HibernateCapability = "capability.organization.hibernate_cluster"
	//Pendo Events
	Success             = "Success"
	Failure             = "Failure"
	Response            = "Response"
	ClusterID           = "ClusterID"
	OperatorRolesPrefix = "OperatorRolePrefix"
	Version             = "Version"
	Username            = "Username"
	URL                 = "URL"
	IsThrottle          = "IsThrottle"

	OCMRoleLabel  = "sts_ocm_role"
	USERRoleLabel = "sts_user_role"

	HcpProduct = "hcp"
)
View Source
const (
	BYOVPCSingleAZSubnetsCount = 2
	BYOVPCMultiAZSubnetsCount  = 6
)
View Source
const (
	HTPasswdIDPType = "HTPasswd"
	GithubIDPType   = "GitHub"
	GitlabIDPType   = "GitLab"
	GoogleIDPType   = "Google"
	LDAPIDPType     = "LDAP"
	OpenIDIDPType   = "OpenID"
)
View Source
const (
	CloseToEolDays                  = 60
	OneDayHourDuration              = 24
	DefaultChannelGroup             = "stable"
	NightlyChannelGroup             = "nightly"
	LowestSTSSupport                = "4.7.11"
	LowestHttpTokensRequiredSupport = "4.11.0"
	LowestSTSMinor                  = "4.7"
	//TODO: Remove the 0.a once stable 4.12 builds are available
	LowestHostedCpSupport         = "4.12.0-0.a"
	MinVersionForManagedIngressV2 = "4.14-0"
	VersionPrefix                 = "openshift-v"

	MinVersionForAdditionalComputeSecurityGroupIdsDay1 = "4.14-0"
	MinVersionForAdditionalComputeSecurityGroupIdsDay2 = "4.11-0"
)
View Source
const AcceleratedComputing = "accelerated_computing"
View Source
const Production = "production"

Variables

View Source
var NetworkTypes = []string{"OpenShiftSDN", "OVNKubernetes"}
View Source
var ROSAHypershiftQuota = "cluster|byoc|moa|marketplace"
View Source
var URLAliases = map[string]string{
	"production":  "https://api.openshift.com",
	"staging":     "https://api.stage.openshift.com",
	"integration": "https://api.integration.openshift.com",
	"local":       "http://localhost:8000",
	"local-proxy": "http://localhost:9000",
	"crc":         "https://clusters-service.apps-crc.testing",
}

URLAliases allows the value of the `--env` option to map to the various API URLs.

Functions

func AddClusterFlag added in v1.1.5

func AddClusterFlag(cmd *cobra.Command)

func AddOptionalClusterFlag added in v1.2.9

func AddOptionalClusterFlag(cmd *cobra.Command)

func BuildClusterAutoscaler added in v1.2.27

func BuildClusterAutoscaler(config *AutoscalerConfig) *cmv1.ClusterAutoscalerBuilder

func BuildOAuthURL added in v1.2.12

func BuildOAuthURL(cluster *cmv1.Cluster, idpType cmv1.IdentityProviderType) (string, error)

BuildOAuthURL builds the correct OAuthURL depending on the cluster type

func CheckAndParseVersion added in v1.2.4

func CheckAndParseVersion(availableUpgrades []string, version string, cluster *cmv1.Cluster) (string, error)

func CheckSupportedVersion added in v1.1.11

func CheckSupportedVersion(clusterVersion string, operatorVersion string) (bool, error)

func ClusterNameValidator added in v1.1.1

func ClusterNameValidator(name interface{}) error

func CreateVersionID added in v1.2.11

func CreateVersionID(version string, channelGroup string) string

func GenerateBillingAccountsList added in v1.2.29

func GenerateBillingAccountsList(cloudAccounts []*v1.CloudAccount) []string

func GetAvailableUpgradesByCluster added in v1.2.29

func GetAvailableUpgradesByCluster(cluster *cmv1.Cluster) []string

func GetClusterKey added in v1.1.5

func GetClusterKey() (string, error)

func GetEnv added in v1.1.0

func GetEnv() (string, error)

func GetNodePoolAvailableUpgrades added in v1.2.29

func GetNodePoolAvailableUpgrades(nodePool *cmv1.NodePool) []string

func GetNumsOfVCPUsAndClusters added in v1.2.29

func GetNumsOfVCPUsAndClusters(dimensions []*v1.ContractDimension) (int, int)

func GetOAuthURL added in v1.2.12

func GetOAuthURL(cluster *cmv1.Cluster, idp *cmv1.IdentityProvider) (string, error)

GetOAuthURL builds the full OAuthURL depending on the cluster type and the idp name

func GetRawVersionId added in v1.2.16

func GetRawVersionId(versionId string) string

func GetVersionID added in v1.1.0

func GetVersionID(cluster *cmv1.Cluster) string

func GetVersionMinor added in v1.1.10

func GetVersionMinor(ver string) string

func GetVersionMinorList added in v1.1.3

func GetVersionMinorList(ocmClient *Client) (versionList []string, err error)

Get a list of all STS-supported minor versions

func HasAuthURLSupport added in v1.2.11

func HasAuthURLSupport(idp *cmv1.IdentityProvider) bool

func HasHostedCPSupport added in v1.2.8

func HasHostedCPSupport(version *cmv1.Version) (bool, error)

func HasSTSSupport added in v1.1.0

func HasSTSSupport(rawID string, channelGroup string) bool

func HasSTSSupportMinor added in v1.1.0

func HasSTSSupportMinor(minor string) bool

func HasValidContracts added in v1.2.29

func HasValidContracts(cloudAccount *v1.CloudAccount) bool

func IdentityProviderType

func IdentityProviderType(idp *cmv1.IdentityProvider) string

func IntValidator added in v1.2.27

func IntValidator(val interface{}) error

func IsConsoleAvailable added in v1.2.13

func IsConsoleAvailable(cluster *cmv1.Cluster) bool

func IsEmptyCIDR added in v1.1.0

func IsEmptyCIDR(cidr net.IPNet) bool

func IsHyperShiftCluster added in v1.2.17

func IsHyperShiftCluster(cluster *cmv1.Cluster) bool

func IsOidcConfigReusable added in v1.2.18

func IsOidcConfigReusable(cluster *cmv1.Cluster) bool

func IsSts added in v1.2.18

func IsSts(cluster *cmv1.Cluster) bool

func IsValidAWSAccount added in v1.2.18

func IsValidAWSAccount(account string) bool

func IsValidClusterKey

func IsValidClusterKey(clusterKey string) bool

func IsValidClusterName added in v1.1.0

func IsValidClusterName(clusterName string) bool

func IsValidUsername

func IsValidUsername(username string) bool

func IsValidVersion added in v1.2.4

func IsValidVersion(userRequestedVersion string, supportedVersion string, clusterVersion string) (bool, error)

func NonNegativeIntValidator added in v1.2.27

func NonNegativeIntValidator(val interface{}) error

func OAuthURLNeedsPort added in v1.2.14

func OAuthURLNeedsPort(idpType cmv1.IdentityProviderType) bool

OAuthURLNeedsPort defines if an IDP needs a port for the callback URL

func ParseDiskSizeToGigibyte added in v1.2.25

func ParseDiskSizeToGigibyte(size string) (int, error)

func ParseVersion added in v1.2.7

func ParseVersion(version string) (string, error)

func PercentageValidator added in v1.2.27

func PercentageValidator(val interface{}) error

func PositiveDurationStringValidator added in v1.2.27

func PositiveDurationStringValidator(val interface{}) error

func SetClusterKey added in v1.1.5

func SetClusterKey(key string)

func ValidateAdditionalTrustBundle added in v1.1.6

func ValidateAdditionalTrustBundle(val interface{}) error

func ValidateBalancingIgnoredLabels added in v1.2.26

func ValidateBalancingIgnoredLabels(val interface{}) error

func ValidateHTTPProxy added in v1.1.6

func ValidateHTTPProxy(val interface{}) error

func ValidateHostedClusterSubnets added in v1.2.16

func ValidateHostedClusterSubnets(awsClient aws.Client, isPrivate bool, subnetIDs []string) (int, error)

func ValidateHttpTokensValue added in v1.2.23

func ValidateHttpTokensValue(val interface{}) error

func ValidateHttpTokensVersion added in v1.2.23

func ValidateHttpTokensVersion(version string, httpTokens string) error

func ValidateOperatorRolesMatchOidcProvider added in v1.2.16

func ValidateOperatorRolesMatchOidcProvider(reporter *reporter.Object, awsClient aws.Client,
	operatorIAMRoleList []OperatorIAMRole, oidcEndpointUrl string,
	clusterVersion string, expectedOperatorRolePath string, accountRolesHasManagedPolicies bool) error

func ValidateSubnetsCount added in v1.2.5

func ValidateSubnetsCount(multiAZ bool, privateLink bool, subnetsInputCount int) error

Types

type AddOnBilling added in v1.2.7

type AddOnBilling struct {
	BillingModel     string
	BillingAccountID string
}

type AddOnParam added in v1.1.0

type AddOnParam struct {
	Key string
	Val string
}

type AddOnResource added in v0.1.10

type AddOnResource struct {
	AddOn     *cmv1.AddOn
	AZType    string
	Available bool
}

func (*AddOnResource) MarshalJSON added in v1.2.27

func (ar *AddOnResource) MarshalJSON() ([]byte, error)

We customize here the marshalling of AddOnResource to JSON as the embedded AddOn struct does not export its member fields. We instead delegate to cmv1.MarshallAddOn for Marshalling the JSON of the embedded AddOn struct and then build a string representation of the struct to be returned as JSON.

type AutoscalerConfig added in v1.2.26

type AutoscalerConfig struct {
	BalanceSimilarNodeGroups    bool
	SkipNodesWithLocalStorage   bool
	LogVerbosity                int
	MaxPodGracePeriod           int
	PodPriorityThreshold        int
	IgnoreDaemonsetsUtilization bool
	MaxNodeProvisionTime        string
	BalancingIgnoredLabels      []string
	ResourceLimits              ResourceLimits
	ScaleDown                   ScaleDownConfig
}

type Client added in v1.1.0

type Client struct {
	// contains filtered or unexported fields
}

func CreateNewClientOrExit added in v1.1.10

func CreateNewClientOrExit(logger *logrus.Logger, reporter *reporter.Object) *Client

func NewClientWithConnection added in v1.2.23

func NewClientWithConnection(connection *sdk.Connection) *Client

NewClientWithConnection creates a client with a preexisting connection for testing purpose

func (*Client) AckVersionGate added in v1.1.8

func (c *Client) AckVersionGate(
	clusterID string,
	gateID string) error

func (*Client) AcknowledgeGate added in v1.1.8

func (c *Client) AcknowledgeGate(versionGates []*cmv1.VersionGate) (err error)

func (*Client) AddClusterOperatorRole added in v1.2.3

func (c *Client) AddClusterOperatorRole(cluster *cmv1.Cluster, role *cmv1.OperatorIAMRole) error

func (*Client) AddHTPasswdUser added in v1.1.12

func (c *Client) AddHTPasswdUser(username, password, clusterID, idpID string) error

func (*Client) AddHTPasswdUsers added in v1.2.23

func (c *Client) AddHTPasswdUsers(userList *cmv1.HTPasswdUserList, clusterID, idpID string) error

func (*Client) BuildNodeUpgradePolicy added in v1.2.26

func (c *Client) BuildNodeUpgradePolicy(version string, machinePoolID string,
	scheduling UpgradeScheduling) (*cmv1.NodePoolUpgradePolicy, error)

func (*Client) CancelControlPlaneUpgrade added in v1.2.17

func (c *Client) CancelControlPlaneUpgrade(clusterID, upgradeID string) (bool, error)

func (*Client) CancelNodePoolUpgrade added in v1.2.26

func (c *Client) CancelNodePoolUpgrade(clusterID, nodePoolID string, upgradeID string) (bool, error)

func (*Client) CancelUpgrade added in v1.1.0

func (c *Client) CancelUpgrade(clusterID string) (bool, error)

func (*Client) CheckIfAWSAccountExists added in v1.1.7

func (c *Client) CheckIfAWSAccountExists(orgID string, awsAccountID string) (bool, string, string, error)

func (*Client) CheckRoleExists added in v1.1.7

func (c *Client) CheckRoleExists(orgID string, roleName string, awsAccountID string) (bool, string, string, error)

We should allow only one role per aws account per organization If the user request same ocm role we should let them proceed to ensure they can add admin role if not exists or attach policies or link etc if the user request diff ocm role name we error out

func (*Client) CheckUpgradeClusterVersion added in v1.2.9

func (c *Client) CheckUpgradeClusterVersion(
	availableUpgrades []string,
	clusterUpgradeVersion string,
	cluster *cmv1.Cluster,
) (err error)

func (*Client) Close added in v1.1.0

func (c *Client) Close() error

func (*Client) CreateCluster added in v1.1.0

func (c *Client) CreateCluster(config Spec) (*cmv1.Cluster, error)

func (*Client) CreateClusterAutoscaler added in v1.2.27

func (c *Client) CreateClusterAutoscaler(clusterId string, config *AutoscalerConfig) (*cmv1.ClusterAutoscaler, error)

func (*Client) CreateDNSDomain added in v1.2.25

func (c *Client) CreateDNSDomain() (*cmv1.DNSDomain, error)

func (*Client) CreateIdentityProvider added in v1.1.0

func (c *Client) CreateIdentityProvider(clusterID string, idp *cmv1.IdentityProvider) (*cmv1.IdentityProvider, error)

func (*Client) CreateIngress added in v1.1.0

func (c *Client) CreateIngress(clusterID string, ingress *cmv1.Ingress) (*cmv1.Ingress, error)

func (*Client) CreateMachinePool added in v1.1.0

func (c *Client) CreateMachinePool(clusterID string, machinePool *cmv1.MachinePool) (*cmv1.MachinePool, error)

func (*Client) CreateManagedService added in v1.2.0

func (c *Client) CreateManagedService(args CreateManagedServiceArgs) (*msv1.ManagedService, error)

func (*Client) CreateNodePool added in v1.2.11

func (c *Client) CreateNodePool(clusterID string, nodePool *cmv1.NodePool) (*cmv1.NodePool, error)

func (*Client) CreateOidcConfig added in v1.2.16

func (c *Client) CreateOidcConfig(oidcConfig *cmv1.OidcConfig) (*cmv1.OidcConfig, error)

func (*Client) CreateTuningConfig added in v1.2.18

func (c *Client) CreateTuningConfig(clusterID string, tuningConfig *cmv1.TuningConfig) (*cmv1.TuningConfig, error)

func (*Client) CreateUser added in v1.1.0

func (c *Client) CreateUser(clusterID string, group string, user *cmv1.User) (*cmv1.User, error)

func (*Client) DeleteCluster added in v1.1.0

func (c *Client) DeleteCluster(clusterKey string, bestEffort bool,
	creator *aws.Creator) (*cmv1.Cluster, error)

func (*Client) DeleteClusterAutoscaler added in v1.2.26

func (c *Client) DeleteClusterAutoscaler(clusterID string) error

func (*Client) DeleteDNSDomain added in v1.2.24

func (c *Client) DeleteDNSDomain(id string) error

func (*Client) DeleteHTPasswdUser added in v1.1.12

func (c *Client) DeleteHTPasswdUser(username, clusterID string, htpasswdIDP *cmv1.IdentityProvider) error

func (*Client) DeleteIdentityProvider added in v1.1.0

func (c *Client) DeleteIdentityProvider(clusterID string, idpID string) error

func (*Client) DeleteIngress added in v1.1.0

func (c *Client) DeleteIngress(clusterID string, ingressID string) error

func (*Client) DeleteMachinePool added in v1.1.0

func (c *Client) DeleteMachinePool(clusterID string, machinePoolID string) error

func (*Client) DeleteManagedService added in v1.2.0

func (c *Client) DeleteManagedService(args DeleteManagedServiceArgs) (*msv1.ManagedServiceDeleteResponse, error)

func (*Client) DeleteNodePool added in v1.2.11

func (c *Client) DeleteNodePool(clusterID string, nodePoolID string) error

func (*Client) DeleteOidcConfig added in v1.2.16

func (c *Client) DeleteOidcConfig(id string) error

func (*Client) DeleteTuningConfig added in v1.2.18

func (c *Client) DeleteTuningConfig(clusterID string, tuningConfigID string) error

func (*Client) DeleteUser added in v1.1.0

func (c *Client) DeleteUser(clusterID string, group string, username string) error

func (*Client) FindMissingOperatorRolesForUpgrade added in v1.2.3

func (c *Client) FindMissingOperatorRolesForUpgrade(cluster *cmv1.Cluster,
	newMinorVersion string) (map[string]*cmv1.STSOperator, error)

func (*Client) FindTuningConfigByName added in v1.2.18

func (c *Client) FindTuningConfigByName(clusterID string, tuningConfigName string) (*cmv1.TuningConfig, error)

func (*Client) GetAccountLinkedUserRoles added in v1.1.10

func (c *Client) GetAccountLinkedUserRoles(accountID string) ([]string, error)

func (*Client) GetAddOn added in v1.1.0

func (c *Client) GetAddOn(id string) (*cmv1.AddOn, error)

func (*Client) GetAddOnInstallation added in v1.1.0

func (c *Client) GetAddOnInstallation(clusterID, addOnID string) (*cmv1.AddOnInstallation, error)

func (*Client) GetAddOnParameters added in v1.1.0

func (c *Client) GetAddOnParameters(clusterID, addOnID string) (*cmv1.AddOnParameterList, error)

func (*Client) GetAllClusters added in v1.1.5

func (c *Client) GetAllClusters(creator *aws.Creator) (clusters []*cmv1.Cluster, err error)

func (*Client) GetAllCredRequests added in v1.2.22

func (c *Client) GetAllCredRequests() (map[string]*cmv1.STSOperator, error)

The actual values might differ from classic to hcp prefer using GetCredRequests(isHypershift bool) when there is prior knowledge of the topology

func (*Client) GetAvailableAddOns added in v1.1.0

func (c *Client) GetAvailableAddOns() ([]*AddOnResource, error)

Get complete list of available add-ons for the current organization

func (*Client) GetAvailableMachineTypes added in v1.1.0

func (c *Client) GetAvailableMachineTypes() (MachineTypeList, error)

func (*Client) GetAvailableMachineTypesInRegion added in v1.2.7

func (c *Client) GetAvailableMachineTypesInRegion(region string, availabilityZones []string, roleARN string,
	awsClient aws.Client) (MachineTypeList, error)

GetAvailableMachineTypesInRegion get the supported machine type in the region. The function triggers the 'api/clusters_mgmt/v1/aws_inquiries/machine_types' and passes a role ARN for STS clusters or access keys for non-STS clusters.

func (*Client) GetAvailableUpgrades added in v1.1.0

func (c *Client) GetAvailableUpgrades(versionID string) ([]string, error)

func (*Client) GetBillingAccounts added in v1.2.18

func (c *Client) GetBillingAccounts() ([]*v1.CloudAccount, error)

func (*Client) GetCluster added in v1.1.0

func (c *Client) GetCluster(clusterKey string, creator *aws.Creator) (*cmv1.Cluster, error)

GetCluster gets a cluster key that can be either 'id', 'name' or 'external_id'

func (*Client) GetClusterAddOns added in v1.1.0

func (c *Client) GetClusterAddOns(cluster *cmv1.Cluster) ([]*ClusterAddOn, error)

Get all add-ons available for a cluster

func (*Client) GetClusterAutoscaler added in v1.2.27

func (c *Client) GetClusterAutoscaler(clusterID string) (*cmv1.ClusterAutoscaler, error)

func (*Client) GetClusterByID added in v1.1.5

func (c *Client) GetClusterByID(clusterKey string, creator *aws.Creator) (*cmv1.Cluster, error)

func (*Client) GetClusterState added in v1.1.0

func (c *Client) GetClusterState(clusterID string) (cmv1.ClusterState, error)

func (*Client) GetClusterUsingSubscription added in v1.1.6

func (c *Client) GetClusterUsingSubscription(clusterKey string, creator *aws.Creator) (*amv1.Subscription, error)

func (*Client) GetClusters added in v1.1.0

func (c *Client) GetClusters(creator *aws.Creator, count int) (clusters []*cmv1.Cluster, err error)

Pass 0 to get all clusters

func (*Client) GetClustersUsingAccountRole added in v1.2.28

func (c *Client) GetClustersUsingAccountRole(aws *aws.Creator, role *aws.Role, count int) ([]*cmv1.Cluster, error)

func (*Client) GetConnectionTokens added in v1.1.0

func (c *Client) GetConnectionTokens() (string, string, error)

func (*Client) GetConnectionURL added in v1.1.0

func (c *Client) GetConnectionURL() string

func (*Client) GetControlPlaneScheduledUpgrade added in v1.2.16

func (c *Client) GetControlPlaneScheduledUpgrade(clusterID string) (*cmv1.ControlPlaneUpgradePolicy, error)

func (*Client) GetControlPlaneUpgradePolicies added in v1.2.16

func (c *Client) GetControlPlaneUpgradePolicies(clusterID string) (
	controlPlaneUpgradePolicies []*cmv1.ControlPlaneUpgradePolicy,
	err error)

func (*Client) GetCredRequests added in v1.2.3

func (c *Client) GetCredRequests(isHypershift bool) (map[string]*cmv1.STSOperator, error)

func (*Client) GetCurrentAccount added in v1.1.0

func (c *Client) GetCurrentAccount() (*amsv1.Account, error)

func (*Client) GetCurrentOrganization added in v1.1.0

func (c *Client) GetCurrentOrganization() (id string, externalID string, err error)

func (*Client) GetDatabaseRegionList added in v1.2.9

func (c *Client) GetDatabaseRegionList() ([]string, error)

func (*Client) GetDefaultClusterFlavors added in v1.1.0

func (c *Client) GetDefaultClusterFlavors(flavour string) (dMachinecidr *net.IPNet, dPodcidr *net.IPNet,
	dServicecidr *net.IPNet, dhostPrefix, defaultMachineRootVolumeSize int, computeInstanceType string)

func (*Client) GetDefaultVersion added in v1.2.3

func (c *Client) GetDefaultVersion(channelGroup string) (version string, err error)

func (*Client) GetFilteredRegionsByVersion added in v1.2.7

func (c *Client) GetFilteredRegionsByVersion(roleARN string, version string,
	awsClient aws.Client, externalID string) (regions []*cmv1.CloudRegion, err error)

GetFilteredRegionsByVersion fetches a list of regions. The 'version' argument is optional for filtering.

func (*Client) GetHTPasswdUserList added in v1.1.12

func (c *Client) GetHTPasswdUserList(clusterID, htpasswdIDPId string) (*cmv1.HTPasswdUserList, error)

func (*Client) GetHypershiftNodePoolUpgrade added in v1.2.26

func (c *Client) GetHypershiftNodePoolUpgrade(clusterID, clusterKey,
	nodePoolID string) (*cmv1.NodePool, *cmv1.NodePoolUpgradePolicy, error)

func (*Client) GetHypershiftNodePoolUpgrades added in v1.2.26

func (c *Client) GetHypershiftNodePoolUpgrades(clusterID, clusterKey,
	nodePoolID string) (*cmv1.NodePool, []*cmv1.NodePoolUpgradePolicy, error)

func (*Client) GetIdentityProviders added in v1.1.0

func (c *Client) GetIdentityProviders(clusterID string) ([]*cmv1.IdentityProvider, error)

func (*Client) GetIngresses added in v1.1.0

func (c *Client) GetIngresses(clusterID string) ([]*cmv1.Ingress, error)

func (*Client) GetInstallLogs added in v1.1.0

func (c *Client) GetInstallLogs(clusterID string, tail int) (logs *cmv1.Log, err error)

func (*Client) GetLatestVersion added in v1.2.24

func (c *Client) GetLatestVersion(channelGroup string) (version string, err error)

func (*Client) GetLimitedSupportReasons added in v1.2.9

func (c *Client) GetLimitedSupportReasons(clusterID string) (
	limitedSupportReasons []*cmv1.LimitedSupportReason, err error)

func (*Client) GetMachinePool added in v1.2.28

func (c *Client) GetMachinePool(clusterID string, machinePoolID string) (*cmv1.MachinePool, bool, error)

func (*Client) GetMachinePools added in v1.1.0

func (c *Client) GetMachinePools(clusterID string) ([]*cmv1.MachinePool, error)

func (*Client) GetMachineTypes added in v1.1.0

func (c *Client) GetMachineTypes() (machineTypes MachineTypeList, err error)

func (*Client) GetMachineTypesInRegion added in v1.2.7

func (c *Client) GetMachineTypesInRegion(cloudProviderData *cmv1.CloudProviderData) (MachineTypeList, error)

func (*Client) GetManagedService added in v1.2.0

func (c *Client) GetManagedService(args DescribeManagedServiceArgs) (*msv1.ManagedService, error)

func (*Client) GetMissingGateAgreementsClassic added in v1.2.16

func (c *Client) GetMissingGateAgreementsClassic(
	clusterID string,
	upgradePolicy *cmv1.UpgradePolicy) ([]*cmv1.VersionGate, error)

func (*Client) GetMissingGateAgreementsHypershift added in v1.2.16

func (c *Client) GetMissingGateAgreementsHypershift(
	clusterID string,
	upgradePolicy *cmv1.ControlPlaneUpgradePolicy) ([]*cmv1.VersionGate, error)

func (*Client) GetNodePool added in v1.2.11

func (c *Client) GetNodePool(clusterID string, nodePoolID string) (*cmv1.NodePool, bool, error)

func (*Client) GetNodePools added in v1.2.11

func (c *Client) GetNodePools(clusterID string) ([]*cmv1.NodePool, error)

func (*Client) GetOidcConfig added in v1.2.16

func (c *Client) GetOidcConfig(id string) (*cmv1.OidcConfig, error)

func (*Client) GetOrganizationLinkedOCMRoles added in v1.1.10

func (c *Client) GetOrganizationLinkedOCMRoles(orgID string) ([]string, error)

func (*Client) GetPendingClusterForARN added in v1.1.0

func (c *Client) GetPendingClusterForARN(creator *aws.Creator) (cluster *cmv1.Cluster, err error)

Gets only pending non-STS clusters that are installed in the same AWS account

func (*Client) GetPolicies added in v1.2.0

func (c *Client) GetPolicies(policyType string) (map[string]*cmv1.AWSSTSPolicy, error)

func (*Client) GetPolicyVersion added in v1.2.9

func (c *Client) GetPolicyVersion(userRequestedVersion string, channelGroup string) (string, error)

func (*Client) GetRegionList added in v1.1.0

func (c *Client) GetRegionList(multiAZ bool, roleARN string,
	externalID string, version string, awsClient aws.Client, isHostedCP bool,
	shardPinningEnabled bool) (regionList []string,
	regionAZ map[string]bool, err error)

func (*Client) GetRegions added in v1.1.0

func (c *Client) GetRegions(roleARN string, externalID string) (regions []*cmv1.CloudRegion, err error)

func (*Client) GetScheduledUpgrade added in v1.1.0

func (c *Client) GetScheduledUpgrade(clusterID string) (*cmv1.UpgradePolicy, *cmv1.UpgradePolicyState, error)

func (*Client) GetTuningConfigs added in v1.2.18

func (c *Client) GetTuningConfigs(clusterID string) ([]*cmv1.TuningConfig, error)

func (*Client) GetTuningConfigsName added in v1.2.18

func (c *Client) GetTuningConfigsName(clusterID string) ([]string, error)

func (*Client) GetUninstallLogs added in v1.1.0

func (c *Client) GetUninstallLogs(clusterID string, tail int) (logs *cmv1.Log, err error)

func (*Client) GetUpgradePolicies added in v1.1.0

func (c *Client) GetUpgradePolicies(clusterID string) (upgradePolicies []*cmv1.UpgradePolicy, err error)

func (*Client) GetUser added in v1.1.0

func (c *Client) GetUser(clusterID string, group string, username string) (*cmv1.User, error)

func (*Client) GetUsers added in v1.1.0

func (c *Client) GetUsers(clusterID string, group string) ([]*cmv1.User, error)

func (*Client) GetVerifyNetworkSubnet added in v1.2.24

func (c *Client) GetVerifyNetworkSubnet(id string) (*cmv1.SubnetNetworkVerification, error)

func (*Client) GetVersions added in v1.1.0

func (c *Client) GetVersions(channelGroup string, defaultFirst bool) (versions []*cmv1.Version, err error)

func (*Client) GetVersionsList added in v1.2.7

func (c *Client) GetVersionsList(channelGroup string, defaultFirst bool) ([]string, error)

func (*Client) GetVersionsWithProduct added in v1.2.29

func (c *Client) GetVersionsWithProduct(product string, channelGroup string,
	defaultFirst bool) (versions []*cmv1.Version, err error)

func (*Client) HasAClusterUsingOidcEndpointUrl added in v1.2.17

func (c *Client) HasAClusterUsingOidcEndpointUrl(issuerUrl string) (bool, error)

func (*Client) HasAClusterUsingOidcProvider added in v1.2.16

func (c *Client) HasAClusterUsingOidcProvider(
	issuerUrl string, curAccountId string) (bool, error)

func (*Client) HasAClusterUsingOperatorRolesPrefix added in v1.2.17

func (c *Client) HasAClusterUsingOperatorRolesPrefix(prefix string) (bool, error)

func (*Client) HasClusters added in v1.1.0

func (c *Client) HasClusters(creator *aws.Creator) (bool, error)

func (*Client) HasLegacyIngressSupport added in v1.2.27

func (c *Client) HasLegacyIngressSupport(cluster *cmv1.Cluster) (bool, error)

func (*Client) HibernateCluster added in v1.1.0

func (c *Client) HibernateCluster(clusterID string) error

func (*Client) InstallAddOn added in v1.1.0

func (c *Client) InstallAddOn(clusterID, addOnID string, params []AddOnParam, billing AddOnBilling) error

func (*Client) IsCapabilityEnabled added in v1.1.0

func (c *Client) IsCapabilityEnabled(capability string) (enabled bool, err error)

func (*Client) IsSTSClusterExists added in v1.1.5

func (c *Client) IsSTSClusterExists(creator *aws.Creator, count int, roleARN string) (exists bool, err error)

func (*Client) IsVersionCloseToEol added in v1.2.26

func (c *Client) IsVersionCloseToEol(daysAwayToCheck int, version string, channelGroup string) error

func (*Client) LinkAccountRole added in v1.1.6

func (c *Client) LinkAccountRole(accountID string, roleARN string) error

func (*Client) LinkOrgToRole added in v1.1.6

func (c *Client) LinkOrgToRole(orgID string, roleARN string) (bool, error)

func (*Client) ListAllOcpGates added in v1.1.8

func (c *Client) ListAllOcpGates(version string) (versionGates []*cmv1.VersionGate, err error)

func (*Client) ListDNSDomains added in v1.2.24

func (c *Client) ListDNSDomains(search string) ([]*cmv1.DNSDomain, error)

func (*Client) ListManagedServices added in v1.2.0

func (c *Client) ListManagedServices(count int) (*msv1.ManagedServiceList, error)

func (*Client) ListOcpGates added in v1.1.8

func (c *Client) ListOcpGates(version string) (stsVersionGates []*cmv1.VersionGate, err error)

func (*Client) ListOidcConfigs added in v1.2.16

func (c *Client) ListOidcConfigs(awsAccountId string) ([]*cmv1.OidcConfig, error)

func (*Client) ListStsGates added in v1.1.8

func (c *Client) ListStsGates(version string) (stsVersionGates []*cmv1.VersionGate, err error)

func (*Client) LogEvent added in v1.1.0

func (c *Client) LogEvent(key string, body map[string]string)

func (*Client) ManagedServiceVersionInquiry added in v1.2.16

func (c *Client) ManagedServiceVersionInquiry(serviceType string) (string, error)

func (*Client) PollInstallLogs added in v1.1.0

func (c *Client) PollInstallLogs(clusterID string, cb func(*cmv1.LogGetResponse) bool) (logs *cmv1.Log, err error)

func (*Client) PollUninstallLogs added in v1.1.0

func (c *Client) PollUninstallLogs(clusterID string,
	cb func(*cmv1.LogGetResponse) bool) (logs *cmv1.Log, err error)

func (*Client) ResumeCluster added in v1.1.0

func (c *Client) ResumeCluster(clusterID string) error

func (*Client) ScheduleHypershiftControlPlaneUpgrade added in v1.2.16

func (c *Client) ScheduleHypershiftControlPlaneUpgrade(clusterID string,
	upgradePolicy *cmv1.ControlPlaneUpgradePolicy) error

func (*Client) ScheduleNodePoolUpgrade added in v1.2.26

func (c *Client) ScheduleNodePoolUpgrade(clusterID string, nodePoolId string,
	upgradePolicy *cmv1.NodePoolUpgradePolicy) error

func (*Client) ScheduleUpgrade added in v1.1.0

func (c *Client) ScheduleUpgrade(clusterID string, upgradePolicy *cmv1.UpgradePolicy) error

func (*Client) UninstallAddOn added in v1.1.0

func (c *Client) UninstallAddOn(clusterID, addOnID string) error

func (*Client) UnlinkOCMRoleFromOrg added in v1.1.10

func (c *Client) UnlinkOCMRoleFromOrg(orgID string, roleARN string) error

func (*Client) UnlinkUserRoleFromAccount added in v1.1.10

func (c *Client) UnlinkUserRoleFromAccount(accountID string, roleARN string) error

func (*Client) UpdateAddOnInstallation added in v1.1.0

func (c *Client) UpdateAddOnInstallation(clusterID, addOnID string, params []AddOnParam) error

func (*Client) UpdateCluster added in v1.1.0

func (c *Client) UpdateCluster(clusterKey string, creator *aws.Creator, config Spec) error

func (*Client) UpdateClusterAutoscaler added in v1.2.27

func (c *Client) UpdateClusterAutoscaler(clusterId string, config *AutoscalerConfig) (*cmv1.ClusterAutoscaler, error)

func (*Client) UpdateIngress added in v1.1.0

func (c *Client) UpdateIngress(clusterID string, ingress *cmv1.Ingress) (*cmv1.Ingress, error)

func (*Client) UpdateMachinePool added in v1.1.0

func (c *Client) UpdateMachinePool(clusterID string, machinePool *cmv1.MachinePool) (*cmv1.MachinePool, error)

func (*Client) UpdateManagedService added in v1.2.3

func (c *Client) UpdateManagedService(args UpdateManagedServiceArgs) error

func (*Client) UpdateNodePool added in v1.2.11

func (c *Client) UpdateNodePool(clusterID string, nodePool *cmv1.NodePool) (*cmv1.NodePool, error)

func (*Client) UpdateTuningConfig added in v1.2.18

func (c *Client) UpdateTuningConfig(clusterID string, tuningConfig *cmv1.TuningConfig) (*cmv1.TuningConfig, error)

func (*Client) ValidateVersion added in v1.2.16

func (c *Client) ValidateVersion(version string, versionList []string, channelGroup string, isSTS,
	isHostedCP bool) (string, error)

Validate OpenShift versions

func (*Client) VerifyNetworkSubnets added in v1.2.24

func (c *Client) VerifyNetworkSubnets(awsAccountId string, region string,
	subnets []string) ([]*cmv1.SubnetNetworkVerification, error)

type ClientBuilder added in v1.1.0

type ClientBuilder struct {
	// contains filtered or unexported fields
}

ClientBuilder contains the information and logic needed to build a connection to OCM. Don't create instances of this type directly; use the NewClient function instead.

func NewClient added in v1.1.0

func NewClient() *ClientBuilder

NewClient creates a builder that can then be used to configure and build an OCM connection.

func (*ClientBuilder) Build added in v1.1.0

func (b *ClientBuilder) Build() (result *Client, err error)

Build uses the information stored in the builder to create a new OCM connection.

func (*ClientBuilder) Config added in v1.1.0

func (b *ClientBuilder) Config(value *config.Config) *ClientBuilder

Config sets the configuration that the connection will use to authenticate the user

func (*ClientBuilder) Logger added in v1.1.0

func (b *ClientBuilder) Logger(value *logrus.Logger) *ClientBuilder

Logger sets the logger that the connection will use to send messages to the log. This is mandatory.

type ClusterAddOn

type ClusterAddOn struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	State string `json:"state"`
}

type CreateManagedServiceArgs added in v1.2.0

type CreateManagedServiceArgs struct {
	ServiceType string
	ClusterName string

	Parameters map[string]string
	Properties map[string]string

	AwsAccountID           string
	AwsRoleARN             string
	AwsSupportRoleARN      string
	AwsControlPlaneRoleARN string
	AwsWorkerRoleARN       string
	AwsRegion              string

	AwsOperatorIamRoleList []OperatorIAMRole

	// Custom network configuration
	MultiAZ           bool
	Privatelink       bool
	AvailabilityZones []string
	SubnetIDs         []string
	MachineCIDR       net.IPNet
	PodCIDR           net.IPNet
	ServiceCIDR       net.IPNet
	HostPrefix        int

	// create a fake cluster with no aws resources
	FakeCluster bool
}

type DefaultIngressSpec added in v1.2.25

type DefaultIngressSpec struct {
	RouteSelectors           map[string]string
	ExcludedNamespaces       []string
	WildcardPolicy           string
	NamespaceOwnershipPolicy string
}

func NewDefaultIngressSpec added in v1.2.25

func NewDefaultIngressSpec() DefaultIngressSpec

type DeleteManagedServiceArgs added in v1.2.0

type DeleteManagedServiceArgs struct {
	ID string
}

type DescribeManagedServiceArgs added in v1.2.0

type DescribeManagedServiceArgs struct {
	ID string
}

type GPULimit added in v1.2.27

type GPULimit struct {
	Type  string
	Range ResourceRange
}

type Hypershift added in v1.2.7

type Hypershift struct {
	Enabled bool
}

type HypershiftUpgrader added in v1.2.26

type HypershiftUpgrader interface {
	ID() string
	ClusterID() string
	Version() string
	State() *cmv1.UpgradePolicyState
	NextRun() time.Time
	CreationTimestamp() time.Time
	EnableMinorVersionUpgrades() bool
	Schedule() string
	ScheduleType() cmv1.ScheduleType
}

HypershiftUpgrader represents a Hypershift Control Plane or Node Pool Update

type MachineType added in v1.1.0

type MachineType struct {
	MachineType *cmv1.MachineType
	Available   bool
	// contains filtered or unexported fields
}

func (MachineType) HasQuota added in v1.1.10

func (mt MachineType) HasQuota(multiAZ bool) bool

type MachineTypeList added in v1.1.10

type MachineTypeList struct {
	Items             []*MachineType
	Region            string
	AvailabilityZones []string
}

A list of MachineTypes with additional information

func (*MachineTypeList) Filter added in v1.1.10

func (mtl *MachineTypeList) Filter(fn func(*MachineType) bool) MachineTypeList

Filter returns a new MachineTypeList with only elements for which fn returned true

func (*MachineTypeList) Find added in v1.1.10

func (mtl *MachineTypeList) Find(id string) *MachineType

Find returns the first MachineType matching the ID

func (*MachineTypeList) GetAvailableIDs added in v1.1.10

func (mtl *MachineTypeList) GetAvailableIDs(multiAZ bool) (machineTypeList []string)

func (*MachineTypeList) IDs added in v1.1.10

func (mtl *MachineTypeList) IDs() []string

IDs extracts list of IDs from a MachineTypeList

func (*MachineTypeList) UpdateAvailableQuota added in v1.1.10

func (mtl *MachineTypeList) UpdateAvailableQuota(quotaCosts *amsv1.QuotaCostList)

func (*MachineTypeList) ValidateMachineType added in v1.1.10

func (mtl *MachineTypeList) ValidateMachineType(machineType string, multiAZ bool) error

Validate AWS machine type is available with enough quota in the list

type OperatorIAMRole added in v1.1.0

type OperatorIAMRole struct {
	Name      string
	Namespace string
	RoleARN   string
	Path      string
}

func NewOperatorIamRoleFromCmv1 added in v1.2.22

func NewOperatorIamRoleFromCmv1(operatorIAMRole *cmv1.OperatorIAMRole) (*OperatorIAMRole, error)

type ResourceLimits added in v1.2.26

type ResourceLimits struct {
	MaxNodesTotal int
	Cores         ResourceRange
	Memory        ResourceRange
	GPULimits     []GPULimit
}

type ResourceRange added in v1.2.26

type ResourceRange struct {
	Min int
	Max int
}

type ScaleDownConfig added in v1.2.26

type ScaleDownConfig struct {
	Enabled              bool
	UnneededTime         string
	UtilizationThreshold float64
	DelayAfterAdd        string
	DelayAfterDelete     string
	DelayAfterFailure    string
}

type Spec added in v1.1.0

type Spec struct {
	// Basic configs
	Name                      string
	Region                    string
	MultiAZ                   bool
	Version                   string
	ChannelGroup              string
	Expiration                time.Time
	Flavour                   string
	DisableWorkloadMonitoring *bool

	//Encryption
	FIPS                 bool
	EtcdEncryption       bool
	KMSKeyArn            string
	EtcdEncryptionKMSArn string
	// Scaling config
	ComputeMachineType string
	ComputeNodes       int
	Autoscaling        bool
	AutoscalerConfig   *AutoscalerConfig
	MinReplicas        int
	MaxReplicas        int
	ComputeLabels      map[string]string

	// SubnetIDs
	SubnetIds []string

	// AvailabilityZones
	AvailabilityZones []string

	// Network config
	NetworkType string
	MachineCIDR net.IPNet
	ServiceCIDR net.IPNet
	PodCIDR     net.IPNet
	HostPrefix  int
	Private     *bool
	PrivateLink *bool

	// Properties
	CustomProperties map[string]string

	// User-defined tags for AWS resources
	Tags map[string]string

	// Simulate creating a cluster but don't actually create it
	DryRun *bool

	// Disable SCP checks in the installer by setting credentials mode as mint
	DisableSCPChecks *bool

	// STS
	IsSTS               bool
	RoleARN             string
	ExternalID          string
	SupportRoleARN      string
	OperatorIAMRoles    []OperatorIAMRole
	ControlPlaneRoleARN string
	WorkerRoleARN       string
	OidcConfigId        string
	Mode                string

	NodeDrainGracePeriodInMinutes float64

	EnableProxy               bool
	HTTPProxy                 *string
	HTTPSProxy                *string
	NoProxy                   *string
	AdditionalTrustBundleFile *string
	AdditionalTrustBundle     *string

	// HyperShift options:
	Hypershift     Hypershift
	BillingAccount string

	// Audit Log Forwarding
	AuditLogRoleARN *string

	Ec2MetadataHttpTokens cmv1.Ec2MetadataHttpTokens

	// Cluster Admin
	ClusterAdminUser     string
	ClusterAdminPassword string

	// Default Ingress Attributes
	DefaultIngress DefaultIngressSpec

	// Machine pool's storage
	MachinePoolRootDisk *Volume

	// Shared VPC
	PrivateHostedZoneID string
	SharedVPCRoleArn    string
	BaseDomain          string

	// Worker Machine Pool attributes
	AdditionalComputeSecurityGroupIds []string
}

Spec is the configuration for a cluster spec.

type UpdateManagedServiceArgs added in v1.2.3

type UpdateManagedServiceArgs struct {
	ID         string
	Parameters map[string]string
}

type UpgradeScheduling added in v1.2.26

type UpgradeScheduling struct {
	ScheduleDate             string
	ScheduleTime             string
	Schedule                 string
	AllowMinorVersionUpdates bool
	AutomaticUpgrades        bool
	NextRun                  time.Time
}

type Volume added in v1.2.25

type Volume struct {
	Size int
}

Volume represents a volume property for a disk

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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