query

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package query holds the cross-CR lookups a ServiceUnit needs.

A ServiceUnit of type BUILD does not name an image. It names a Build, and runs whatever that Build last pushed. Resolution is pure and cannot read another object, so the image is looked up here, after resolution and before the resolved ServiceUnit is used.

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildInOtherNamespace = errors.New("build is in another namespace")

ErrBuildInOtherNamespace reports a ServiceUnit that names a Build outside its own namespace. The image is pulled with the Build's registry secret, and a workload can only use a secret in its own namespace.

Functions

func BuildImage

func BuildImage(build *environmentsv1alpha1.Build) (string, error)

BuildImage returns the image the Build last pushed, pinned to its digest, as the Build's status records it. It is empty, with no error, for a Build that has not pushed an image yet.

func BuildKey

BuildKey is the Build a resolved ServiceUnit takes its image from. The Build is looked for in the ServiceUnit's namespace unless the reference names another. ok is false for a ServiceUnit that is not of type BUILD.

func BuildPullSecret

func BuildPullSecret(build *environmentsv1alpha1.Build) (string, error)

BuildPullSecret returns the name of the registry secret the Build declares for its image (serviceAccount.secret). It is empty, with no error, for a Build that declares none.

func InjectBuildImage

InjectBuildImage sets, on a resolved ServiceUnit of type BUILD, the image its Build last pushed and the registry secret that Build declared for it. Any other type is left as it is.

The Build has already set up access to its image, so the ServiceUnit does not declare credentials of its own and nothing is copied: the secret is referenced by name. That is why the Build must be in the ServiceUnit's namespace; one that is not is ErrBuildInOtherNamespace.

The image stays empty, with no error, while the Build has not pushed one: the ServiceUnit is then waiting for its Build, which is not a failure. A Build that cannot be read is an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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