Documentation ¶
Index ¶
- Constants
- func IsBucketNotFound(err error) bool
- func IsInvalidConfig(err error) bool
- func IsKeyNotFound(err error) bool
- func IsObjectNotFound(err error) bool
- func IsWrongType(err error) bool
- type Config
- type Resource
- func (r *Resource) ApplyCreateChange(ctx context.Context, obj, createChange interface{}) error
- func (r *Resource) ApplyDeleteChange(ctx context.Context, obj, deleteChange interface{}) error
- func (r *Resource) ApplyUpdateChange(ctx context.Context, obj, updateChange interface{}) error
- func (r *Resource) GetCurrentState(ctx context.Context, obj interface{}) (interface{}, error)
- func (r *Resource) GetDesiredState(ctx context.Context, obj interface{}) (interface{}, error)
- func (r *Resource) Name() string
- func (r *Resource) NewDeletePatch(ctx context.Context, obj, currentState, desiredState interface{}) (*crud.Patch, error)
- func (r *Resource) NewUpdatePatch(ctx context.Context, obj, currentState, desiredState interface{}) (*crud.Patch, error)
Constants ¶
const (
// Name is the identifier of the resource.
Name = "s3object"
)
Variables ¶
This section is empty.
Functions ¶
func IsBucketNotFound ¶
IsBucketNotFound asserts object not found error from upstream's API message.
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
func IsKeyNotFound ¶
IsKeyNotFound asserts key not found error from upstream's API message.
func IsObjectNotFound ¶
IsObjectNotFound asserts object not found error from upstream's API message.
Types ¶
type Config ¶
type Config struct { CertsSearcher certs.Interface CloudConfig cloudconfig.Interface G8sClient versioned.Interface LabelsFunc func(key.LabelsGetter) string Logger micrologger.Logger PathFunc func(key.LabelsGetter) string RandomKeysSearcher randomkeys.Interface }
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 (*Resource) ApplyCreateChange ¶
func (*Resource) ApplyDeleteChange ¶
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 generate twice during the lifetime of a Tenant Cluster cause existing Cloud Config objects to be overwritten with newer versions, potentially causing confusion and inconsisencies upon inspection. Chances are you win the lotto before this bullshit ever happens, but one should understand current design decisions.