namespace

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NamespaceController

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

NamespaceController watches the 'Namespace' resource creation/update and applied the generation rules on them

func NewNamespaceController

func NewNamespaceController(kyvernoClient *kyvernoclient.Clientset,
	client *client.Client,
	nsInformer v1Informer.NamespaceInformer,
	pInformer kyvernoinformer.ClusterPolicyInformer,
	policyStatus policy.PolicyStatusInterface,
	eventGen event.Interface,
	configHandler config.Interface,
	pvGenerator policyviolation.GeneratorInterface,
	pMetaStore policystore.LookupInterface) *NamespaceController

NewNamespaceController returns a new Controller to manage generation rules

func (*NamespaceController) Run

func (nsc *NamespaceController) Run(workers int, stopCh <-chan struct{})

Run to run the controller

type NamespaceLister

type NamespaceLister struct {
	v1CoreLister.NamespaceLister
}

NamespaceLister ...

func (*NamespaceLister) GetResource

func (nsl *NamespaceLister) GetResource(name string) (*v1.Namespace, error)

GetResource is a wrapper to get the resource and inject the GVK

func (*NamespaceLister) ListResources

func (nsl *NamespaceLister) ListResources(selector labels.Selector) (ret []*v1.Namespace, err error)

ListResources is a wrapper to List and adds the resource kind information as the lister is specific to a gvk we can harcode the values here

type NamespaceListerExpansion

type NamespaceListerExpansion interface {
	v1CoreLister.NamespaceLister
	// List lists all Namespaces in the indexer.
	ListResources(selector labels.Selector) (ret []*v1.Namespace, err error)
	// GetsResource and injects gvk
	GetResource(name string) (*v1.Namespace, error)
}

NamespaceListerExpansion ...

func NewNamespaceLister

func NewNamespaceLister(nsLister v1CoreLister.NamespaceLister) NamespaceListerExpansion

NewNamespaceLister returns a new NamespaceLister

type ResourceManager

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

ResourceManager stores the details on already processed resources for caching

func NewResourceManager

func NewResourceManager(rebuildTime int64) *ResourceManager

NewResourceManager returns a new ResourceManager

func (*ResourceManager) Drop

func (rm *ResourceManager) Drop()

Drop drop the cache after every rebuild interval mins TODO: or drop based on the size

func (*ResourceManager) ProcessResource

func (rm *ResourceManager) ProcessResource(policy, pv, kind, ns, name, rv string) bool

ProcessResource returns true if the policy was not applied on the resource

func (*ResourceManager) RegisterResource

func (rm *ResourceManager) RegisterResource(policy, pv, kind, ns, name, rv string)

RegisterResource stores if the policy is processed on this resource version

Jump to

Keyboard shortcuts

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