Skip to content

Commit

Permalink
feat: add detailed error messages from deployment and pod status, fix…
Browse files Browse the repository at this point in the history
…es RHOAIENG-8789 (opendatahub-io#108)

* feat: add detailed error messages from deployment and pod status, fixes RHOAIENG-8789

* feat: add istio authconfig and gateway route status error messages

* fix: simplified error messages
  • Loading branch information
dhirajsb authored Jun 21, 2024
1 parent ed605c1 commit df6770b
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 48 deletions.
1 change: 1 addition & 0 deletions api/v1alpha1/modelregistry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ type ModelRegistryStatus struct {
//+kubebuilder:printcolumn:name="Istio",type=string,JSONPath=`.status.conditions[?(@.type=="IstioAvailable")].status`,priority=2
//+kubebuilder:printcolumn:name="Gateway",type=string,JSONPath=`.status.conditions[?(@.type=="GatewayAvailable")].status`,priority=2
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.conditions[?(@.type=="Available")].message`,priority=2

// ModelRegistry is the Schema for the modelregistries API
type ModelRegistry struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .status.conditions[?(@.type=="Available")].message
name: Status
priority: 2
type: string
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
6 changes: 4 additions & 2 deletions internal/controller/modelregistry_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ func (r *ModelRegistryReconciler) Reconcile(ctx context.Context, req ctrl.Reques
r.logResultAsEvent(modelRegistry, result)

// set custom resource status
if err = r.setRegistryStatus(ctx, req, result); err != nil {
available := false
if available, err = r.setRegistryStatus(ctx, req, result); err != nil {
return ctrl.Result{Requeue: true}, err
}
log.Info("status reconciled")
Expand All @@ -206,7 +207,8 @@ func (r *ModelRegistryReconciler) Reconcile(ctx context.Context, req ctrl.Reques
// requeue to update status
return ctrl.Result{Requeue: true}, nil
}
return ctrl.Result{}, nil

return ctrl.Result{Requeue: !available}, nil
}

func IgnoreDeletingErrors(err error) error {
Expand Down
Loading

0 comments on commit df6770b

Please sign in to comment.