namespace

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager, hubconfig *rest.Config, syncid *types.NamespacedName, syncinterval int) error

Add does nothing for namespace subscriber, it generates cache for each of the item

func GetdefaultNsSubscriber

func GetdefaultNsSubscriber() appv1alpha1.Subscriber

GetdefaultNsSubscriber - returns the default namespace subscriber

Types

type DeployableReconciler

type DeployableReconciler struct {
	// This client, initialized using mgr.Client() above, is a split client
	// that reads objects from the cache and writes to the apiserver
	client.Client
	// contains filtered or unexported fields
}

DeployableReconciler reconciles a Deployable object of Nmespace channel

func NewNsDeployableReconciler

func NewNsDeployableReconciler(hub client.Client, nsSubscribe *NsSubscriber, ikey types.NamespacedName) *DeployableReconciler

func (*DeployableReconciler) Reconcile

Reconcile finds out all channels related to this deployable, then all subscriptions subscribing that channel and update them

type NsSubscriber

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

NsSubscriber information to run namespace subscription

func CreateNsSubscriber

func CreateNsSubscriber(
	config *rest.Config, scheme *runtime.Scheme,
	mgr manager.Manager,
	kubesync SyncSource) (*NsSubscriber, error)

CreateNsSubscriber - create namespace subscriber with config to hub cluster, scheme of hub cluster and a syncrhonizer to local cluster

func (*NsSubscriber) SubscribeItem

func (ns *NsSubscriber) SubscribeItem(subitem *appv1alpha1.SubscriberItem) error

SubscribeItem subscribes a subscriber item with namespace channel

func (*NsSubscriber) SubscribeNamespaceItem

func (ns *NsSubscriber) SubscribeNamespaceItem(subitem *appv1alpha1.SubscriberItem, isClusterScoped bool) error

SubscribeNamespaceItem adds namespace subscribe item to subscriber

func (*NsSubscriber) UnsubscribeItem

func (ns *NsSubscriber) UnsubscribeItem(key types.NamespacedName) error

UnsubscribeItem unsubscribes a namespace subscriber item

type NsSubscriberItem

type NsSubscriberItem struct {
	appv1alpha1.SubscriberItem
	// contains filtered or unexported fields
}

NsSubscriberItem defines the unit of namespace subscription

type SecretReconciler

type SecretReconciler struct {
	*NsSubscriber
	Clt     client.Client
	Schema  *runtime.Scheme
	Itemkey types.NamespacedName
}

SecretReconciler defined a info collection for query secret resource

func (*SecretReconciler) Reconcile

func (s *SecretReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile handle the main logic to deploy the secret coming from the channel namespace

type SyncSource

type SyncSource interface {
	GetInterval() int
	GetLocalClient() client.Client
	GetValidatedGVK(schema.GroupVersionKind) *schema.GroupVersionKind
	IsResourceNamespaced(schema.GroupVersionKind) bool
	AddTemplates(string, types.NamespacedName, []kubesynchronizer.DplUnit) error
	CleanupByHost(types.NamespacedName, string) error
}

Jump to

Keyboard shortcuts

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