target

package
v0.7.1-debug-1842-1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package target provides functionality around building and deploying bundledeployments. (fleetcontroller)

Each "Target" represents a bundle, cluster pair and will be transformed into a bundledeployment. The manifest, persisted in the content resource, contains the resources available to these bundledeployments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUnavailable

func IsUnavailable(target *fleet.BundleDeployment) bool

IsUnavailable checks if target is not available (pure function)

func MaxUnavailable

func MaxUnavailable(targets []*Target) (int, error)

MaxUnavailable returns the maximum number of unavailable deployments given the targets rollout strategy (pure function)

func MaxUnavailablePartitions added in v0.2.0

func MaxUnavailablePartitions(partitions []Partition, targets []*Target) (int, error)

MaxUnavailablePartitions returns the maximum number of unavailable partitions given the targets and partitions (pure function)

func Summary added in v0.2.0

func Summary(targets []*Target) fleet.BundleSummary

Summary calculates a fleet.BundleSummary from targets (pure function)

func Unavailable

func Unavailable(targets []*Target) (count int)

Unavailable counts the number of targets that are not available (pure function)

func UpdateStatusUnavailable added in v0.6.0

func UpdateStatusUnavailable(status *fleet.PartitionStatus, targets []*Target) bool

UpdateStatusUnavailable recomputes and sets the status.Unavailable counter and returns true if the partition is unavailable, eg. there are more unavailable targets than the maximum set (does not mutate targets)

Types

type BundleMapping added in v0.3.0

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

func NewBundleMapping added in v0.3.0

func (*BundleMapping) Bundles added in v0.3.0

func (b *BundleMapping) Bundles() ([]*fleet.Bundle, error)

func (*BundleMapping) Matches added in v0.3.0

func (b *BundleMapping) Matches(fleetBundle *fleet.Bundle) bool

func (*BundleMapping) MatchesNamespace added in v0.3.0

func (b *BundleMapping) MatchesNamespace(namespace string) bool

func (*BundleMapping) Namespaces added in v0.3.0

func (b *BundleMapping) Namespaces() ([]*corev1.Namespace, error)

type Manager

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

func (*Manager) BundleFromDeployment added in v0.3.0

func (m *Manager) BundleFromDeployment(bd *fleet.BundleDeployment) (string, string)

func (*Manager) BundlesForCluster

func (m *Manager) BundlesForCluster(cluster *fleet.Cluster) (bundlesToRefresh, bundlesToCleanup []*fleet.Bundle, err error)

func (*Manager) GetBundleDeploymentsForBundleInCluster added in v0.3.9

func (m *Manager) GetBundleDeploymentsForBundleInCluster(bundle *fleet.Bundle, cluster *fleet.Cluster) (result []*fleet.BundleDeployment, err error)

func (*Manager) StoreManifest added in v0.6.0

func (m *Manager) StoreManifest(manifest *manifest.Manifest) (string, error)

StoreManifest stores the manifest as a content resource and returns the name. It copies the resources from the bundle to the content resource.

func (*Manager) Targets

func (m *Manager) Targets(bundle *fleet.Bundle, manifest *manifest.Manifest) ([]*Target, error)

Targets returns all targets for a bundle, so we can create bundledeployments for each. This is done by checking all namespaces for clusters matching the bundle's BundleTarget matchers.

The returned target structs contain merged BundleDeploymentOptions. Finally all existing bundledeployments are added to the targets.

type Partition added in v0.2.0

type Partition struct {
	Status  fleet.PartitionStatus
	Targets []*Target
}

func Partitions added in v0.2.0

func Partitions(targets []*Target) ([]Partition, error)

Partitions distributes targets into partitions based on the rollout strategy (pure function)

type Target

type Target struct {
	Deployment    *fleet.BundleDeployment
	ClusterGroups []*fleet.ClusterGroup
	Cluster       *fleet.Cluster
	Bundle        *fleet.Bundle
	Options       fleet.BundleDeploymentOptions
	DeploymentID  string
}

func (*Target) BundleDeploymentLabels added in v0.7.0

func (t *Target) BundleDeploymentLabels() map[string]string

BundleDeploymentLabels returns all labels from the Bundle

func (*Target) IsPaused

func (t *Target) IsPaused() bool

func (*Target) ResetDeployment added in v0.6.0

func (t *Target) ResetDeployment()

ResetDeployment replaces the BundleDeployment for the target with a new one

Jump to

Keyboard shortcuts

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