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 ¶
- func IsUnavailable(target *fleet.BundleDeployment) bool
- func MaxUnavailable(targets []*Target) (int, error)
- func MaxUnavailablePartitions(partitions []Partition, targets []*Target) (int, error)
- func Summary(targets []*Target) fleet.BundleSummary
- func Unavailable(targets []*Target) (count int)
- func UpdateStatusUnavailable(status *fleet.PartitionStatus, targets []*Target) bool
- type BundleMapping
- type Manager
- func (m *Manager) BundleFromDeployment(bd *fleet.BundleDeployment) (string, string)
- func (m *Manager) BundlesForCluster(cluster *fleet.Cluster) (bundlesToRefresh, bundlesToCleanup []*fleet.Bundle, err error)
- func (m *Manager) GetBundleDeploymentsForBundleInCluster(app *fleet.Bundle, cluster *fleet.Cluster) (result []*fleet.BundleDeployment, err error)
- func (m *Manager) StoreManifest(manifest *manifest.Manifest) (string, error)
- func (m *Manager) Targets(bundle *fleet.Bundle, manifest *manifest.Manifest) ([]*Target, error)
- type Partition
- type Target
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 ¶
MaxUnavailable returns the maximum number of unavailable deployments given the targets rollout strategy (pure function)
func MaxUnavailablePartitions ¶ added in v0.2.0
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 ¶
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 NewBundleMapping(mapping *fleet.BundleNamespaceMapping, namespaces corecontrollers.NamespaceCache, bundles fleetcontrollers.BundleCache) (*BundleMapping, error)
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 New ¶
func New( clusters fleetcontrollers.ClusterCache, clusterGroups fleetcontrollers.ClusterGroupCache, bundles fleetcontrollers.BundleCache, bundleNamespaceMappingCache fleetcontrollers.BundleNamespaceMappingCache, namespaceCache corecontrollers.NamespaceCache, contentStore manifest.Store, bundleDeployments fleetcontrollers.BundleDeploymentCache) *Manager
func (*Manager) BundleFromDeployment ¶ added in v0.3.0
func (m *Manager) BundleFromDeployment(bd *fleet.BundleDeployment) (string, string)
func (*Manager) BundlesForCluster ¶
func (*Manager) GetBundleDeploymentsForBundleInCluster ¶ added in v0.3.9
func (*Manager) StoreManifest ¶ added in v0.6.0
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 ¶
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
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
BundleDeploymentLabels returns all labels from the Bundle
func (*Target) ResetDeployment ¶ added in v0.6.0
func (t *Target) ResetDeployment()
ResetDeployment replaces the BundleDeployment for the target with a new one