Documentation
¶
Index ¶
- Constants
- Variables
- type Option
- type Publisher
- func (r *Publisher) Create(ctx context.Context, impl Referrer) (*v1beta1.Revision, error)
- func (r *Publisher) ElectRevision(ctx context.Context, impl Referrer) (*v1beta1.Revision, error)
- func (r *Publisher) Elected(ctx context.Context, impl Referrer) (*v1beta1.Revision, error)
- func (r *Publisher) Latest(ctx context.Context, impl Referrer) (*v1beta1.Revision, error)
- func (r *Publisher) List(ctx context.Context, impl Referrer) (*v1beta1.RevisionList, error)
- func (r *Publisher) SetLogger(logger logr.Logger)
- func (r *Publisher) SetScheme(scheme *runtime.Scheme)
- func (r *Publisher) TrimRevisions(ctx context.Context, impl Referrer) error
- type Referrer
Constants ¶
View Source
const (
ErrReferencedOptionNotFound = "the referenced option was not found in the template spec"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(p *Publisher)
func WithLogger ¶
func WithPatches ¶
func WithPatches(patches ...v1beta1.PodTemplateSpec) Option
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher creates snapshots of templates with optional overrides of patches to the template. The Publisher is based on two resources, the template, and the resource referencing the template.
func (*Publisher) Create ¶
Create a new publisher for the given Referrer. The publisher is only created if the template has changed since the last publisher.
func (*Publisher) ElectRevision ¶
ElectRevision sets a revision as the elected revision. The elected revision will either be the latest revision, or the revision that's already elected.
func (*Publisher) Elected ¶
Elected returns the elected publisher for the given Referrer. If there is no elected publisher, nil is returned.
type Referrer ¶
type Referrer interface {
// GetName returns the name of the resource
GetName() string
// GetNamespace returns the namespace of the resource
GetNamespace() string
// TemplateRef returns the name and namespace of the template
TemplateRef() types.NamespacedName
// HistoryLimit returns the number of revisions to keep around
// for this resource
HistoryLimit() int
// ResourceRequests returns the resource requests for this
// resource
ResourceRequests() corev1.ResourceList
// ElectedOptions returns the elected options for this resource
// if any. Elected options must exist in the template. If additional
// patches are required, they should be applied by webhook.
ElectedOptions() []corev1.LocalObjectReference
// UpdatePolicy returns the update policy for this resource. The UpdatePolicy
// can either be "Auto", or "Ignore".
UpdatePolicy() string
}
A Referrer is a resource that references a template
Click to show internal directories.
Click to hide internal directories.