channels

package
v1.28.4 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 31 Imported by: 93

Documentation

Index

Constants

View Source
const AnnotationPrefix = "addons.k8s.io/"
View Source
const CurrentSystemGeneration = 1

CurrentSystemGeneration holds our current SystemGeneration value. Version history:

0  Pre-history (and the default value); versions prior to prune.
1  Prune functionality introduced.

Variables

This section is empty.

Functions

func FindChannelVersions added in v1.24.0

func FindChannelVersions(ns *v1.Namespace) map[string]*ChannelVersion

Types

type Addon

type Addon struct {
	Name            string
	ChannelName     string
	ChannelLocation url.URL
	Spec            *api.AddonSpec
}

Addon is a wrapper around a single version of an addon

func (*Addon) AddNeedsUpdateLabel added in v1.20.0

func (a *Addon) AddNeedsUpdateLabel(ctx context.Context, k8sClient kubernetes.Interface, required *AddonUpdate) error

func (*Addon) ChannelVersion

func (a *Addon) ChannelVersion() *ChannelVersion

func (*Addon) EnsureUpdated

func (a *Addon) EnsureUpdated(ctx context.Context, vfsContext *vfs.VFSContext, k8sClient kubernetes.Interface, cmClient certmanager.Interface, pruner *Pruner, applier Applier, existingVersion *ChannelVersion) (*AddonUpdate, error)

func (*Addon) GetManifestFullUrl added in v1.15.1

func (a *Addon) GetManifestFullUrl() (*url.URL, error)

func (*Addon) GetNamespace added in v1.24.0

func (a *Addon) GetNamespace() string

func (*Addon) GetRequiredUpdates

func (a *Addon) GetRequiredUpdates(ctx context.Context, k8sClient kubernetes.Interface, cmClient certmanager.Interface, existingVersion *ChannelVersion) (*AddonUpdate, error)

type AddonMenu added in v1.10.0

type AddonMenu struct {
	Addons map[string]*Addon
}

AddonMenu is a collection of addons, with helpers for computing the latest versions

func NewAddonMenu added in v1.10.0

func NewAddonMenu() *AddonMenu

func (*AddonMenu) MergeAddons added in v1.10.0

func (m *AddonMenu) MergeAddons(o *AddonMenu)

type AddonUpdate

type AddonUpdate struct {
	Name            string
	ExistingVersion *ChannelVersion
	NewVersion      *ChannelVersion
	InstallPKI      bool
}

AddonUpdate holds data about a proposed update to an addon

type Addons

type Addons struct {
	ChannelName     string
	ChannelLocation url.URL
	APIObject       *api.Addons
}

func LoadAddons

func LoadAddons(vfsContext *vfs.VFSContext, name string, location *url.URL) (*Addons, error)

func ParseAddons

func ParseAddons(name string, location *url.URL, data []byte) (*Addons, error)

func (*Addons) GetCurrent

func (a *Addons) GetCurrent(kubernetesVersion semver.Version) (*AddonMenu, error)

type Applier added in v1.25.0

type Applier interface {
	Apply(ctx context.Context, data []byte) error
}

type Channel

type Channel struct {
	Namespace string
	Name      string
}

func (*Channel) AnnotationName

func (c *Channel) AnnotationName() string

func (*Channel) GetInstalledVersion

func (c *Channel) GetInstalledVersion(ctx context.Context, k8sClient kubernetes.Interface) (*ChannelVersion, error)

func (*Channel) IsPKIInstalled added in v1.20.0

func (c *Channel) IsPKIInstalled(ctx context.Context, k8sClient kubernetes.Interface, cmClient certmanager.Interface) (bool, error)

func (*Channel) SetInstalledVersion

func (c *Channel) SetInstalledVersion(ctx context.Context, k8sClient kubernetes.Interface, version *ChannelVersion) error

type ChannelVersion

type ChannelVersion struct {
	Channel      *string `json:"channel,omitempty"`
	Id           string  `json:"id,omitempty"`
	ManifestHash string  `json:"manifestHash,omitempty"`

	// SystemGeneration holds the generation of the channels functionality.
	// It is used so that we reapply when we introduce new features, such as prune.
	SystemGeneration int `json:"systemGeneration,omitempty"`
}

func ParseChannelVersion

func ParseChannelVersion(s string) (*ChannelVersion, error)

func (*ChannelVersion) Encode

func (c *ChannelVersion) Encode() (string, error)

func (*ChannelVersion) String added in v1.10.0

func (c *ChannelVersion) String() string

type ClientApplier added in v1.25.0

type ClientApplier struct {
	Client     dynamic.Interface
	RESTMapper *restmapper.DeferredDiscoveryRESTMapper
}

func (*ClientApplier) Apply added in v1.25.0

func (p *ClientApplier) Apply(ctx context.Context, manifest []byte) error

Apply applies the manifest to the cluster.

type KubectlApplier added in v1.25.0

type KubectlApplier struct{}

func (*KubectlApplier) Apply added in v1.25.0

func (*KubectlApplier) Apply(ctx context.Context, data []byte) error

Apply calls kubectl apply to apply the manifest. We will likely in future change this to create things directly (or more likely embed this logic into kubectl itself)

type Pruner added in v1.23.0

type Pruner struct {
	Client     dynamic.Interface
	RESTMapper *restmapper.DeferredDiscoveryRESTMapper
}

func (*Pruner) Prune added in v1.23.0

func (p *Pruner) Prune(ctx context.Context, manifest []byte, spec *api.PruneSpec) error

Prune prunes objects not in the manifest, according to PruneSpec.

Jump to

Keyboard shortcuts

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