Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add printercolumn for syncStatus in SriovNetworkNodeState #404

Merged
merged 2 commits into from
Feb 21, 2023
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
2 changes: 2 additions & 0 deletions api/v1/sriovnetworknodestate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ type SriovNetworkNodeStateStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Sync Status",type=string,JSONPath=`.status.syncStatus`
tariq1890 marked this conversation as resolved.
Show resolved Hide resolved
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

// 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,14 @@ spec:
singular: sriovnetworknodestate
scope: Namespaced
versions:
- name: v1
- additionalPrinterColumns:
- jsonPath: .status.syncStatus
name: Sync Status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
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,14 @@ spec:
singular: sriovnetworknodestate
scope: Namespaced
versions:
- name: v1
- additionalPrinterColumns:
- jsonPath: .status.syncStatus
name: Sync Status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
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"
tariq1890 marked this conversation as resolved.
Show resolved Hide resolved
)

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