Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

add additional print columns to show more information #26

Merged
merged 1 commit into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
# Common versions
GO_VERSION: '1.16'
GOLANGCI_VERSION: 'v1.40'
GOLANGCI_VERSION: 'v1.45'

jobs:
check-license:
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/device_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 5 additions & 1 deletion api/v1alpha1/deviceprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/deviceservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 17 additions & 3 deletions config/crd/bases/device.openyurt.io_deviceprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
21 changes: 20 additions & 1 deletion config/crd/bases/device.openyurt.io_devices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 20 additions & 1 deletion config/crd/bases/device.openyurt.io_deviceservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
62 changes: 57 additions & 5 deletions config/setup/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down