data

package
v0.0.0-...-b25b198 Latest Latest
Warning

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

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

Documentation

Overview

Package data provides data types for the TKR Resolver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OSImageQuery

type OSImageQuery struct {
	// K8sVersionPrefix is a version prefix for matching Kubernetes versions.
	K8sVersionPrefix string

	// TKRSelector is a label selector that resolved TKRs must satisfy.
	TKRSelector labels.Selector

	// OSImageSelector is a label selector that resolved OSImages must satisfy.
	OSImageSelector labels.Selector
}

OSImageQuery sets constraints for resolution of OSImages for the control plane or a machine deployment of a cluster.

func (*OSImageQuery) String

func (q *OSImageQuery) String() string

type OSImageResult

type OSImageResult struct {
	// K8sVersion is the latest conforming K8s version. If empty, then no K8s version satisfied the query.
	K8sVersion string

	// TKRName is the latest conforming TKR name. If empty, then no TKRs satisfied the query.
	TKRName string

	// TKRsByK8sVersion maps resolved K8s versions to TKRs.
	TKRsByK8sVersion map[string]TKRs

	// OSImagesByTKR maps resolved TKR names to OSImages.
	OSImagesByTKR map[string]OSImages
}

OSImageResult carries the results of OSImage resolution for the control plane or a machine deployment of a cluster.

func (*OSImageResult) String

func (r *OSImageResult) String() string

type OSImages

type OSImages map[string]*runv1.OSImage

OSImages is a set of OSImage objects implemented as a map osImage.Name -> osImage.

func (OSImages) Filter

func (osImages OSImages) Filter(f func(osImage *runv1.OSImage) bool) OSImages

Filter returns a subset of OSImages satisfying the predicate f.

func (OSImages) String

func (osImages OSImages) String() string

type Query

type Query struct {
	// ControlPlane specifies the Query for the control plane.
	// Set to nil if we want to skip resolving the control plane part.
	ControlPlane *OSImageQuery

	// MachineDeployments specifies the OSImageQueries for worker machine deployments.
	// An individual machine deployment query part may be set to nil if we want to skip resolving it.
	MachineDeployments []*OSImageQuery
}

Query sets constraints for resolution of TKRs. Its structure reflects Cluster API cluster topology.

func (Query) String

func (q Query) String() string

type Result

type Result struct {
	// ControlPlane carries the Result for the  control plane.
	// It is set to nil if resolving the control plane part was skipped.
	ControlPlane *OSImageResult

	// ControlPlane carries the Result for worker machine deployments.
	// An individual machine deployment result is set to nil if resolving it was skipped.
	MachineDeployments []*OSImageResult
}

Result carries the results of TKR resolution. Its structure reflects Cluster API cluster topology.

func (Result) String

func (r Result) String() string

type TKRs

TKRs is a set of TanzuKubernetesRelease objects implemented as a map tkr.Name -> tkr.

func (TKRs) Filter

func (tkrs TKRs) Filter(f func(tkr *runv1.TanzuKubernetesRelease) bool) TKRs

Filter returns a subset of TKRs satisfying the predicate f.

func (TKRs) Intersect

func (tkrs TKRs) Intersect(other TKRs) TKRs

Jump to

Keyboard shortcuts

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