diff --git a/api/v1alpha1/connector_types.go b/api/v1alpha1/connector_types.go index b4559db9..f75b2599 100644 --- a/api/v1alpha1/connector_types.go +++ b/api/v1alpha1/connector_types.go @@ -105,6 +105,22 @@ const ( PublicKeyConnectorConnectionType ConnectorConnectionType = "PublicKey" ) +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"` +} + // ConnectorConnectionDetails provides details on how to connect to the connector. // // +kubebuilder:validation:XValidation:message="publicKey field must be nil if the type is not PublicKey",rule="!(self.type != 'PublicKey' && has(self.publicKey))" @@ -160,6 +176,12 @@ type ConnectorStatus struct { // // +kubebuilder:validation:Optional LeaseRef *corev1.LocalObjectReference `json:"leaseRef,omitempty"` + + // Device describes the device running the connector, as reported by the + // connector agent. + // + // +kubebuilder:validation:Optional + Device *ConnectorDeviceInfo `json:"device,omitempty"` } const ( diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index ecf6ff24..238ffb62 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -387,6 +387,21 @@ func (in *ConnectorConnectionDetailsPublicKey) DeepCopy() *ConnectorConnectionDe return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectorDeviceInfo) DeepCopyInto(out *ConnectorDeviceInfo) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectorDeviceInfo. +func (in *ConnectorDeviceInfo) DeepCopy() *ConnectorDeviceInfo { + if in == nil { + return nil + } + out := new(ConnectorDeviceInfo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConnectorList) DeepCopyInto(out *ConnectorList) { *out = *in @@ -468,6 +483,11 @@ func (in *ConnectorStatus) DeepCopyInto(out *ConnectorStatus) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Device != nil { + in, out := &in.Device, &out.Device + *out = new(ConnectorDeviceInfo) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectorStatus. diff --git a/config/crd/bases/networking.datumapis.com_connectors.yaml b/config/crd/bases/networking.datumapis.com_connectors.yaml index 6648f065..1227d184 100644 --- a/config/crd/bases/networking.datumapis.com_connectors.yaml +++ b/config/crd/bases/networking.datumapis.com_connectors.yaml @@ -289,6 +289,25 @@ spec: rule: '!(self.type != ''PublicKey'' && has(self.publicKey))' - message: publicKey field must be specified if the type is PublicKey rule: self.type == 'PublicKey' && has(self.publicKey) + device: + description: |- + Device describes the device running the connector, as reported by the + connector agent. + properties: + name: + description: Human-readable name of the device running the connector. + maxLength: 253 + minLength: 1 + type: string + os: + description: Operating system of the device running the connector. + maxLength: 253 + minLength: 1 + type: string + required: + - name + - os + type: object leaseRef: description: |- LeaseRef references the Lease used to report connector liveness.