accountmanager

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountManager

type AccountManager struct {
	client.Client
	Log logr.Logger

	Inventory inventory.Interface
	// contains filtered or unexported fields
}

func (*AccountManager) AddAccount

func (a *AccountManager) AddAccount(namespacedName *types.NamespacedName, accountCloudType runtimev1alpha1.CloudProvider,
	account *crdv1alpha1.CloudProviderAccount) (bool, error)

AddAccount consumes CloudProviderAccount CR and calls cloud plugin to add account. It also creates and starts account poller thread for polling inventory.

func (*AccountManager) AddResourceFiltersToAccount

func (a *AccountManager) AddResourceFiltersToAccount(accNamespacedName *types.NamespacedName,
	selectorNamespacedName *types.NamespacedName, selector *crdv1alpha1.CloudEntitySelector, replay bool) (bool, error)

AddResourceFiltersToAccount add/update cloud plugin for a given account to include the new selector and restart poller once done.

func (*AccountManager) ConfigureAccountManager

func (a *AccountManager) ConfigureAccountManager()

ConfigureAccountManager configures and initializes account manager.

func (*AccountManager) IsAccountCredentialsValid

func (a *AccountManager) IsAccountCredentialsValid(namespacedName *types.NamespacedName) (bool, error)

IsAccountCredentialsValid return true for an account, if credentials are valid.

func (*AccountManager) RemoveAccount

func (a *AccountManager) RemoveAccount(namespacedName *types.NamespacedName) error

RemoveAccount removes account poller thread and cleans up all internal state in cloud plugin and inventory for this account.

func (*AccountManager) RemoveResourceFiltersFromAccount

func (a *AccountManager) RemoveResourceFiltersFromAccount(accNamespacedName *types.NamespacedName,
	selectorNamespacedName *types.NamespacedName) error

RemoveResourceFiltersFromAccount removes selector from cloud plugin and restart the poller.

func (*AccountManager) UpdatePendingCesCount added in v0.6.0

func (a *AccountManager) UpdatePendingCesCount(namespacedName *types.NamespacedName) int

UpdatePendingCesCount decrements pending CES count. Upon restart, wait for all CES to be added before starting cloud inventory poll. In restart case, accountToSelectorMap holds number of CES CRs if any CES CR is present in etcd.

func (*AccountManager) WaitForPollDone added in v0.6.0

func (a *AccountManager) WaitForPollDone(namespacedName *types.NamespacedName) error

WaitForPollDone restarts account poller and waits till inventory poll is done.

type Interface

type Interface interface {
	AddAccount(*types.NamespacedName, runtimev1alpha1.CloudProvider, *crdv1alpha1.CloudProviderAccount) (bool, error)
	RemoveAccount(*types.NamespacedName) error
	IsAccountCredentialsValid(namespacedName *types.NamespacedName) (bool, error)
	AddResourceFiltersToAccount(*types.NamespacedName, *types.NamespacedName, *crdv1alpha1.CloudEntitySelector, bool) (bool, error)
	RemoveResourceFiltersFromAccount(*types.NamespacedName, *types.NamespacedName) error
	UpdatePendingCesCount(namespacedName *types.NamespacedName) int
	WaitForPollDone(namespacedName *types.NamespacedName) error
}

Jump to

Keyboard shortcuts

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