k8s

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ReplicateKey string = "replicator.v1.mittwald.de/replicate-from"

Variables

View Source
var (
	PodsResource            = k8s_core_api.SchemeGroupVersion.WithResource("pods")
	PodsKind                = k8s_core_api.SchemeGroupVersion.WithKind("Pod")
	NamespacesResource      = k8s_core_api.SchemeGroupVersion.WithResource("namespaces")
	NamespacesKind          = k8s_core_api.SchemeGroupVersion.WithKind("Namespace")
	ServiceaccountsResource = k8s_core_api.SchemeGroupVersion.WithResource("serviceaccounts")
	ServiceaccountsKind     = k8s_core_api.SchemeGroupVersion.WithKind("Serviceaccount")

	NoProfile = errors.New("no profile")
)
View Source
var (
	SecretsResource = core_api.SchemeGroupVersion.WithResource("secrets")
)

Functions

This section is empty.

Types

type DefaultMetaSupplier

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

Interface for interacting with kube resources

func (*DefaultMetaSupplier) Get

func (*DefaultMetaSupplier) Write

func (supplier *DefaultMetaSupplier) Write(meta *k8s_meta_api.ObjectMeta)

type Interface

type Interface struct {
	manager.Manager
	Outer
	*DefaultMetaSupplier
}

Interface for interacting with kube resources

func NewInterface

func NewInterface(mgr manager.Manager) *Interface

func (*Interface) GetNamespace

func (k8s *Interface) GetNamespace(name string) (*k8s_core_api.Namespace, error)

func (*Interface) GetServiceAccount

func (k8s *Interface) GetServiceAccount(name string, namespace string) (*k8s_core_api.ServiceAccount, error)

func (*Interface) ResolveProfile

func (s *Interface) ResolveProfile(namespace string, meta k8s_meta_api.ObjectMeta, collector ProfileCollector) (ProfileGetter, error)

func (*Interface) ResolveProfiles

func (k8s *Interface) ResolveProfiles(namespace string, resource k8s_meta_api.ObjectMeta, collector *ProfileCollector) error

type Outer added in v0.0.2

type Outer interface{}

Interface for interacting with kube resources

type ProfileCollector

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

func NewProfileCollector

func NewProfileCollector(supplier ProfileSupplier) ProfileCollector

func (ProfileCollector) Profiles

func (collector ProfileCollector) Profiles() []ProfileGetter

type ProfileGetter

type ProfileGetter interface {
	GetName() string
	GetSelector() policy_meta_api.ObjectSelector
}

type ProfileSupplier

type ProfileSupplier interface {
	Get(name string) (ProfileGetter, error)
	Key() string
}

type Replicator

type Replicator struct {
	dynamic.Interface
}

func (*Replicator) CreateReplicatedSecret

func (f *Replicator) CreateReplicatedSecret(secret *core_api.Secret, namespace string, name string) (*core_api.Secret, error)

func (*Replicator) UpdateReplicatedSecret

func (f *Replicator) UpdateReplicatedSecret(secret *core_api.Secret, namespace string, name string) (*core_api.Secret, error)

Jump to

Keyboard shortcuts

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