cache

package
v0.0.4-0...-cb4b663 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ACKRoleAccountMap is the name of the configmap map object storing
	// all the AWS Account IDs associated with their AWS Role ARNs.
	ACKRoleAccountMap = "ack-role-account-map"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCache

type AccountCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

AccountCache is responsible for caching the CARM configmap data. It is listening to all the events related to the CARM map and make the changes accordingly.

func NewAccountCache

func NewAccountCache(clientset kubernetes.Interface, log logr.Logger) *AccountCache

NewAccountCache makes a new AccountCache from a client.Interface and a logr.Logger

func (*AccountCache) GetAccountRoleARN

func (c *AccountCache) GetAccountRoleARN(accountID string) (string, bool)

GetAccountRoleARN queries the AWS accountID associated Role ARN from the cached CARM configmap. This function is thread safe.

func (*AccountCache) Run

func (c *AccountCache) Run(stopCh <-chan struct{})

Run adds the default event handler functions to the SharedInformer and runs the informer to begin processing items.

type Caches

type Caches struct {

	// Accounts cache
	Accounts *AccountCache

	// Namespaces cache
	Namespaces *NamespaceCache
	// contains filtered or unexported fields
}

Caches is used to interact with the different caches

func New

func New(clientset kubernetes.Interface, log logr.Logger) Caches

New creates a new Caches object from a kubernetes.Interface and a logr.Logger

func (Caches) Run

func (c Caches) Run()

Run runs all the owned caches

func (Caches) Stop

func (c Caches) Stop()

Stop closes the stop channel and cause all the SharedInformers by caches to stop running

type NamespaceCache

type NamespaceCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

NamespaceCache is responsible of keeping track of namespaces annotations, and caching those related to the ACK controller.

func NewNamespaceCache

func NewNamespaceCache(clientset kubernetes.Interface, log logr.Logger) *NamespaceCache

NewNamespaceCache makes a new NamespaceCache from a kubernetes.Interface and a logr.Logger

func (*NamespaceCache) GetDefaultRegion

func (c *NamespaceCache) GetDefaultRegion(namespace string) (string, bool)

GetDefaultRegion returns the default region if it it exists

func (*NamespaceCache) GetOwnerAccountID

func (c *NamespaceCache) GetOwnerAccountID(namespace string) (string, bool)

GetOwnerAccountID returns the owner account ID if it exists

func (*NamespaceCache) Run

func (c *NamespaceCache) Run(stopCh <-chan struct{})

Run adds event handler functions to the SharedInformer and runs the informer to begin processing items.

Jump to

Keyboard shortcuts

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