s3object

package
v12.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func IsBucketNotFound

func IsBucketNotFound(err error) bool

IsBucketNotFound asserts object not found error from upstream's API message.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsKeyNotFound

func IsKeyNotFound(err error) bool

IsKeyNotFound asserts key not found error from upstream's API message.

func IsObjectNotFound

func IsObjectNotFound(err error) bool

IsObjectNotFound asserts object not found error from upstream's API message.

func IsWrongType

func IsWrongType(err error) bool

IsWrongType asserts wrongTypeError.

Types

type Config

type Config struct {
	CloudConfig cloudconfig.Interface
	Encrypter   encrypter.Interface
	Logger      micrologger.Logger
}

Config represents the configuration used to create a new cloudformation resource.

type Resource

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

Resource implements the CRUD resource interface of operatorkit to manage S3 objects containing rendered Cloud Config templates. The current implementation potentially causes some amount of S3 Traffic which might be neglectable from a customer costs point of view. In order to improve the implementation and its performance as well as produced costs we would need to refactor the resource and rewrite it basically completely using the simple resource interface only using EnsureCreated and EnsureDeleted. That way we could compute the E-Tag for the request to fetch the S3 Object and reduce traffic as we would not fetch the whole body of the object when it does effectively not change most of the time.

func New

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

New creates a new configured cloudformation resource.

func (*Resource) ApplyCreateChange

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

func (*Resource) ApplyDeleteChange

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

ApplyDeleteChange is a noop as deletion for now is covered with the deletion of the whole Tenant Cluster. That way all S3 Objects will vanish with the S3 Bucket. Note that we share the resource implementation to cover different Cloud Config objects, for instance for TCCP and TCNP stacks. These have different lifecycles which means we do not delete Cloud Config objects of a deleted Node Pool. Another very rare but noteworthy side effect might be that Node Pool IDs generated twice during the lifetime of a Tenant Cluster cause existing Cloud Config objects to be overwritten with newer versions, potentially causing confusion and inconsistencies upon inspection. Chances are you win the lotto before this bullshit ever happens, but one should understand current design decisions.

func (*Resource) ApplyUpdateChange

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

func (*Resource) GetCurrentState

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

func (*Resource) GetDesiredState

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

func (*Resource) Name

func (r *Resource) Name() string

func (*Resource) NewDeletePatch

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

NewDeletePatch is a noop like ApplyDeleteChange. See the godoc there.

func (*Resource) NewUpdatePatch

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

Jump to

Keyboard shortcuts

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