Documentation
¶
Overview ¶
Package build provides domain-specific, field-level caching for Build resources. BuildCache embeds cache.ObjectCache and adds typed Set* / Get* helpers for each resolved spec field (image, source, strategy, serviceAccount, policy), plus PublishResolved, which projects a *buildResolution.ResolvedBuild into those fields in one best-effort call after resolution succeeds.
Index ¶
- type BuildCache
- func (b *BuildCache) GetImage(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)
- func (b *BuildCache) GetPolicy(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)
- func (b *BuildCache) GetServiceAccount(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)
- func (b *BuildCache) GetSource(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)
- func (b *BuildCache) GetStrategy(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)
- func (b *BuildCache) PublishResolved(ctx context.Context, nn types.NamespacedName, gen int64, ...) error
- func (b *BuildCache) SetImage(ctx context.Context, nn types.NamespacedName, gen int64, image string) error
- func (b *BuildCache) SetPolicy(ctx context.Context, nn types.NamespacedName, gen int64, policy any) error
- func (b *BuildCache) SetServiceAccount(ctx context.Context, nn types.NamespacedName, gen int64, sa any) error
- func (b *BuildCache) SetSource(ctx context.Context, nn types.NamespacedName, gen int64, source any) error
- func (b *BuildCache) SetStrategy(ctx context.Context, nn types.NamespacedName, gen int64, strategy any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildCache ¶
type BuildCache struct {
*bocache.ObjectCache
}
BuildCache provides domain-specific, field-level caching for Build resources.
func NewBuildCache ¶
func NewBuildCache(c *cache.Cache) *BuildCache
NewBuildCache constructs a new BuildCache with the provided cache.Cache.
func (*BuildCache) GetImage ¶
func (b *BuildCache) GetImage(ctx context.Context, nn types.NamespacedName, gen int64) (string, bool, error)
func (*BuildCache) GetPolicy ¶
func (b *BuildCache) GetPolicy(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)
func (*BuildCache) GetServiceAccount ¶
func (b *BuildCache) GetServiceAccount(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)
func (*BuildCache) GetSource ¶
func (b *BuildCache) GetSource(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)
func (*BuildCache) GetStrategy ¶
func (b *BuildCache) GetStrategy(ctx context.Context, nn types.NamespacedName, gen int64, into any) (bool, error)
func (*BuildCache) PublishResolved ¶
func (b *BuildCache) PublishResolved(ctx context.Context, nn types.NamespacedName, gen int64, r *buildResolution.ResolvedBuild) error
PublishResolved writes the resolved contract as a generation-scoped, field-level projection. All writes are best-effort: failures cost queryability, never correctness. Returns the first error encountered for optional logging; callers should not fail reconciliation on it.
func (*BuildCache) SetImage ¶
func (b *BuildCache) SetImage(ctx context.Context, nn types.NamespacedName, gen int64, image string) error
func (*BuildCache) SetPolicy ¶
func (b *BuildCache) SetPolicy(ctx context.Context, nn types.NamespacedName, gen int64, policy any) error
func (*BuildCache) SetServiceAccount ¶
func (b *BuildCache) SetServiceAccount(ctx context.Context, nn types.NamespacedName, gen int64, sa any) error
func (*BuildCache) SetSource ¶
func (b *BuildCache) SetSource(ctx context.Context, nn types.NamespacedName, gen int64, source any) error
func (*BuildCache) SetStrategy ¶
func (b *BuildCache) SetStrategy(ctx context.Context, nn types.NamespacedName, gen int64, strategy any) error