Add device info from clients to the connector#117
Add device info from clients to the connector#117mattdjenkinson wants to merge 3 commits intomainfrom
Conversation
|
@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 |
|
@zachsmith1 yeah makes sense! |
| 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"` | ||
| } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
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
Summary
ConnectorDeviceInfotype (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")ConnectorReferenceon HTTPProxy rule backends withdeviceNameanddeviceOSfields so the proxy response surfaces device metadata alongside the connector nameenrichConnectorDeviceInfoto 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 dataChanged files
api/v1alpha1/connector_types.goConnectorDeviceInfostruct;Devicefield onConnectorSpecapi/v1alpha/httpproxy_types.goDeviceNameandDeviceOSfields onConnectorReferenceinternal/controller/httpproxy_controller.goenrichConnectorDeviceInfofunction + call in reconcile loopinternal/controller/httpproxy_controller_test.goTestEnrichConnectorDeviceInfo(4 cases); updated connector reconcile test to verify propagationapi/v1alpha1/zz_generated.deepcopy.goConnectorDeviceInfoconfig/crd/bases/networking.datumapis.com_connectors.yamldevicefieldconfig/crd/bases/networking.datumapis.com_httpproxies.yamldeviceName,deviceOS