devices

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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

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

func Candidates(lab, device string) []string

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

func LegacyName(lab, device string) string

LegacyName is the name devices had before the hash.

func Name

func Name(lab, device string) string

Name is the object name of the device of a lab: readable stems of both names and a hash of the exact pair. Lab and device names are DNS labels, which never contain "/", so two pairs never hash the same input.

Types

This section is empty.

Jump to

Keyboard shortcuts

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