registry

package
v1.9.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package registry provides code to push and pull Affiliates to different registries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AffiliateFromNode

func AffiliateFromNode(node *v1.Node) *cluster.AffiliateSpec

AffiliateFromNode converts Kubernetes Node resource to Affiliate.

If the Node resource doesn't have cluster discovery annotations, nil is returned.

func AnnotationsFromAffiliate

func AnnotationsFromAffiliate(affiliate *cluster.Affiliate) map[string]string

AnnotationsFromAffiliate generates Kubernetes Node annotations from the Affiliate spec.

Types

type Kubernetes

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

Kubernetes defines a Kubernetes-based node discoverer.

func NewKubernetes

func NewKubernetes(client *kubernetes.Client) *Kubernetes

NewKubernetes creates new Kubernetes registry.

func (*Kubernetes) List

func (r *Kubernetes) List(localNodeName string) ([]*cluster.AffiliateSpec, error)

List returns list of Affiliates coming from the registry.

Watch should be called first for the List to return data.

func (*Kubernetes) Push

func (r *Kubernetes) Push(ctx context.Context, affiliate *cluster.Affiliate) error

Push updates Kubernetes Node resource to track Affiliate state.

func (*Kubernetes) Watch

func (r *Kubernetes) Watch(ctx context.Context, logger *zap.Logger) (<-chan struct{}, func(), error)

Watch starts watching Node state and notifies on updates via notify channel.

Jump to

Keyboard shortcuts

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