Skip to content

Add device info from clients to the connector#117

Closed
mattdjenkinson wants to merge 3 commits intomainfrom
feat/add-device-info-to-connectors
Closed

Add device info from clients to the connector#117
mattdjenkinson wants to merge 3 commits intomainfrom
feat/add-device-info-to-connectors

Conversation

@mattdjenkinson
Copy link
Contributor

@mattdjenkinson mattdjenkinson commented Feb 24, 2026

Summary

  • Adds a ConnectorDeviceInfo type (name, os) to the Connector spec, allowing clients to declare the device name and operating system when creating a Connector (e.g. "Matt's Macbook Pro", "macOS")
  • Extends ConnectorReference on HTTPProxy rule backends with deviceName and deviceOS fields so the proxy response surfaces device metadata alongside the connector name
  • Adds enrichConnectorDeviceInfo to the HTTPProxy reconciler, which automatically copies device info from the Connector spec into the HTTPProxy's connector references during reconciliation — keeping them in sync without requiring the client to duplicate data
  • Regenerates deepcopy methods and CRD manifests for both Connector and HTTPProxy

Changed files

File Change
api/v1alpha1/connector_types.go New ConnectorDeviceInfo struct; Device field on ConnectorSpec
api/v1alpha/httpproxy_types.go DeviceName and DeviceOS fields on ConnectorReference
internal/controller/httpproxy_controller.go enrichConnectorDeviceInfo function + call in reconcile loop
internal/controller/httpproxy_controller_test.go New TestEnrichConnectorDeviceInfo (4 cases); updated connector reconcile test to verify propagation
api/v1alpha1/zz_generated.deepcopy.go Auto-generated deepcopy for ConnectorDeviceInfo
config/crd/bases/networking.datumapis.com_connectors.yaml CRD schema updated with device field
config/crd/bases/networking.datumapis.com_httpproxies.yaml CRD schema updated with deviceName, deviceOS

@zachsmith1
Copy link
Contributor

zachsmith1 commented Feb 24, 2026

@mattdjenkinson i think to follow the same pattern that desktop is doing today we would add this field to the status. ie desktop will push this to the connector status and adjust it if it changes

@mattdjenkinson
Copy link
Contributor Author

@zachsmith1 yeah makes sense!

Comment on lines +113 to +127
type ConnectorDeviceInfo struct {
// Human-readable name of the device running the connector.
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
Name string `json:"name"`

// Operating system of the device running the connector.
//
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
OS string `json:"os"`
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be required? I'm just thinking of how these would be used in headless scenarios like servers / clusters I don't think we'd necessarily get this information. For example with the proposed Kubernetes integration this would likely be the cluster name which could also have Linux, macOS, and Windows OS nodes.

Maybe something we should be using the Display Name / Description annotations for like in other resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Device object is optional, can make the contents optional as well?

Not keen on how un-typed annotations are. Are you suggesting to add this info as an annotation on the connector resource?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattdjenkinson yeah that's what I was recommending. We've been using kubernetes.io/display-name and kubernetes.io/description as annotations on resources to indicate how the resource should be presented to users in the UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zachsmith1 do you have an opinion here? I know when we originally discussed this a few weeks ago you weren't keen on just adding it as an annotation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya I was originally suggesting we just use annotations for this data. if we want to make it more of an expected field that sdk/apps set then connector status makes the most sense. doing it at the annotation/label level for now keeps us flexible in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants