profilehandler

package
v1.2.39 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClusterByProfile

func CreateClusterByProfile(profile *Profile, client *rosacli.Client, waitForClusterReady bool) (*rosacli.ClusterDescription, error)

func GenerateAccountRoleCreationFlag

func GenerateAccountRoleCreationFlag(client *rosacli.Client,
	namePrefix string,
	hcp bool,
	openshiftVersion string,
	channelGroup string,
	path string,
	permissionsBoundary string) []string

GenerateAccountRoleCreationFlag will generate account role creation flags

func GenerateClusterCreateFlags

func GenerateClusterCreateFlags(profile *Profile, client *rosacli.Client) ([]string, error)

GenerateClusterCreateFlags will generate cluster creation flags

func GetYAMLProfilesDir

func GetYAMLProfilesDir() string

func ParseProfiles

func ParseProfiles(profilesDir string) map[string]*Profile

func PrepareAccountRoles

func PrepareAccountRoles(client *rosacli.Client,
	namePrefix string,
	hcp bool,
	openshiftVersion string,
	channelGroup string,
	path string,
	permissionsBoundary string) (
	accRoles *rosacli.AccountRolesUnit, err error)

PrepareAccountRoles will prepare account roles according to the parameters openshiftVersion must follow 4.15.2-x format

func PrepareAdminUser

func PrepareAdminUser() (string, string)

func PrepareAuditlogDummy

func PrepareAuditlogDummy() string

func PrepareExternalAuthConfigDummy

func PrepareExternalAuthConfigDummy()

func PrepareKMSKeyDummy

func PrepareKMSKeyDummy(region string) string

func PrepareOIDCConfig

func PrepareOIDCConfig(client *rosacli.Client,
	oidcConfigType string,
	region string,
	roleArn string,
	prefix string) (string, error)

PrepareOIDCConfig will prepare the oidc config for the cluster, if the oidcConfigType="managed", roleArn and prefix won't be set

func PrepareOIDCProvider

func PrepareOIDCProvider(client *rosacli.Client, oidcConfigID string) error

func PrepareOIDCProviderByCluster

func PrepareOIDCProviderByCluster(client *rosacli.Client, cluster string) error

func PrepareOperatorRolesByCluster

func PrepareOperatorRolesByCluster(client *rosacli.Client, cluster string) error

func PrepareOperatorRolesByOIDCConfig

func PrepareOperatorRolesByOIDCConfig(client *rosacli.Client,
	namePrefix string,
	oidcConfigID string,
	roleArn string,
	sharedVPCRoleArn string,
	hcp bool) error

PrepareOperatorRolesByOIDCConfig will prepare operator roles with OIDC config ID When sharedVPCRoleArn is not empty it will be set to the flag

func PreparePrefix

func PreparePrefix(profilePrefix string, nameLength int) string

PrepareNames will generate the name for cluster creation if longname is set, it will generate the long name with con.DefaultLongClusterNamelength

func PrepareProxysDummy

func PrepareProxysDummy(vpcID string, region string, zones string) map[string]string

func PrepareSecurityGroupsDummy

func PrepareSecurityGroupsDummy(vpcID string, region string, securityGroupCount int) []string

func PrepareSubnetsDummy

func PrepareSubnetsDummy(vpcID string, region string, zones string) map[string][]string

func PrepareVersion

func PrepareVersion(client *rosacli.Client, versionRequirement string, channelGroup string, hcp bool) (
	*rosacli.OpenShiftVersionTableOutput, error)

func RecordClusterInstallationLog

func RecordClusterInstallationLog(client *rosacli.Client, cluster string) error

func ReverifyClusterNetwork

func ReverifyClusterNetwork(client *rosacli.Client, clusterID string) error

func WaitForClusterReady

func WaitForClusterReady(client *rosacli.Client, cluster string, timeoutMin int) error

Types

type AccountRoleConfig

type AccountRoleConfig struct {
	Path               string `yaml:"path,omitempty"`
	PermissionBoundary string `yaml:"permission_boundary,omitempty"`
}

AccountRoleConfig will map the configuration of account roles from profile settings

type ClusterConfig

type ClusterConfig struct {
	BillingAccount                string `yaml:"billing_account,omitempty" json:"billing_account,omitempty"`
	Ec2MetadataHttpTokens         string `yaml:"imdsv2,omitempty" json:"imdsv2,omitempty"`
	InstanceType                  string `yaml:"instance_type,omitempty" json:"instance_type,omitempty"`
	Name                          string `yaml:"name,omitempty" json:"name,omitempty"`
	OIDCConfig                    string `yaml:"oidc_config,omitempty" json:"oidc_config,omitempty"`
	ProvisionShard                string `yaml:"provision_shard,omitempty" json:"provision_shard,omitempty"`
	Zones                         string `yaml:"zones,omitempty" json:"zones,omitempty"`
	AdditionalSGNumber            int    `yaml:"additional_sg_number,omitempty" json:"additional_sg_number,omitempty"`
	ExpirationTime                int    `yaml:"expiration_time,omitempty" json:"expiration_time,omitempty"`
	NameLegnth                    int    `default:"15" yaml:"name_length,omitempty" json:"name_length,omitempty"`
	VolumeSize                    int    `yaml:"volume_size,omitempty" json:"volume_size,omitempty"`
	WorkerPoolReplicas            int    `yaml:"replicas,omitempty" json:"replicas,omitempty"`
	AdminEnabled                  bool   `yaml:"admin_enabled,omitempty" json:"admin_enabled,omitempty"`
	AuditLogForward               bool   `yaml:"auditlog_forward,omitempty" json:"auditlog_forward,omitempty"`
	Autoscale                     bool   `yaml:"autoscale,omitempty" json:"autoscale,omitempty"`
	AutoscalerEnabled             bool   `yaml:"autoscaler_enabled,omitempty" json:"autoscaler_enabled,omitempty"`
	BYOVPC                        bool   `yaml:"byo_vpc,omitempty" json:"byo_vpc,omitempty"`
	DomainPrefixEnabled           bool   `yaml:"domain_prefix_enabled,omitempty" json:"domain_prefix_enabled,omitempty"`
	DisableUserWorKloadMonitoring bool   `yaml:"disable_uwm,omitempty" json:"disable_uwm,omitempty"`
	DisableSCPChecks              bool   `yaml:"disable_scp_checks,omitempty" json:"disable_scp_checks,omitempty"`
	ExternalAuthConfig            bool   `yaml:"external_auth_config,omitempty" json:"external_auth_config,omitempty"`
	EtcdEncryption                bool   `yaml:"etcd_encryption,omitempty" json:"etcd_encryption,omitempty"`
	ETCDKMS                       bool   `yaml:"etcd_kms,omitempty" json:"etcd_kms,omitempty"`
	FIPS                          bool   `yaml:"fips,omitempty" json:"fips,omitempty"`
	HCP                           bool   `yaml:"hcp,omitempty" json:"hypershift,omitempty"`
	IngressCustomized             bool   `yaml:"ingress_customized,omitempty" json:"ingress_customized,omitempty"`
	KMSKey                        bool   `yaml:"kms_key,omitempty" json:"kms_key,omitempty"`
	LabelEnabled                  bool   `yaml:"label_enabled,omitempty" json:"label_enabled,omitempty"`
	MultiAZ                       bool   `yaml:"multi_az,omitempty" json:"multi_az,omitempty"`
	NetWorkingSet                 bool   `yaml:"networking,omitempty" json:"networking,omitempty"`
	PrivateLink                   bool   `yaml:"private_link,omitempty" json:"private_link,omitempty"`
	Private                       bool   `yaml:"private,omitempty" json:"private,omitempty"`
	ProxyEnabled                  bool   `yaml:"proxy_enabled,omitempty" json:"proxy_enabled,omitempty"`
	STS                           bool   `yaml:"sts,omitempty" json:"sts,omitempty"`
	SharedVPC                     bool   `yaml:"shared_vpc,omitempty" json:"shared_vpc,omitempty"`
	TagEnabled                    bool   `yaml:"tag_enabled,omitempty" json:"tag_enabled,omitempty"`
}

ClusterConfig will map the clsuter configuration from profile settings

type ClusterDetail

type ClusterDetail struct {
	APIURL      string `json:"api_url,omitempty"`
	ClusterID   string `json:"cluster_id,omitempty"`
	ClusterName string `json:"cluster_name,omitempty"`
	ClusterType string `json:"cluster_type,omitempty"`
	ConsoleURL  string `json:"console_url,omitempty"`
	InfraID     string `json:"infra_id,omitempty"`
}

ClusterDetail will record basic cluster info to support other team's testing

type Profile

type Profile struct {
	ChannelGroup      string             `yaml:"channel_group,omitempty"`
	Name              string             `yaml:"as,omitempty"`
	NamePrefix        string             `yaml:"name_prefix,omitempty"`
	Region            string             `yaml:"region,omitempty"`
	Version           string             `yaml:"version,omitempty"`
	AccountRoleConfig *AccountRoleConfig `yaml:"account-role,omitempty"`
	ClusterConfig     *ClusterConfig     `yaml:"cluster,omitempty"`
}

Profile will map the profile settings from the profile yaml file

func GetProfile

func GetProfile(profileName string, profilesDir string) *Profile

func LoadProfileYamlFile

func LoadProfileYamlFile(profileName string) *Profile

func LoadProfileYamlFileByENV

func LoadProfileYamlFileByENV() *Profile

type UserData

type UserData struct {
	AccountRolesPrefix  string `json:"account_roles_prefix,omitempty"`
	AuditLogArn         string `json:"audit_log,omitempty"`
	KMSKey              string `json:"kms_key,omitempty"`
	OperatorRolesPrefix string `json:"operator_roles_prefix,omitempty"`
	OIDCConfigID        string `json:"oidc_config_id,omitempty"`
	VpcID               string `json:"vpc_id,omitempty"`
}

UserData will record the user data prepared for resource clean up

Jump to

Keyboard shortcuts

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