Documentation
¶
Index ¶
- Constants
- func CreateCluster(cmv1Client *cmv1.Client, config Spec, dryRun bool) (*cmv1.Cluster, error)
- func DropOpenshiftVPrefix(v string) string
- func EnsureOpenshiftVPrefix(v string) string
- func GetAvailableUpgrades(version *cmv1.Version) []string
- func GetCluster(connection *sdk.Connection, key string) (cluster *cmv1.Cluster, err error)
- func GetClusterLimitedSupportReasons(connection *sdk.Connection, clusterID string) ([]*lmtSprReasonItem, error)
- func GetClusterOauthURL(cluster *cmv1.Cluster) string
- func GetEnabledVersions(client *cmv1.Client, channel string, channelGroup string, ...) (versions []string, defaultVersion string, err error)
- func GetGroups(client *cmv1.ClustersClient, clusterID string) ([]*cmv1.Group, error)
- func GetIdentityProviders(client *cmv1.ClustersClient, clusterID string) ([]*cmv1.IdentityProvider, error)
- func GetIngresses(client *cmv1.ClustersClient, clusterID string) ([]*cmv1.Ingress, error)
- func GetMachinePools(client *cmv1.ClustersClient, clusterID string) ([]*cmv1.MachinePool, error)
- func GetUpgradePolicies(client *cmv1.ClustersClient, clusterID string) ([]*cmv1.UpgradePolicy, error)
- func GetVersionID(cluster *cmv1.Cluster) string
- func IsValidClusterKey(clusterKey string) bool
- func PrintClusterDescription(connection *sdk.Connection, cluster *cmv1.Cluster) error
- func PrintClusterWarnings(connection *sdk.Connection, cluster *cmv1.Cluster) error
- func UpdateCluster(client *cmv1.ClustersClient, clusterID string, config Spec) error
- func UpdateDeleteProtection(client *cmv1.ClustersClient, clusterID string, enable bool) error
- func ValidateClusterExpiration(expirationTime string, expirationDuration time.Duration) (expiration time.Time, err error)
- type AWSCredentials
- type AddOnItem
- type Autoscaling
- type CCS
- type ClusterWideProxy
- type DNS
- type DefaultIngressSpec
- type ExistingVPC
- type GCPCredentials
- type GcpAuthentication
- type GcpEncryption
- type GcpPrivateSvcConnect
- type GcpSecurity
- type Spec
Constants ¶
const ( ProviderAWS = "aws" ProviderGCP = "gcp" NetworkTypeSDN = "OpenShiftSDN" NetworkTypeOVN = "OVNKubernetes" AuthenticationWif = "Workload Identity Federation (WIF)" AuthenticationKey = "Service account" AuthenticationRedHat = "Red Hat Cloud Account" )
const ( AuthKindWifConfig string = "WifConfig" AuthKindServiceAccount string = "ServiceAccount" AuthKindRedHatCloudAccount string = "RedHatCloudAccount" )
Variables ¶
This section is empty.
Functions ¶
func CreateCluster ¶ added in v0.1.42
func DropOpenshiftVPrefix ¶ added in v0.1.46
func EnsureOpenshiftVPrefix ¶ added in v0.1.46
func GetAvailableUpgrades ¶ added in v0.1.45
func GetCluster ¶ added in v0.1.39
func GetClusterLimitedSupportReasons ¶ added in v0.1.65
func GetClusterLimitedSupportReasons(connection *sdk.Connection, clusterID string) ([]*lmtSprReasonItem, error)
func GetClusterOauthURL ¶ added in v0.1.39
func GetEnabledVersions ¶ added in v0.1.46
func GetEnabledVersions(client *cmv1.Client, channel string, channelGroup string, gcpMarketplaceEnabled string, additionalFilters string, ) ( versions []string, defaultVersion string, err error)
GetEnabledVersions returns the versions with enabled=true, and the one that has default=true. The returned strings are the IDs without "openshift-v" prefix (e.g. "4.6.0-rc.4-candidate") sorted in approximate SemVer order (handling of text parts is somewhat arbitrary).
Parameters:
- channel: Y-stream update channel (e.g., "stable-4.19"). Takes precedence over channelGroup.
- channelGroup: Channel group name (e.g., "stable"). Used if channel is not provided (deprecated).
- gcpMarketplaceEnabled: Filter for GCP marketplace support ("true"/"false").
- additionalFilters: Additional filter expressions to apply.
Returns:
- versions: List of enabled version IDs without "openshift-v" prefix, sorted by semver.
- defaultVersion: The version marked as default.
- err: Error if the API request fails.
func GetIdentityProviders ¶ added in v0.1.39
func GetIdentityProviders(client *cmv1.ClustersClient, clusterID string) ([]*cmv1.IdentityProvider, error)
func GetIngresses ¶ added in v0.1.39
func GetMachinePools ¶ added in v0.1.44
func GetMachinePools(client *cmv1.ClustersClient, clusterID string) ([]*cmv1.MachinePool, error)
func GetUpgradePolicies ¶ added in v0.1.45
func GetUpgradePolicies(client *cmv1.ClustersClient, clusterID string) ([]*cmv1.UpgradePolicy, error)
func GetVersionID ¶ added in v0.1.45
func IsValidClusterKey ¶ added in v0.1.39
func PrintClusterDescription ¶ added in v0.1.47
func PrintClusterDescription(connection *sdk.Connection, cluster *cmv1.Cluster) error
PrintClusterDescription outputs detailed information about a cluster including its ID, name, state, API endpoints, node configuration, and associated subscription details. It retrieves subscription, account, and shard information via the provided OCM SDK connection and formats them for console display.
func PrintClusterWarnings ¶ added in v0.1.73
func PrintClusterWarnings(connection *sdk.Connection, cluster *cmv1.Cluster) error
PrintClusterWarnings retrieves and displays warning-level service log entries for a cluster. It queries the Service Logs API across all pages and outputs any warning messages with their summary and description.
func UpdateCluster ¶ added in v0.1.43
func UpdateCluster(client *cmv1.ClustersClient, clusterID string, config Spec) error
func UpdateDeleteProtection ¶ added in v0.1.73
func UpdateDeleteProtection(client *cmv1.ClustersClient, clusterID string, enable bool) error
Types ¶
type AWSCredentials ¶ added in v0.1.42
type AddOnItem ¶ added in v0.1.40
func GetClusterAddOns ¶ added in v0.1.40
func GetClusterAddOns(connection *sdk.Connection, clusterID string) ([]*AddOnItem, error)
type Autoscaling ¶ added in v0.1.47
type CCS ¶ added in v0.1.45
type CCS struct {
Enabled bool
AWS AWSCredentials
GCP GCPCredentials
}
type ClusterWideProxy ¶ added in v0.1.61
type DefaultIngressSpec ¶ added in v0.1.68
type DefaultIngressSpec struct {
RouteSelectors map[string]string
ExcludedNamespaces []string
ExcludedNamespaceSelectors map[string][]string
WildcardPolicy string
NamespaceOwnershipPolicy string
}
func NewDefaultIngressSpec ¶ added in v0.1.68
func NewDefaultIngressSpec() DefaultIngressSpec
type ExistingVPC ¶ added in v0.1.61
type GCPCredentials ¶ added in v0.1.46
type GCPCredentials struct {
Type string `json:"type"`
ProjectID string `json:"project_id"`
PrivateKeyID string `json:"private_key_id"`
PrivateKey string `json:"private_key"`
ClientEmail string `json:"client_email"`
ClientID string `json:"client_id"`
AuthURI string `json:"auth_uri"`
TokenURI string `json:"token_uri"`
AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"`
ClientX509CertURL string `json:"client_x509_cert_url"`
}
type GcpAuthentication ¶ added in v0.1.75
type GcpEncryption ¶ added in v1.0.4
type GcpPrivateSvcConnect ¶ added in v0.1.76
type GcpPrivateSvcConnect struct {
SvcAttachmentSubnet string
}
type GcpSecurity ¶ added in v0.1.72
type GcpSecurity struct {
SecureBoot bool `json:"secure_boot,omitempty"`
}
type Spec ¶ added in v0.1.42
type Spec struct {
// Basic configs
Name string
DomainPrefix string
Region string
Provider string
CCS CCS
ExistingVPC ExistingVPC
ClusterWideProxy ClusterWideProxy
Flavour string
MultiAZ bool
Version string
// Channel is the Y-stream update channel (e.g., "stable-4.19", "candidate-4.19").
// This field allows specifying the update channel independently from the version.
Channel string
ChannelGroup string
Expiration time.Time
Fips bool
EtcdEncryption bool
SubscriptionType string
// Scaling config
ComputeMachineType string
ComputeNodes int
Autoscaling Autoscaling
RootDiskSize int
// Network config
NetworkType string
MachineCIDR net.IPNet
ServiceCIDR net.IPNet
PodCIDR net.IPNet
HostPrefix int
Private *bool
// Properties
CustomProperties map[string]string
// Default Ingress Attributes
DefaultIngress DefaultIngressSpec
// Gcp-specific settings
GcpSecurity GcpSecurity
// GCP Authentication settings
GcpAuthentication GcpAuthentication
// GCP PrivateServiceConnect settings
GcpPrivateSvcConnect GcpPrivateSvcConnect
//Includes Custom KMS encryption key settings
GcpEncryption GcpEncryption
// DNS settings
DNS DNS
}
Spec is the configuration for a cluster spec.