encryptionkey

package
v0.23.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AESCBCKeyLength represent the 32bytes length for AES-CBC with PKCS#7
	// padding encryption key.
	AESCBCKeyLength = 32
)
View Source
const (
	// Name is the identifier of the resource.
	Name = "encryptionkey"
)

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsWrongTypeError

func IsWrongTypeError(err error) bool

IsWrongTypeError asserts wrongTypeError.

Types

type Config

type Config struct {
	K8sClient                kubernetes.Interface
	Logger                   micrologger.Logger
	ToClusterGuestConfigFunc func(obj interface{}) (v1alpha1.ClusterGuestConfig, error)
	ToClusterObjectMetaFunc  func(obj interface{}) (apismetav1.ObjectMeta, error)
}

Config represents the configuration used to create a new cloud config resource.

type Resource

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

Resource implements the cloud config resource.

func New

func New(config Config) (*Resource, error)

New creates a new configured cloud config resource.

func (*Resource) ApplyCreateChange

func (r *Resource) ApplyCreateChange(ctx context.Context, obj, createChange interface{}) error

ApplyCreateChange takes observed custom object and create portion of the Patch provided by NewUpdatePatch or NewDeletePatch. It creates k8s secret for encryption key if needed.

func (*Resource) ApplyDeleteChange

func (r *Resource) ApplyDeleteChange(ctx context.Context, obj, deleteChange interface{}) error

ApplyDeleteChange takes observed custom object and delete portion of the Patch provided by NewUpdatePatch and NewDeletePatch. It deletes k8s secret for related encryption key if needed.

func (*Resource) ApplyUpdateChange

func (r *Resource) ApplyUpdateChange(ctx context.Context, obj, updateChange interface{}) error

ApplyUpdateChange takes observed custom object and update portion of the Patch provided by NewUpdatePatch or NewDeletePatch. This is currently a NOP for encryptionkey Resource.

func (*Resource) GetCurrentState

func (r *Resource) GetCurrentState(ctx context.Context, obj interface{}) (interface{}, error)

GetCurrentState takes observed custom object as an input and based on that information looks for current state of cluster encryption key secret and returns it. Return value is of type *v1.Secret.

func (*Resource) GetDesiredState

func (r *Resource) GetDesiredState(ctx context.Context, obj interface{}) (interface{}, error)

GetDesiredState takes observed (during create, delete and update events) custom object as an input and returns computed desired state for it.

func (*Resource) Name

func (r *Resource) Name() string

Name returns name of the Resource.

func (*Resource) NewDeletePatch

func (r *Resource) NewDeletePatch(ctx context.Context, obj, currentState, desiredState interface{}) (*crud.Patch, error)

NewDeletePatch is called upon observed custom object deletion. It receives the deleted custom object, the current state as provided by GetCurrentState and the desired state as provided by GetDesiredState. NewDeletePatch analyses the current and desired state and returns the patch to be applied by Create, Delete, and Update functions.

func (*Resource) NewUpdatePatch

func (r *Resource) NewUpdatePatch(ctx context.Context, obj, currentState, desiredState interface{}) (*crud.Patch, error)

NewUpdatePatch computes appropriate Patch based on difference in current state and desired state.

Jump to

Keyboard shortcuts

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