diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 831f010..1eddcdd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ on: env: # Common versions GO_VERSION: '1.16' - GOLANGCI_VERSION: 'v1.40' + GOLANGCI_VERSION: 'v1.45' jobs: check-license: @@ -46,7 +46,7 @@ jobs: container: pouchcontainer/pouchlinter:v0.1.2 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run misspell run: find ./* -name "*" | xargs misspell -error - name: Lint markdown files diff --git a/api/v1alpha1/device_types.go b/api/v1alpha1/device_types.go index d56df70..24b3eae 100644 --- a/api/v1alpha1/device_types.go +++ b/api/v1alpha1/device_types.go @@ -112,6 +112,11 @@ type DeviceStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+kubebuilder:resource:shortName=dev +//+kubebuilder:printcolumn:name="NODEPOOL",type="string",JSONPath=".spec.nodePool",description="The nodepool of device" +//+kubebuilder:printcolumn:name="SYNCED",type="boolean",JSONPath=".status.synced",description="The synced status of device" +//+kubebuilder:printcolumn:name="MANAGED",type="boolean",priority=1,JSONPath=".spec.managed",description="The managed status of device" +//+kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // Device is the Schema for the devices API type Device struct { diff --git a/api/v1alpha1/deviceprofile_types.go b/api/v1alpha1/deviceprofile_types.go index 9ca8a8c..44ae1d9 100644 --- a/api/v1alpha1/deviceprofile_types.go +++ b/api/v1alpha1/deviceprofile_types.go @@ -142,11 +142,15 @@ type DeviceProfileSpec struct { // DeviceProfileStatus defines the observed state of DeviceProfile type DeviceProfileStatus struct { EdgeId string `json:"id,omitempty"` - Synced bool `json:"Synced,omitempty"` + Synced bool `json:"synced,omitempty"` } //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+kubebuilder:resource:shortName=dp +//+kubebuilder:printcolumn:name="NODEPOOL",type="string",JSONPath=".spec.nodePool",description="The nodepool of deviceProfile" +//+kubebuilder:printcolumn:name="SYNCED",type="boolean",JSONPath=".status.synced",description="The synced status of deviceProfile" +//+kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // DeviceProfile represents the attributes and operational capabilities of a device. // It is a template for which there can be multiple matching devices within a given system. diff --git a/api/v1alpha1/deviceservice_types.go b/api/v1alpha1/deviceservice_types.go index 5739276..5cda6e3 100644 --- a/api/v1alpha1/deviceservice_types.go +++ b/api/v1alpha1/deviceservice_types.go @@ -94,6 +94,11 @@ type DeviceServiceStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+kubebuilder:resource:shortName=dsvc +//+kubebuilder:printcolumn:name="NODEPOOL",type="string",JSONPath=".spec.nodePool",description="The nodepool of deviceService" +//+kubebuilder:printcolumn:name="SYNCED",type="boolean",JSONPath=".status.synced",description="The synced status of deviceService" +//+kubebuilder:printcolumn:name="MANAGED",type="boolean",priority=1,JSONPath=".spec.managed",description="The managed status of deviceService" +//+kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // DeviceService is the Schema for the deviceservices API type DeviceService struct { diff --git a/config/crd/bases/device.openyurt.io_deviceprofiles.yaml b/config/crd/bases/device.openyurt.io_deviceprofiles.yaml index b382bd5..3667bc6 100644 --- a/config/crd/bases/device.openyurt.io_deviceprofiles.yaml +++ b/config/crd/bases/device.openyurt.io_deviceprofiles.yaml @@ -13,10 +13,24 @@ spec: kind: DeviceProfile listKind: DeviceProfileList plural: deviceprofiles + shortNames: + - dp singular: deviceprofile scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The nodepool of deviceProfile + jsonPath: .spec.nodePool + name: NODEPOOL + type: string + - description: The synced status of deviceProfile + jsonPath: .status.synced + name: SYNCED + type: boolean + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 schema: openAPIV3Schema: description: DeviceProfile represents the attributes and operational capabilities @@ -267,10 +281,10 @@ spec: status: description: DeviceProfileStatus defines the observed state of DeviceProfile properties: - Synced: - type: boolean id: type: string + synced: + type: boolean type: object type: object served: true diff --git a/config/crd/bases/device.openyurt.io_devices.yaml b/config/crd/bases/device.openyurt.io_devices.yaml index c8b7d83..2e158dc 100644 --- a/config/crd/bases/device.openyurt.io_devices.yaml +++ b/config/crd/bases/device.openyurt.io_devices.yaml @@ -13,10 +13,29 @@ spec: kind: Device listKind: DeviceList plural: devices + shortNames: + - dev singular: device scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The nodepool of device + jsonPath: .spec.nodePool + name: NODEPOOL + type: string + - description: The synced status of device + jsonPath: .status.synced + name: SYNCED + type: boolean + - description: The managed status of device + jsonPath: .spec.managed + name: MANAGED + priority: 1 + type: boolean + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 schema: openAPIV3Schema: description: Device is the Schema for the devices API diff --git a/config/crd/bases/device.openyurt.io_deviceservices.yaml b/config/crd/bases/device.openyurt.io_deviceservices.yaml index b83534a..9eab2db 100644 --- a/config/crd/bases/device.openyurt.io_deviceservices.yaml +++ b/config/crd/bases/device.openyurt.io_deviceservices.yaml @@ -13,10 +13,29 @@ spec: kind: DeviceService listKind: DeviceServiceList plural: deviceservices + shortNames: + - dsvc singular: deviceservice scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The nodepool of deviceService + jsonPath: .spec.nodePool + name: NODEPOOL + type: string + - description: The synced status of deviceService + jsonPath: .status.synced + name: SYNCED + type: boolean + - description: The managed status of deviceService + jsonPath: .spec.managed + name: MANAGED + priority: 1 + type: boolean + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 schema: openAPIV3Schema: description: DeviceService is the Schema for the deviceservices API diff --git a/config/setup/crd.yaml b/config/setup/crd.yaml index c1814d9..c3dc504 100644 --- a/config/setup/crd.yaml +++ b/config/setup/crd.yaml @@ -11,10 +11,24 @@ spec: kind: DeviceProfile listKind: DeviceProfileList plural: deviceprofiles + shortNames: + - dp singular: deviceprofile scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The nodepool of deviceProfile + jsonPath: .spec.nodePool + name: NODEPOOL + type: string + - description: The synced status of deviceProfile + jsonPath: .status.synced + name: SYNCED + type: boolean + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 schema: openAPIV3Schema: description: DeviceProfile represents the attributes and operational capabilities of a device. It is a template for which there can be multiple matching devices within a given system. NOTE This struct is derived from edgex/go-mod-core-contracts/models/deviceprofile.go @@ -252,10 +266,10 @@ spec: status: description: DeviceProfileStatus defines the observed state of DeviceProfile properties: - Synced: - type: boolean id: type: string + synced: + type: boolean type: object type: object served: true @@ -282,10 +296,29 @@ spec: kind: Device listKind: DeviceList plural: devices + shortNames: + - dev singular: device scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The nodepool of device + jsonPath: .spec.nodePool + name: NODEPOOL + type: string + - description: The synced status of device + jsonPath: .status.synced + name: SYNCED + type: boolean + - description: The managed status of device + jsonPath: .spec.managed + name: MANAGED + priority: 1 + type: boolean + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 schema: openAPIV3Schema: description: Device is the Schema for the devices API @@ -448,10 +481,29 @@ spec: kind: DeviceService listKind: DeviceServiceList plural: deviceservices + shortNames: + - dsvc singular: deviceservice scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: The nodepool of deviceService + jsonPath: .spec.nodePool + name: NODEPOOL + type: string + - description: The synced status of deviceService + jsonPath: .status.synced + name: SYNCED + type: boolean + - description: The managed status of deviceService + jsonPath: .spec.managed + name: MANAGED + priority: 1 + type: boolean + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 schema: openAPIV3Schema: description: DeviceService is the Schema for the deviceservices API