certconfig

package
v2.1.5+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Name is the identifier of the resource.
	Name = "certconfig"
)

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

func IsWrongType

func IsWrongType(err error) bool

IsWrongType asserts wrongTypeError.

Types

type Config

type Config struct {
	G8sClient versioned.Interface
	Logger    micrologger.Logger

	APIIP         string
	CertTTL       string
	ClusterDomain string
	Provider      string
}

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 CertConfig objects when new cluster certificates are needed.

func (*Resource) ApplyDeleteChange

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

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.

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 CertConfig CRs and returns them. Return value is of type []*v1alpha1.CertConfig.

func (*Resource) GetDesiredState

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

GetDesiredState returns all desired CertConfigs for managed certificates.

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, Update and Delete 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