registry

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

registry keeps a local version of all the managed secret states.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry keeps in memory all states of the managed secrets and their owned secrets.

  • A managed secret is a secret watched by the controller, which must be synced.
  • An owned secret is a secret created by the controller, which is a copy of a managed secret.

func New

func New() *Registry

New creates a new registry

func (*Registry) OwnedSecretsWithUID

func (r *Registry) OwnedSecretsWithUID(uid types.UID) []types.NamespacedName

Secrets returns all register owned secret's names.

func (*Registry) RegisterOwnedSecret

func (r *Registry) RegisterOwnedSecret(managerUID types.UID, name types.NamespacedName) error

RegisterOwnedSecret adds a new owned secret to the registry.

func (*Registry) RegisterSecret

func (r *Registry) RegisterSecret(name types.NamespacedName, uid types.UID) error

RegisterSecret adds a new secret to the registry.

func (*Registry) SecretWithName

func (r *Registry) SecretWithName(name types.NamespacedName) *Secret

SecretWithName returns a registered secret with the given name, or nil if doesn't exists.

func (*Registry) SecretWithOwnedSecretName

func (r *Registry) SecretWithOwnedSecretName(ownedSecretName types.NamespacedName) *Secret

SecretWithName returns a registered secret with the given NamespacedName, or nil if doesn't exists.

func (*Registry) SecretWithUID

func (r *Registry) SecretWithUID(uid types.UID) *Secret

SecretWithUID returns a registered secret with the given UID, or nil if doesn't exists.

func (*Registry) Secrets

func (r *Registry) Secrets() []types.NamespacedName

Secrets returns all register secret's names.

func (*Registry) UnregisterOwnedSecret

func (r *Registry) UnregisterOwnedSecret(name types.NamespacedName) error

UnregisterOwnedSecret removes an owned secret to the registry.

func (*Registry) UnregisterSecret

func (r *Registry) UnregisterSecret(uid types.UID) error

UnregisterSecret removes a secret from the registry.

type Secret

type Secret struct {
	types.NamespacedName
	types.UID
}

type SecretNameAlreadyExistsErr

type SecretNameAlreadyExistsErr string

func (SecretNameAlreadyExistsErr) Error

type SecretNotFoundErr

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

func (SecretNotFoundErr) Error

func (e SecretNotFoundErr) Error() string

Jump to

Keyboard shortcuts

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