Skip to content

Commit

Permalink
add printercolumn for syncStatus in SriovNetworkNodeState
Browse files Browse the repository at this point in the history
  • Loading branch information
tariq1890 committed Feb 7, 2023
1 parent 2d8ba0d commit 47d715b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
1 change: 1 addition & 0 deletions api/v1/sriovnetworknodestate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ type SriovNetworkNodeStateStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Sync Status",type=string,JSONPath=`.status.syncStatus`

// SriovNetworkNodeState is the Schema for the sriovnetworknodestates API
type SriovNetworkNodeState struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ spec:
singular: sriovnetworknodestate
scope: Namespaced
versions:
- name: v1
- additionalPrinterColumns:
- jsonPath: .status.syncStatus
name: Sync Status
type: string
name: v1
schema:
openAPIV3Schema:
description: SriovNetworkNodeState is the Schema for the sriovnetworknodestates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ spec:
singular: sriovnetworknodestate
scope: Namespaced
versions:
- name: v1
- additionalPrinterColumns:
- jsonPath: .status.syncStatus
name: Sync Status
type: string
name: v1
schema:
openAPIV3Schema:
description: SriovNetworkNodeState is the Schema for the sriovnetworknodestates
Expand Down
19 changes: 10 additions & 9 deletions pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ type Daemon struct {
}

const (
rdmaScriptsPath = "/bindata/scripts/enable-rdma.sh"
udevScriptsPath = "/bindata/scripts/load-udev.sh"
annoKey = "sriovnetwork.openshift.io/state"
annoIdle = "Idle"
annoDraining = "Draining"
annoMcpPaused = "Draining_MCP_Paused"
syncStatusSucceeded = "Succeeded"
syncStatusFailed = "Failed"
rdmaScriptsPath = "/bindata/scripts/enable-rdma.sh"
udevScriptsPath = "/bindata/scripts/load-udev.sh"
annoKey = "sriovnetwork.openshift.io/state"
annoIdle = "Idle"
annoDraining = "Draining"
annoMcpPaused = "Draining_MCP_Paused"
syncStatusSucceeded = "Succeeded"
syncStatusFailed = "Failed"
syncStatusInProgress = "InProgress"
)

var namespace = os.Getenv("NAMESPACE")
Expand Down Expand Up @@ -448,7 +449,7 @@ func (dn *Daemon) nodeStateSyncHandler() error {
}

dn.refreshCh <- Message{
syncStatus: "InProgress",
syncStatus: syncStatusInProgress,
lastSyncError: "",
}

Expand Down

0 comments on commit 47d715b

Please sign in to comment.