git

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserID is key of GitHub user ID in secret
	UserID = "user"
	// AccessToken is key of GitHub user password or personal token in secret
	AccessToken = "accessToken"
	// Path is the key of GitHub package filter config map
	Path = "path"
)

Variables

This section is empty.

Functions

func Add

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

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

func GetDefaultSubscriber

func GetDefaultSubscriber() appv1.Subscriber

GetDefaultSubscriber - returns the default git subscriber.

Types

type Subscriber

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

Subscriber - information to run namespace subscription

func CreateGitHubSubscriber

func CreateGitHubSubscriber(config *rest.Config, scheme *runtime.Scheme, mgr manager.Manager,
	kubesync SyncSource, syncinterval int) *Subscriber

CreateGitHubSubscriber - create github subscriber with config to hub cluster, scheme of hub cluster and a syncrhonizer to local cluster

func (*Subscriber) SubscribeItem

func (ghs *Subscriber) SubscribeItem(subitem *appv1.SubscriberItem) error

SubscribeItem subscribes a subscriber item with namespace channel.

func (*Subscriber) UnsubscribeItem

func (ghs *Subscriber) UnsubscribeItem(key types.NamespacedName) error

UnsubscribeItem uhrsubscribes a namespace subscriber item.

type SubscriberItem

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

SubscriberItem - defines the unit of namespace subscription

func (*SubscriberItem) Start

func (ghsi *SubscriberItem) Start(restart bool)

Start subscribes a subscriber item with github channel

func (*SubscriberItem) Stop

func (ghsi *SubscriberItem) Stop()

Stop unsubscribes a subscriber item with namespace channel

type SyncSource

type SyncSource interface {
	GetInterval() int
	GetLocalClient() client.Client
	GetLocalNonCachedClient() client.Client
	GetRemoteClient() client.Client
	GetRemoteNonCachedClient() client.Client
	IsResourceNamespaced(*unstructured.Unstructured) bool
	ProcessSubResources(*appv1.Subscription, []kubesynchronizer.ResourceUnit,
		map[string]map[string]string, map[string]map[string]string, bool, bool) error
	PurgeAllSubscribedResources(*appv1.Subscription) error
	UpdateAppsubOverallStatus(*appv1.Subscription, bool, string) error
}

Jump to

Keyboard shortcuts

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