Skip to content

Commit

Permalink
Ensure the timestamp be treated as a date-time value, allowing Kubern…
Browse files Browse the repository at this point in the history
…etes to display it as an "age" based on the time difference (#144)

Signed-off-by: Shiva Krishna, Merla <[email protected]>
  • Loading branch information
shivamerla authored Sep 19, 2024
1 parent ae2681e commit bf90441
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 21 deletions.
2 changes: 1 addition & 1 deletion api/apps/v1alpha1/nimcache_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (s *NIMSource) EnvFromSecrets() []v1.EnvFromSource {
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.state`,priority=0
// +kubebuilder:printcolumn:name="PVC",type=string,JSONPath=`.status.pvc`,priority=0
// +kubebuilder:printcolumn:name="Age",type=string,JSONPath=`.metadata.creationTimestamp`,priority=0
// +kubebuilder:printcolumn:name="Age",type="date",format="date-time",JSONPath=".metadata.creationTimestamp",priority=0

// NIMCache is the Schema for the nimcaches API
type NIMCache struct {
Expand Down
2 changes: 1 addition & 1 deletion api/apps/v1alpha1/nimpipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type NIMPipelineStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.state`,priority=0
// +kubebuilder:printcolumn:name="Age",type=string,JSONPath=`.metadata.creationTimestamp`,priority=0
// +kubebuilder:printcolumn:name="Age",type="date",format="date-time",JSONPath=".metadata.creationTimestamp",priority=0

// NIMPipeline is the Schema for the nimpipelines API
type NIMPipeline struct {
Expand Down
2 changes: 1 addition & 1 deletion api/apps/v1alpha1/nimservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type NIMServiceStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.state`,priority=0
// +kubebuilder:printcolumn:name="Age",type=string,JSONPath=`.metadata.creationTimestamp`,priority=0
// +kubebuilder:printcolumn:name="Age",type="date",format="date-time",JSONPath=".metadata.creationTimestamp",priority=0

// NIMService is the Schema for the nimservices API
type NIMService struct {
Expand Down
5 changes: 3 additions & 2 deletions bundle/manifests/apps.nvidia.com_nimcaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ spec:
- jsonPath: .status.pvc
name: PVC
type: string
- jsonPath: .metadata.creationTimestamp
- format: date-time
jsonPath: .metadata.creationTimestamp
name: Age
type: string
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
5 changes: 3 additions & 2 deletions bundle/manifests/apps.nvidia.com_nimpipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ spec:
- jsonPath: .status.state
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
- format: date-time
jsonPath: .metadata.creationTimestamp
name: Age
type: string
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
5 changes: 3 additions & 2 deletions bundle/manifests/apps.nvidia.com_nimservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ spec:
- jsonPath: .status.state
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
- format: date-time
jsonPath: .metadata.creationTimestamp
name: Age
type: string
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
5 changes: 3 additions & 2 deletions config/crd/bases/apps.nvidia.com_nimcaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ spec:
- jsonPath: .status.pvc
name: PVC
type: string
- jsonPath: .metadata.creationTimestamp
- format: date-time
jsonPath: .metadata.creationTimestamp
name: Age
type: string
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
5 changes: 3 additions & 2 deletions config/crd/bases/apps.nvidia.com_nimpipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ spec:
- jsonPath: .status.state
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
- format: date-time
jsonPath: .metadata.creationTimestamp
name: Age
type: string
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
5 changes: 3 additions & 2 deletions config/crd/bases/apps.nvidia.com_nimservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ spec:
- jsonPath: .status.state
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
- format: date-time
jsonPath: .metadata.creationTimestamp
name: Age
type: string
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ spec:
- jsonPath: .status.pvc
name: PVC
type: string
- jsonPath: .metadata.creationTimestamp
- format: date-time
jsonPath: .metadata.creationTimestamp
name: Age
type: string
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ spec:
- jsonPath: .status.state
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
- format: date-time
jsonPath: .metadata.creationTimestamp
name: Age
type: string
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ spec:
- jsonPath: .status.state
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
- format: date-time
jsonPath: .metadata.creationTimestamp
name: Age
type: string
type: date
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down

0 comments on commit bf90441

Please sign in to comment.