...

Package v2

import "edge-infra.dev/pkg/sds/display/k8s/apis/v2"
Overview
Index

Overview ▾

+kubebuilder:object:generate=true +groupName=display.edge.ncr.com

Index ▾

Constants
Variables
type AppliedStatus
    func (in *AppliedStatus) DeepCopy() *AppliedStatus
    func (in *AppliedStatus) DeepCopyInto(out *AppliedStatus)
type DPMS
    func (in *DPMS) DeepCopy() *DPMS
    func (in *DPMS) DeepCopyInto(out *DPMS)
    func (a *DPMS) Merge(b *DPMS) (*DPMS, error)
type DefaultConfig
    func (in *DefaultConfig) DeepCopy() *DefaultConfig
    func (in *DefaultConfig) DeepCopyInto(out *DefaultConfig)
type Display
    func (in *Display) DeepCopy() *Display
    func (in *Display) DeepCopyInto(out *Display)
    func (display *Display) IsPrimary() bool
    func (a *Display) Merge(b Display) (*Display, error)
    func (display *Display) SetPrimary(primary bool)
type DisplayConfig
    func DisplayConfigFromV1(src *v1.DisplayConfig, displayConfig *DisplayConfig) (result *DisplayConfig, disconnectedIDs map[DisplayPort]MPID)
    func (in *DisplayConfig) DeepCopy() *DisplayConfig
    func (in *DisplayConfig) DeepCopyInto(out *DisplayConfig)
    func (displayConfig *DisplayConfig) DisplayPorts() []DisplayPort
    func (a *DisplayConfig) GenerateDefaultDisplayConfig(defaults DefaultConfig, inputDevices []InputDeviceName) (*DisplayConfig, error)
    func (displayConfig *DisplayConfig) HasDisconnected() bool
    func (displayConfig *DisplayConfig) HasV1() bool
    func (a *DisplayConfig) Merge(b *DisplayConfig) (*DisplayConfig, error)
    func (displayConfig *DisplayConfig) Validate() error
type DisplayPort
    func NewDisplayPort(card, port string) DisplayPort
    func (dp DisplayPort) IsConnected() bool
    func (dp *DisplayPort) String() string
type Displays
    func (in Displays) DeepCopy() Displays
    func (in Displays) DeepCopyInto(out *Displays)
    func (displays Displays) DisplayPorts() []DisplayPort
    func (displays Displays) FindByDisplayPort(dp DisplayPort) *Display
    func (displays Displays) FindByMPID(mpid MPID) *Display
    func (displays Displays) FindPrimary() *Display
    func (a Displays) Merge(b Displays) (Displays, error)
    func (displays *Displays) UpdateDisplay(display Display)
type InputDeviceName
    func (name *InputDeviceName) String() string
type KnownDisplayDefaults
    func (in *KnownDisplayDefaults) DeepCopy() *KnownDisplayDefaults
    func (in *KnownDisplayDefaults) DeepCopyInto(out *KnownDisplayDefaults)
type Layout
    func (in Layout) DeepCopy() Layout
    func (in Layout) DeepCopyInto(out *Layout)
    func (a Layout) Merge(b Layout) Layout
type MPID
    func NewMPID(manufacturer string, productCode uint) MPID
    func (mpid *MPID) String() string
type NodeDisplayConfig
    func (nodeDisplayConfig *NodeDisplayConfig) AppliedDisplayConfig() *DisplayConfig
    func (dst *NodeDisplayConfig) ConvertFrom(src conversion.Hub) error
    func (src *NodeDisplayConfig) ConvertTo(dst conversion.Hub) error
    func (in *NodeDisplayConfig) DeepCopy() *NodeDisplayConfig
    func (in *NodeDisplayConfig) DeepCopyInto(out *NodeDisplayConfig)
    func (in *NodeDisplayConfig) DeepCopyObject() runtime.Object
    func (nodeDisplayConfig *NodeDisplayConfig) DisconnectedDisplayIDs() map[DisplayPort]MPID
    func (nodeDisplayConfig *NodeDisplayConfig) GetConditions() []metav1.Condition
    func (nodeDisplayConfig *NodeDisplayConfig) LastConfiguredTime() (time.Time, error)
    func (nodeDisplayConfig *NodeDisplayConfig) ResetStatus()
    func (nodeDisplayConfig *NodeDisplayConfig) SetAppliedConfigStatuses(displayConfig *DisplayConfig)
    func (nodeDisplayConfig *NodeDisplayConfig) SetConditions(conditions []metav1.Condition)
    func (nodeDisplayConfig *NodeDisplayConfig) SetDefaultCondition()
    func (nodeDisplayConfig *NodeDisplayConfig) SetDisplayManagerConfigCondition(configName string)
    func (nodeDisplayConfig *NodeDisplayConfig) SetDisplayManagerConfiguredCondition(ready bool, reason, message string)
    func (nodeDisplayConfig *NodeDisplayConfig) SetDisplayctlEnabledCondition(enabled bool)
    func (nodeDisplayConfig *NodeDisplayConfig) SetupWebhookWithManager(mgr ctrl.Manager) error
    func (nodeDisplayConfig *NodeDisplayConfig) ValidateCreate() (admission.Warnings, error)
    func (*NodeDisplayConfig) ValidateDelete() (admission.Warnings, error)
    func (nodeDisplayConfig *NodeDisplayConfig) ValidateUpdate(runtime.Object) (admission.Warnings, error)
type NodeDisplayConfigList
    func (in *NodeDisplayConfigList) DeepCopy() *NodeDisplayConfigList
    func (in *NodeDisplayConfigList) DeepCopyInto(out *NodeDisplayConfigList)
    func (in *NodeDisplayConfigList) DeepCopyObject() runtime.Object
type NodeDisplayConfigStatus
    func (in *NodeDisplayConfigStatus) DeepCopy() *NodeDisplayConfigStatus
    func (in *NodeDisplayConfigStatus) DeepCopyInto(out *NodeDisplayConfigStatus)
type Orientation
    func (o *Orientation) String() string
type Primary
type Resolution
    func (in *Resolution) DeepCopy() *Resolution
    func (in *Resolution) DeepCopyInto(out *Resolution)
    func (res *Resolution) String() string
type UpgradeStatus
    func (in *UpgradeStatus) DeepCopy() *UpgradeStatus
    func (in *UpgradeStatus) DeepCopyInto(out *UpgradeStatus)

Package files

defaults.go displayconfig.go displayconfig_convert.go displayconfig_merge.go displayconfig_merge_transformers.go displayconfig_validate.go groupversion_info.go nodedisplayconfig_types.go nodedisplayconfig_webhook.go zz_generated.deepcopy.go

Constants

const (
    // A display's card where the card could not be found.
    UnknownCard = "unknown"
    // A display which was disconnected during the V1 to V2 upgrade.
    DisconnectedPort = "disconnected"
)
const (
    Name                  = "display"
    Group                 = "display.edge.ncr.com"
    NodeDisplayConfigKind = "NodeDisplayConfig"
)
const (
    DisplayManagerRestartedAtAnnotation = "display.edge.ncr.com/display-manager-restarted-at"
    DevicesUpdatedAtAnnotation          = "display.edge.ncr.com/devices-updated-at"

    // Whether the display manager has been configured successfully.
    DisplayManagerConfiguredCondition = "DisplayManagerConfigured"
    // Whether the NodeDisplayConfig has default or custom configuration.
    DefaultCondition = "Default"
    // Whether displayctl is enabled for the node. When disabled no
    // configuration will be done by displayctl, leaving the display
    // manager to be configured by the xserver-config ConfigMap.
    DisplayctlEnabledCondition = "DisplayctlEnabled"
    // Whether there exists additional display manager config for the
    // node, e.g. in xserver-config ConfigMap.
    DisplayManagerConfigCondition = "DisplayManagerConfig"

    ReconcilingStatus          = "Reconciling"
    UpToDateStatus             = "UpToDate"
    FailedStatus               = "Failed"
    UpgradingStatus            = "Upgrading"
    DisabledStatus             = "Disabled"
    DefaultConfigurationStatus = "DefaultConfiguration"
    CustomConfigurationStatus  = "CustomConfiguration"
    DisplayctlEnabledStatus    = "DisplayctlEnbled"
    DisplayctlDisabledStatus   = "DisplayctlDisabled"
    ConfigExistsStatus         = "ConfigExists"
    ConfigDoesNotExistStatus   = "ConfigDoesNotExist"
)

Variables

var (
    // GroupVersion is group version used to register these objects
    GroupVersion = schema.GroupVersion{Group: Group, Version: "v2"}

    // SchemeBuilder is used to add go types to the GroupVersionKind scheme
    SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

    // AddToScheme adds the types in this group-version to the given scheme.
    AddToScheme = SchemeBuilder.AddToScheme

    // GroupVersionKind for the NodeDisplayConfig type
    NodeDisplayConfigGVK = schema.GroupVersionKind{
        Group:   GroupVersion.Group,
        Version: GroupVersion.Version,
        Kind:    NodeDisplayConfigKind,
    }
)

The default display configuration:

var Defaults = DefaultConfig{
    Display: Display{
        Orientation: &NormalOrientation,
    },
    KnownDisplays: map[MPID]KnownDisplayDefaults{
        "ACR-2199": {

            InputDevicePatterns: []string{
                "Weida Hi-Tech\\s+CoolTouchR System\\s+.*",
            },
        },
        "ELO-4098": {

            InputDevicePatterns: []string{
                "Elo Touch Solutions Elo Touch Solutions Pcap USB Interface",
            },
        },
        "ELO-5705": {

            InputDevicePatterns: []string{
                "Atmel Atmel maXTouch Digitizer",
                "Elo TouchSystems, Inc\\. Elo TouchSystems 2700.*",
            },
        },
        "ELO-5911": {

            InputDevicePatterns: []string{
                "Elo TouchSystems, Inc\\. Elo TouchSystems 2700.*",
            },
        },
        "ELO-8816": {

            InputDevicePatterns: []string{
                "Elo Touch\\s+2270L pCAP HID\\s+.*",
            },
        },
        "NCR-22800": {

            InputDevicePatterns: []string{
                "eGalax Inc\\. eGalaxTouch EXC[A-Z0-9]{4}-.*",
            },
        },
        "NCR-22805": {

            InputDevicePatterns: []string{
                "eGalax Inc\\. eGalaxTouch EXC[A-Z0-9]{4}-.*",
            },
        },
        "NCR-22888": {

            InputDevicePatterns: []string{
                "eGalax Inc\\. eGalaxTouch EXC[A-Z0-9]{4}-.*",
                "Advanced Silicon S\\.A\\. CoolTouch® System",
            },
        },
        "NCR-22917": {

            InputDevicePatterns: []string{
                "eGalax Inc\\. eGalaxTouch EXC[A-Z0-9]{4}-.*",
            },
        },

        "NCR-30578": {

            InputDevicePatterns: []string{
                "eGalax Inc\\. eGalaxTouch P8[A-Z0-9]{4} [A-Z0-9]{4}.*",
            },
        },
        "TGC-18464": {

            InputDevicePatterns: []string{
                "Elo TouchSystems Inc\\. Elo TouchSystems CarrollTouch.*",
            },
        },
        "VSC-23866": {

            InputDevicePatterns: []string{
                "iSolution multitouch.*",
            },
        },
        "WNX-22": {

            InputDevicePatterns: []string{
                "Beijing IRTOUCH SYSTEMS Co\\.,LtD IRTOUCH InfraRed TouchScreen.*",
            },
        },
        "WNX-30022": {

            InputDevicePatterns: []string{
                "eGalax Inc\\. eGalaxTouch P8[A-Z0-9]{4} [A-Z0-9]{4}.*",
            },
        },
        "WNX-30028": {

            InputDevicePatterns: []string{
                "eGalax Inc\\. eGalaxTouch P8[A-Z0-9]{4} [A-Z0-9]{4}.*",
            },
        },
        "WNX-32": {

            InputDevicePatterns: []string{
                "Beijing IRTOUCH SYSTEMS Co\\.,LtD IRTOUCH InfraRed TouchScreen.*",
            },
        },
    },
    DPMS: &DPMS{
        Enabled:     &dpmsDisabled,
        BlankTime:   &zeroSeconds,
        StandbyTime: &zeroSeconds,
        SuspendTime: &zeroSeconds,
        OffTime:     &zeroSeconds,
    },
}

type AppliedStatus

type AppliedStatus struct {
    // The DisplayConfig configuration that was applied to the node.
    DisplayConfig *DisplayConfig `json:"displayConfig,omitempty"`
    // The output identifiers of the displays configured on the node.
    Displays []DisplayPort `json:"displays,omitempty"`
    // The generation of the object that was last applied to the node.
    Generation int64 `json:"lastAppliedGeneration,omitempty"`
    // Timestamp when configuration was last applied to the node.
    LastAppliedTimestamp metav1.Time `json:"lastAppliedTimestamp,omitempty"`
}

func (*AppliedStatus) DeepCopy

func (in *AppliedStatus) DeepCopy() *AppliedStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppliedStatus.

func (*AppliedStatus) DeepCopyInto

func (in *AppliedStatus) DeepCopyInto(out *AppliedStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DPMS

DPMS describes the DPMS configuration for a display.

type DPMS struct {
    // Enabled indicates whether DPMS is enabled for the node.
    Enabled *bool `json:"enabled,omitempty"`
    // +kubebuilder:validation:Minimum=0
    //
    // BlankTime configures the number of seconds of inactivity
    // before reaching the blank phase of the screen saver.
    BlankTime *int `json:"blankTime,omitempty"`
    // +kubebuilder:validation:Minimum=0
    //
    // StandbyTime configures the number of seconds of inactivity
    // before reaching the standby phase of the DPMS mode.
    StandbyTime *int `json:"standybyTime,omitempty"`
    // +kubebuilder:validation:Minimum=0
    //
    // SuspendTime configures the number of seconds of inactivity
    // before reaching the suspend phase of the DPMS mode.
    SuspendTime *int `json:"suspendTime,omitempty"`
    // +kubebuilder:validation:Minimum=0
    //
    // OffTime configures the number of seconds of inactivity
    // before reaching the off phase of the DPMS mode.
    OffTime *int `json:"offTime,omitempty"`
}

func (*DPMS) DeepCopy

func (in *DPMS) DeepCopy() *DPMS

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DPMS.

func (*DPMS) DeepCopyInto

func (in *DPMS) DeepCopyInto(out *DPMS)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DPMS) Merge

func (a *DPMS) Merge(b *DPMS) (*DPMS, error)

type DefaultConfig

Configures the default display configuration to be passed into displayConfig.GenerateDefaultDisplayConfig(DefaultConfig,inputDevices).

type DefaultConfig struct {
    // The default display configuration that will be applied
    // to each display.
    Display Display
    // Mapping of pre-defined display configurations for displays
    // we know need additional configuration. Most often this
    // consists of known input device mappings.
    KnownDisplays map[MPID]KnownDisplayDefaults
    // The default DPMS configuration.
    DPMS *DPMS
}

func (*DefaultConfig) DeepCopy

func (in *DefaultConfig) DeepCopy() *DefaultConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultConfig.

func (*DefaultConfig) DeepCopyInto

func (in *DefaultConfig) DeepCopyInto(out *DefaultConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Display

Display configures a display's monitor and input devices.

type Display struct {
    // DisplayPort is the display card and physical port the
    // display is connected to, e.g. card0-DP1, card1-HDMI2 etc.
    //
    // This field is NOT optional.
    DisplayPort `json:"displayPort"`
    // Manufacturer and Product-Code ID, a unique identifier
    // for the display, i.e. "<manufacturer-ID>-<product-code>".
    //
    // It is NOT valid to configure this field in the
    // NodeDisplayConfig spec.
    *MPID `json:"mpid,omitempty"`
    // Primary indicates whether this is the primary display.
    *Primary `json:"primary,omitempty"`
    // Orientation of the display, e.g "left" or "inverted".
    Orientation *Orientation `json:"orientation,omitempty"`
    // Resolution is the current resolution of the display.
    *Resolution `json:"resolution,omitempty"`
    // SupportedResolutions are the valid resolutions the
    // display can be configured to use.
    //
    // It is NOT valid to configure this field in the
    // NodeDisplayConfig spec. The resolution of the display
    // can be configured via the Resolution field.
    SupportedResolutions []Resolution `json:"supportedResolutions,omitempty"`
    // InputDeviceMappings are the devices the display maps to.
    InputDeviceMappings []InputDeviceName `json:"inputDeviceMappings,omitempty"`
}

func (*Display) DeepCopy

func (in *Display) DeepCopy() *Display

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Display.

func (*Display) DeepCopyInto

func (in *Display) DeepCopyInto(out *Display)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Display) IsPrimary

func (display *Display) IsPrimary() bool

func (*Display) Merge

func (a *Display) Merge(b Display) (*Display, error)

Merge Display B into Display A and return a new copy.

When a value is present in B set it in A, otherwise use the value from A.

Input device mappings in b will always replace the mappings in a if the mappings in B are not empty, i.e. mappings in B are not appended to those in A.

func (*Display) SetPrimary

func (display *Display) SetPrimary(primary bool)

type DisplayConfig

DisplayConfig defines the configuration for displays.

type DisplayConfig struct {
    // Maps monitor display-ports to display configurations.
    Displays Displays `json:"displays,omitempty"`
    // DPMS configuration
    DPMS *DPMS `json:"dpms,omitempty"`
    // Layout of the displays as slice, ordered left to right.
    Layout Layout `json:"layout,omitempty"`

    // The V1 spec following conversion from V1 to V2 by the
    // conversion webhook. This will be used by displayctl to
    // upgrade the spec to V2.
    //
    // This must only be set during conversion from V1 to V2
    // and cannot be set after the upgrade is complete.
    V1 *v1.DisplayConfig `json:"v1-displayConfig,omitempty"`
}

func DisplayConfigFromV1

func DisplayConfigFromV1(src *v1.DisplayConfig, displayConfig *DisplayConfig) (result *DisplayConfig, disconnectedIDs map[DisplayPort]MPID)

Converts a V1 DisplayConfig to V2.

As the identifier for displays moves from MPID to DisplayPort, the conversion requires the current display configuration read from the node. Using this we can tell which port displays identified by MPID are connected to.

For displays which have been specified in the V1 display config, but are not connected at the time of the conversion, their DisplayPort will be marked as disconnected. A map of disconnected DisplayPorts to MPIDs will also be returned, so they can later be converted later on if the display is reconnected.

func (*DisplayConfig) DeepCopy

func (in *DisplayConfig) DeepCopy() *DisplayConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisplayConfig.

func (*DisplayConfig) DeepCopyInto

func (in *DisplayConfig) DeepCopyInto(out *DisplayConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DisplayConfig) DisplayPorts

func (displayConfig *DisplayConfig) DisplayPorts() []DisplayPort

The set of display-ports from both the displays and layout fields.

func (*DisplayConfig) GenerateDefaultDisplayConfig

func (a *DisplayConfig) GenerateDefaultDisplayConfig(defaults DefaultConfig, inputDevices []InputDeviceName) (*DisplayConfig, error)

Applies the default configuration to the display config.

Merges the default display with each of the displays in the display config.

For any display where a display with matching MPID exists in the default known displays, their configurations are merged together.

Sets the first display in the layout as the primary display. If there is no layout, the first display will be primary.

DPMS is overwritten with the default DPMS configuration.

func (*DisplayConfig) HasDisconnected

func (displayConfig *DisplayConfig) HasDisconnected() bool

Whether any of the displays were disconnected during V1 to V2 upgrade and still requrie display-port identification.

func (*DisplayConfig) HasV1

func (displayConfig *DisplayConfig) HasV1() bool

Whether there is V1 spec which is yet to be upgraded.

func (*DisplayConfig) Merge

func (a *DisplayConfig) Merge(b *DisplayConfig) (*DisplayConfig, error)

Merge B into A and return a new copy.

We assume A is a valid display configuration, i.e. details all displays that are present on the node, and only apply configuration from B when it matches displays in A.

When a display is present in both A and B, the displays will be merged in the result - see Display.Merge(Display) for more detail. If a display is present in A but not in B, it will be added to the result without changes. If a display is present in B, but not A it will not be added to the result.

The Layout from B will be merged into A. Only displays in B also present in A will be respected. See Layout.Merge(Layout) for more detail.

func (*DisplayConfig) Validate

func (displayConfig *DisplayConfig) Validate() error

Validates the DisplayConfig, checking:

type DisplayPort

+kubebuilder:validation:Pattern=`^(unknown|card\d)(-[A-Za-z0-9]+)+$`

DisplayPort is the display card and physical port the display is connected to, e.g. card0-DP1, card1-HDMI-A-2 etc.

If a card cannot be found for a display it will be marked unknown, e.g. unknown-DP2.

Displays that were disconnected during upgrade from V1 to V2 will be marked disconnected, e.g. unknown-disconnected-1.

type DisplayPort string

func NewDisplayPort

func NewDisplayPort(card, port string) DisplayPort

func (DisplayPort) IsConnected

func (dp DisplayPort) IsConnected() bool

Whether a display is connected.

A display can be disconnected if it was not present during the V1 to V2 upgrade.

func (*DisplayPort) String

func (dp *DisplayPort) String() string

type Displays

type Displays []Display

func (Displays) DeepCopy

func (in Displays) DeepCopy() Displays

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Displays.

func (Displays) DeepCopyInto

func (in Displays) DeepCopyInto(out *Displays)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Displays) DisplayPorts

func (displays Displays) DisplayPorts() []DisplayPort

Returns the displays display-ports.

func (Displays) FindByDisplayPort

func (displays Displays) FindByDisplayPort(dp DisplayPort) *Display

The display with given display-port (nil if not found).

func (Displays) FindByMPID

func (displays Displays) FindByMPID(mpid MPID) *Display

The display with given MPID (nil if not found).

func (Displays) FindPrimary

func (displays Displays) FindPrimary() *Display

The primary display.

func (Displays) Merge

func (a Displays) Merge(b Displays) (Displays, error)

func (*Displays) UpdateDisplay

func (displays *Displays) UpdateDisplay(display Display)

Updates the display with matching display-port. Adds a new display if it is not yet present.

type InputDeviceName

InputDeviceName is the name of an input device

type InputDeviceName string

func (*InputDeviceName) String

func (name *InputDeviceName) String() string

type KnownDisplayDefaults

type KnownDisplayDefaults struct {
    InputDevicePatterns []string
}

func (*KnownDisplayDefaults) DeepCopy

func (in *KnownDisplayDefaults) DeepCopy() *KnownDisplayDefaults

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KnownDisplayDefaults.

func (*KnownDisplayDefaults) DeepCopyInto

func (in *KnownDisplayDefaults) DeepCopyInto(out *KnownDisplayDefaults)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Layout

Layout describes the physical position of displays as their display-port's ordered left to right.

type Layout []DisplayPort

func (Layout) DeepCopy

func (in Layout) DeepCopy() Layout

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Layout.

func (Layout) DeepCopyInto

func (in Layout) DeepCopyInto(out *Layout)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Layout) Merge

func (a Layout) Merge(b Layout) Layout

Merge Layout B into Layout A and return a new copy.

For each display in B present in A, we append to the result respecting the order in B. For the remaining display in A not present in B, we append to the result respecting the order in A.

type MPID

+kubebuilder:validation:Pattern=`^[A-Z]{3}-\d{1,5}$`

Manufacturer and Product-Code ID, a unique identifier for the display, i.e. "<manufacturer-ID>-<product-code>".

type MPID string

func NewMPID

func NewMPID(manufacturer string, productCode uint) MPID

func (*MPID) String

func (mpid *MPID) String() string

type NodeDisplayConfig

A NodeDisplayConfig defines custom display configuration for a node, defined as a DisplayConfig. It's status details the DisplayConfig that was applied to the node by displayctl.

type NodeDisplayConfig struct {
    metav1.TypeMeta   `json:",inline"`
    metav1.ObjectMeta `json:"metadata,omitempty"`
    Spec              *DisplayConfig          `json:"spec,omitempty"`
    Status            NodeDisplayConfigStatus `json:"status,omitempty"`
}

func (*NodeDisplayConfig) AppliedDisplayConfig

func (nodeDisplayConfig *NodeDisplayConfig) AppliedDisplayConfig() *DisplayConfig

The DisplayConfig last applied to the node.

func (*NodeDisplayConfig) ConvertFrom

func (dst *NodeDisplayConfig) ConvertFrom(src conversion.Hub) error

Converts V1 to V2.

This simply copies the V1 spec into the V2 NodeDisplayConfig to be upgraded by displayctl later on.

func (*NodeDisplayConfig) ConvertTo

func (src *NodeDisplayConfig) ConvertTo(dst conversion.Hub) error

Converts V2 to V1.

V1 is deprecated and not in use. Conversion from V2 to V1 is unsupported and simply removes the spec from the object. As V2 is the stored version there is no data loss and the spec can always be retrieved via the V2 API.

func (*NodeDisplayConfig) DeepCopy

func (in *NodeDisplayConfig) DeepCopy() *NodeDisplayConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisplayConfig.

func (*NodeDisplayConfig) DeepCopyInto

func (in *NodeDisplayConfig) DeepCopyInto(out *NodeDisplayConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*NodeDisplayConfig) DeepCopyObject

func (in *NodeDisplayConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*NodeDisplayConfig) DisconnectedDisplayIDs

func (nodeDisplayConfig *NodeDisplayConfig) DisconnectedDisplayIDs() map[DisplayPort]MPID

MPIDs of displays that were disconnected during V1 to V2 upgrade. These IDs are retained so display-ports can be assigned to the displays once they are reconnected to the node.

func (*NodeDisplayConfig) GetConditions

func (nodeDisplayConfig *NodeDisplayConfig) GetConditions() []metav1.Condition

func (*NodeDisplayConfig) LastConfiguredTime

func (nodeDisplayConfig *NodeDisplayConfig) LastConfiguredTime() (time.Time, error)

The last time displayctl configured the displays.

func (*NodeDisplayConfig) ResetStatus

func (nodeDisplayConfig *NodeDisplayConfig) ResetStatus()

func (*NodeDisplayConfig) SetAppliedConfigStatuses

func (nodeDisplayConfig *NodeDisplayConfig) SetAppliedConfigStatuses(displayConfig *DisplayConfig)

Updated the NodeDisplayConfig status with information about the display configuration that was last applied to the node.

func (*NodeDisplayConfig) SetConditions

func (nodeDisplayConfig *NodeDisplayConfig) SetConditions(conditions []metav1.Condition)

func (*NodeDisplayConfig) SetDefaultCondition

func (nodeDisplayConfig *NodeDisplayConfig) SetDefaultCondition()

func (*NodeDisplayConfig) SetDisplayManagerConfigCondition

func (nodeDisplayConfig *NodeDisplayConfig) SetDisplayManagerConfigCondition(configName string)

func (*NodeDisplayConfig) SetDisplayManagerConfiguredCondition

func (nodeDisplayConfig *NodeDisplayConfig) SetDisplayManagerConfiguredCondition(ready bool, reason, message string)

func (*NodeDisplayConfig) SetDisplayctlEnabledCondition

func (nodeDisplayConfig *NodeDisplayConfig) SetDisplayctlEnabledCondition(enabled bool)

func (*NodeDisplayConfig) SetupWebhookWithManager

func (nodeDisplayConfig *NodeDisplayConfig) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*NodeDisplayConfig) ValidateCreate

func (nodeDisplayConfig *NodeDisplayConfig) ValidateCreate() (admission.Warnings, error)

func (*NodeDisplayConfig) ValidateDelete

func (*NodeDisplayConfig) ValidateDelete() (admission.Warnings, error)

func (*NodeDisplayConfig) ValidateUpdate

func (nodeDisplayConfig *NodeDisplayConfig) ValidateUpdate(runtime.Object) (admission.Warnings, error)

type NodeDisplayConfigList

type NodeDisplayConfigList struct {
    metav1.TypeMeta `json:",inline"`
    metav1.ListMeta `json:"metadata,omitempty"`
    Items           []NodeDisplayConfig `json:"items"`
}

func (*NodeDisplayConfigList) DeepCopy

func (in *NodeDisplayConfigList) DeepCopy() *NodeDisplayConfigList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisplayConfigList.

func (*NodeDisplayConfigList) DeepCopyInto

func (in *NodeDisplayConfigList) DeepCopyInto(out *NodeDisplayConfigList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*NodeDisplayConfigList) DeepCopyObject

func (in *NodeDisplayConfigList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type NodeDisplayConfigStatus

type NodeDisplayConfigStatus struct {
    // The configuration that was applied to the node.
    Applied AppliedStatus `json:"applied,omitempty"`
    // Stores upgrade status for partially-upgraded objects.
    Upgrade UpgradeStatus `json:"upgrade,omitempty"`

    Conditions []metav1.Condition `json:"conditions,omitempty"`
}

func (*NodeDisplayConfigStatus) DeepCopy

func (in *NodeDisplayConfigStatus) DeepCopy() *NodeDisplayConfigStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeDisplayConfigStatus.

func (*NodeDisplayConfigStatus) DeepCopyInto

func (in *NodeDisplayConfigStatus) DeepCopyInto(out *NodeDisplayConfigStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Orientation

+kubebuilder:validation:Enum=normal;left;right;inverted

Orientation is the displays orientation, e.g "normal", "left", "right" or "inverted".

type Orientation string
var (
    NormalOrientation   Orientation = "normal"
    LeftOrientation     Orientation = "left"
    RightOrientation    Orientation = "right"
    InvertedOrientation Orientation = "inverted"
)

func (*Orientation) String

func (o *Orientation) String() string

type Primary

Primary indicates whether a display is the primary display.

type Primary bool

type Resolution

Resolution defines the resolution of a display.

type Resolution struct {
    // +kubebuilder:validation:Minimum=0
    //
    // Width of the display in pixels.
    Width int `json:"width"`
    // +kubebuilder:validation:Minimum=0
    //
    // Height of the display in pixels.
    Height int `json:"height"`
}

func (*Resolution) DeepCopy

func (in *Resolution) DeepCopy() *Resolution

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resolution.

func (*Resolution) DeepCopyInto

func (in *Resolution) DeepCopyInto(out *Resolution)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Resolution) String

func (res *Resolution) String() string

type UpgradeStatus

type UpgradeStatus struct {
    // MPIDs for displays disconnected during the upgrade.
    // Used by displayctl to upgrade the displays if they
    // are reconnected at later point.
    DisconnectedDisplays map[DisplayPort]MPID `json:"disconnectedDisplays,omitempty"`
}

func (*UpgradeStatus) DeepCopy

func (in *UpgradeStatus) DeepCopy() *UpgradeStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpgradeStatus.

func (*UpgradeStatus) DeepCopyInto

func (in *UpgradeStatus) DeepCopyInto(out *UpgradeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.