clusterutil

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateAdditionalDisk added in v0.16.0

func CalculateAdditionalDisk(requestedDisk resource.ByteQuantity, pkg *bookingv1.Package) (uint32, error)

CalculateAdditionalDisk returns the additional disk (in GiB) needed beyond what the package includes. Returns 0 if the requested disk is not larger than the package's included disk.

func FilteredPackages added in v0.16.0

func FilteredPackages(
	cmd *cobra.Command,
	s *state.State,
	cloudProvider string,
	cloudRegion *string,
	f PackageFilter,
) ([]*bookingv1.Package, error)

FilteredPackages fetches active packages matching the given filter.

func ResolvePackageByID added in v0.16.0

func ResolvePackageByID(
	ctx context.Context,
	booking bookingv1.BookingServiceClient,
	accountID, cloudProvider string,
	cloudRegion *string,
	id string,
) (*bookingv1.Package, error)

ResolvePackageByID fetches a single package by its UUID.

func ResolvePackageByName added in v0.16.0

func ResolvePackageByName(
	ctx context.Context,
	booking bookingv1.BookingServiceClient,
	accountID, cloudProvider string,
	cloudRegion *string,
	name string,
	multiAz bool,
) (*bookingv1.Package, error)

ResolvePackageByName lists active packages and returns the first matching by name.

func ResolvePackageByResources added in v0.16.0

func ResolvePackageByResources(
	ctx context.Context,
	booking bookingv1.BookingServiceClient,
	q PackageResourceQuery,
) (*bookingv1.Package, error)

ResolvePackageByResources lists active packages and returns the unique one matching all non-zero resource dimensions (cpu, ram, gpu) and the multiAz flag. Returns an error if zero or more than one package matches.

func WaitForClusterHealthy

func WaitForClusterHealthy(
	ctx context.Context,
	svc clusterv1.ClusterServiceClient,
	out io.Writer,
	accountID, clusterID string,
	timeout, pollInterval time.Duration,
) (*clusterv1.Cluster, error)

WaitForClusterHealthy polls cluster status until it becomes healthy, times out, or enters a failure phase. Progress lines are written to out.

Types

type PackageFilter added in v0.16.0

type PackageFilter struct {
	CPU        resource.Millicores
	RAM        resource.ByteQuantity
	GPU        resource.Millicores
	IncludeGPU bool
	MultiAz    bool
}

PackageFilter holds the parameters for filtering packages. Zero values for CPU/RAM/GPU mean "do not filter on that dimension".

type PackageResourceQuery added in v0.16.0

type PackageResourceQuery struct {
	AccountID     string
	CloudProvider string
	CloudRegion   *string
	CPU           resource.Millicores
	GPU           resource.Millicores
	RAM           resource.ByteQuantity
	MultiAz       bool
}

PackageResourceQuery holds the parameters for resolving a package by resources.

Jump to

Keyboard shortcuts

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