Documentation
¶
Overview ¶
Package devices names and finds the Device objects of a lab.
A Device used to be called "<lab>-<device>", which two different pairs can spell the same way (lab "a-b" with device "c", lab "a" with device "b-c"): one lab then adopted, or deleted the env Secret of, the other's device. New devices are named "<lab>-<device>-<hash>" where the hash is over the pair with a separator no name can contain, so the name tells the pair apart. A Device that exists under the old name keeps it (renaming would recreate its pod), but it is accepted for a pair only when its spec says it belongs to that pair.
Index ¶
- func Belongs(d *laboratoryv1alpha1.Device, lab, device string) bool
- func Candidates(lab, device string) []string
- func Get(ctx context.Context, r client.Reader, namespace, lab, device string) (*laboratoryv1alpha1.Device, error)
- func LegacyName(lab, device string) string
- func Name(lab, device string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Belongs ¶
func Belongs(d *laboratoryv1alpha1.Device, lab, device string) bool
Belongs says whether a Device is the device of the pair, by what its spec says and not by its name.
func Candidates ¶
Candidates are the object names a device of the pair may have, the current one first.
func Get ¶
func Get(ctx context.Context, r client.Reader, namespace, lab, device string) (*laboratoryv1alpha1.Device, error)
Get finds the Device of a lab: under the current name, else under the old one when that object is this pair's. A NotFound error means the device does not exist.
func LegacyName ¶
LegacyName is the name devices had before the hash.
Types ¶
This section is empty.