mirrosa

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// Cluster holds a cluster object from OCM
	Cluster *cmv1.Cluster

	// AwsConfig holds the configuration for building an AWS client
	AwsConfig aws.Config

	// ClusterInfo contains information about the ROSA cluster that will be used to validate it
	ClusterInfo *ClusterInfo
	// contains filtered or unexported fields
}

Client holds relevant information about a ROSA cluster gleaned from OCM and an AwsApi to validate the cluster in AWS

func NewClient

func NewClient(logger *slog.Logger, clusterId string) (*Client, error)

NewClient looks up information in OCM about a given cluster id and returns a new mirrosa client. Requires valid AWS and OCM credentials to be present beforehand.

func NewRosaClient

func NewRosaClient(ctx context.Context, logger *slog.Logger, clusterId string) (*Client, error)

func (*Client) FindVpcId

func (c *Client) FindVpcId(ctx context.Context) error

FindVpcId determines c.ClusterInfo.VpcId by determining the AWS VPC ID of a cluster

func (*Client) NewApiLoadBalancer

func (c *Client) NewApiLoadBalancer() NetworkLoadBalancer

func (*Client) NewDhcpOptions

func (c *Client) NewDhcpOptions() DhcpOptions

func (*Client) NewInstances

func (c *Client) NewInstances() Instances

func (*Client) NewPrivateHostedZone

func (c *Client) NewPrivateHostedZone() PrivateHostedZone

func (*Client) NewPublicHostedZone

func (c *Client) NewPublicHostedZone() PublicHostedZone

func (*Client) NewSecurityGroup

func (c *Client) NewSecurityGroup() SecurityGroup

func (*Client) NewVpc

func (c *Client) NewVpc() Vpc

func (*Client) NewVpcEndpointService

func (c *Client) NewVpcEndpointService() VpcEndpointService

func (*Client) ValidateComponents

func (c *Client) ValidateComponents(ctx context.Context, components ...Component) error

ValidateComponents wraps the Validate method on one or many Component(s)

type ClusterInfo

type ClusterInfo struct {
	// Name of the cluster
	Name string

	// InfraName is the name with an additional slug that hive gives a ROSA cluster
	InfraName string

	// BaseDomain is the DNS base domain of the cluster
	BaseDomain string

	// VpcId is the AWS ID of the VPC the cluster is installed in
	VpcId string
}

ClusterInfo contains information about the ROSA cluster that will be used to validate it

func (ClusterInfo) LogValue added in v0.0.6

func (c ClusterInfo) LogValue() slog.Value

type Component

type Component interface {
	// FilterValue returns the name of the component to implement the github.com/charmbracelet/bubbles/list Item interface
	FilterValue() string

	// Title returns the name of the component for the bubbletea TUI
	Title() string

	// Description returns a thorough description of the component's expected configuration.
	// It should allow a new user of ROSA to understand what the expected state is and why it should be that way.
	Description() string

	// Validate checks a component for any misconfiguration and returns any error
	Validate(ctx context.Context) error
}

Component represents a specific component that will be validated

type DhcpOptions

type DhcpOptions struct {
	VpcId string

	Ec2Client MirrosaDhcpOptionsAPIClient
	// contains filtered or unexported fields
}

func (DhcpOptions) Description added in v0.0.3

func (d DhcpOptions) Description() string

func (DhcpOptions) FilterValue

func (d DhcpOptions) FilterValue() string

func (DhcpOptions) Title added in v0.0.3

func (d DhcpOptions) Title() string

func (DhcpOptions) Validate

func (d DhcpOptions) Validate(ctx context.Context) error

type Instances

type Instances struct {
	InfraName string
	MultiAZ   bool

	Ec2Client MirrosaInstancesAPIClient
	// contains filtered or unexported fields
}

func (Instances) Description added in v0.0.3

func (i Instances) Description() string

func (Instances) FilterValue

func (i Instances) FilterValue() string

func (Instances) Title added in v0.0.3

func (i Instances) Title() string

func (Instances) Validate

func (i Instances) Validate(ctx context.Context) error

type MirrosaDhcpOptionsAPIClient

type MirrosaDhcpOptionsAPIClient interface {
	ec2.DescribeDhcpOptionsAPIClient
	ec2.DescribeVpcsAPIClient
}

type MirrosaInstancesAPIClient added in v0.0.2

type MirrosaInstancesAPIClient interface {
	ec2.DescribeInstancesAPIClient
}

type MirrosaVpcAPIClient

type MirrosaVpcAPIClient interface {
	DescribeVpcAttribute(ctx context.Context, params *ec2.DescribeVpcAttributeInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVpcAttributeOutput, error)
}

MirrosaVpcAPIClient is a client that implements what's needed to validate a Vpc

type MirrosaVpcEndpointServiceAPIClient

type MirrosaVpcEndpointServiceAPIClient interface {
	DescribeVpcEndpointServices(ctx context.Context, params *ec2.DescribeVpcEndpointServicesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVpcEndpointServicesOutput, error)
	ec2.DescribeVpcEndpointConnectionsAPIClient
}

MirrosaVpcEndpointServiceAPIClient is a client that implements what's needed to validate a VpcEndpointService

type NetworkLoadBalancer

type NetworkLoadBalancer struct {
	InfraName   string
	PrivateLink bool
	Sts         bool
	VpcId       string

	ElbV2Client NetworkLoadBalancerAPIClient
	// contains filtered or unexported fields
}

func (NetworkLoadBalancer) Description added in v0.0.3

func (n NetworkLoadBalancer) Description() string

func (NetworkLoadBalancer) FilterValue

func (n NetworkLoadBalancer) FilterValue() string

func (NetworkLoadBalancer) Title added in v0.0.3

func (n NetworkLoadBalancer) Title() string

func (NetworkLoadBalancer) Validate

func (n NetworkLoadBalancer) Validate(ctx context.Context) error

type NetworkLoadBalancerAPIClient

NetworkLoadBalancerAPIClient is a client that implements what's needed to validate a NetworkLoadBalancer

type PrivateHostedZone

type PrivateHostedZone struct {
	ClusterName string
	BaseDomain  string
	Region      types.VPCRegion
	VpcId       string

	Route53Client Route53AwsApi
	// contains filtered or unexported fields
}

func (PrivateHostedZone) Description added in v0.0.3

func (p PrivateHostedZone) Description() string

func (PrivateHostedZone) FilterValue

func (p PrivateHostedZone) FilterValue() string

func (PrivateHostedZone) Title added in v0.0.3

func (p PrivateHostedZone) Title() string

func (PrivateHostedZone) Validate

func (p PrivateHostedZone) Validate(ctx context.Context) error

type PublicHostedZone

type PublicHostedZone struct {
	BaseDomain  string
	PrivateLink bool

	Route53Client Route53AwsApi
	// contains filtered or unexported fields
}

func (PublicHostedZone) Description added in v0.0.3

func (p PublicHostedZone) Description() string

func (PublicHostedZone) FilterValue

func (p PublicHostedZone) FilterValue() string

func (PublicHostedZone) Title added in v0.0.3

func (p PublicHostedZone) Title() string

func (PublicHostedZone) Validate

func (p PublicHostedZone) Validate(ctx context.Context) error

type Route53AwsApi

type Route53AwsApi interface {
	GetHostedZone(ctx context.Context, params *route53.GetHostedZoneInput, optFns ...func(*route53.Options)) (*route53.GetHostedZoneOutput, error)
	ListHostedZonesByName(ctx context.Context, params *route53.ListHostedZonesByNameInput, optFns ...func(*route53.Options)) (*route53.ListHostedZonesByNameOutput, error)
	ListResourceRecordSets(ctx context.Context, params *route53.ListResourceRecordSetsInput, optFns ...func(*route53.Options)) (*route53.ListResourceRecordSetsOutput, error)
}

type SecurityGroup

type SecurityGroup struct {
	InfraName   string
	MachineCIDR string

	Ec2Client Ec2AwsApi
	// contains filtered or unexported fields
}

func (SecurityGroup) Description added in v0.0.3

func (s SecurityGroup) Description() string

func (SecurityGroup) FilterValue

func (s SecurityGroup) FilterValue() string

func (SecurityGroup) Title added in v0.0.3

func (s SecurityGroup) Title() string

func (SecurityGroup) Validate

func (s SecurityGroup) Validate(ctx context.Context) error

type Vpc

type Vpc struct {
	Id string

	Ec2Client MirrosaVpcAPIClient
	// contains filtered or unexported fields
}

func (Vpc) Description added in v0.0.3

func (v Vpc) Description() string

func (Vpc) FilterValue

func (v Vpc) FilterValue() string

func (Vpc) Title added in v0.0.3

func (v Vpc) Title() string

func (Vpc) Validate

func (v Vpc) Validate(ctx context.Context) error

type VpcEndpointService

type VpcEndpointService struct {
	InfraName   string
	PrivateLink bool

	Ec2Client MirrosaVpcEndpointServiceAPIClient
	// contains filtered or unexported fields
}

func (VpcEndpointService) Description added in v0.0.3

func (v VpcEndpointService) Description() string

func (VpcEndpointService) FilterValue

func (v VpcEndpointService) FilterValue() string

func (VpcEndpointService) Title added in v0.0.3

func (v VpcEndpointService) Title() string

func (VpcEndpointService) Validate

func (v VpcEndpointService) Validate(ctx context.Context) error

Jump to

Keyboard shortcuts

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