capabilities

package
v0.0.0-...-2caf503 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package capabilities provides an service to find out which capabilities/functions a workload cluster on the given installation will provide.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Autoscaling is the capability to scale workload clusters automatically.
	Autoscaling = CapabilityDefinition{
		Name: "Autoscaling",
		RequiredReleasePerProvider: []ReleaseProviderPair{
			ReleaseProviderPair{
				Provider:       "aws",
				ReleaseVersion: semver.MustParse("6.3"),
			},
		},
	}

	// AvailabilityZones is the capability to spread the worker nodes of a workload
	// cluster over multiple availability zones.
	AvailabilityZones = CapabilityDefinition{
		Name: "AvailabilityZones",
		RequiredReleasePerProvider: []ReleaseProviderPair{
			ReleaseProviderPair{
				Provider:       "aws",
				ReleaseVersion: semver.MustParse("6.1"),
			},
		},
	}

	// NodePools is the capabilitiy to group workload cluster workers logically.
	// Details get completed with API data, if the feature is available.
	NodePools = CapabilityDefinition{
		Name: "NodePools",
	}

	// HAMasters provides details about the high availability masters feature.
	HAMasters = CapabilityDefinition{
		Name: "HAMasters",
	}
)

Functions

func IsCouldNotFetchFeatures

func IsCouldNotFetchFeatures(err error) bool

IsCouldNotFetchFeatures asserts couldNotFetchFeatures.

func IsCouldNotInitializeCapabilities

func IsCouldNotInitializeCapabilities(err error) bool

IsCouldNotInitializeCapabilities asserts couldNotInitializeCapabilities.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsInvalidSemVer

func IsInvalidSemVer(err error) bool

IsInvalidSemVer asserts semver.ErrInvalidSemVer, as semver unfortunately does not provide a matcher.

Types

type CapabilityDefinition

type CapabilityDefinition struct {
	// Name is a user friendly name we use here in gsctl.
	Name string

	// RequiredReleasePerProvider holds the combination(s) of provider and
	// release version which have to be fulfilled so we assume a capability.
	RequiredReleasePerProvider []ReleaseProviderPair
}

CapabilityDefinition is the type we use to describe the conditions that have to be met so that we can assume a certain capability on the installation or API side.

type ReleaseProviderPair

type ReleaseProviderPair struct {
	Provider       string
	ReleaseVersion *semver.Version
}

ReleaseProviderPair is a combination of a providr ('aws', 'azure', 'kvm) and a release version number.

type Service

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

Service provides methods to get more details on the installation's and workload cluster's capabilities.

func New

func New(provider string, clientWrapper *client.Wrapper) (*Service, error)

New creates a new configured Service.

func (*Service) GetCapabilities

func (s *Service) GetCapabilities(releaseVersion string) ([]CapabilityDefinition, error)

GetCapabilities returns the list of capabilities that applies to a given release version, considering the installation's provider.

func (*Service) HasCapability

func (s *Service) HasCapability(releaseVersion string, capability CapabilityDefinition) (bool, error)

HasCapability returns true if the current context (provider, release) provides the given capabililty.

Jump to

Keyboard shortcuts

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