Skip to content

Commit

Permalink
Return error when failed to type cast.
Browse files Browse the repository at this point in the history
  • Loading branch information
aattuluri committed Sep 12, 2024
1 parent 61b23e8 commit 232eeb1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion admiral/pkg/controller/admiral/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (d *JobController) Updated(ctx context.Context, obj interface{}, oldObj int
func addUpdateJob(j *JobController, ctx context.Context, obj interface{}) error {
job, ok := obj.(*v12.Job)
if !ok {
return nil
return fmt.Errorf("failed to covert informer object to Job")
}
if !common.ShouldIgnore(job.Annotations, job.Labels) {
k8sObj := j.Cache.getK8sObjectFromJob(job)
Expand Down
2 changes: 1 addition & 1 deletion admiral/pkg/controller/admiral/monovertex.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (d *MonoVertexController) Updated(ctx context.Context, obj interface{}, old
func addUpdateMonoVertex(j *MonoVertexController, ctx context.Context, obj interface{}) error {
monoVertex, ok := obj.(v1alpha1.MonoVertex)
if !ok {
return nil
return fmt.Errorf("failed to covert informer object to MonoVertex")
}
if !common.ShouldIgnore(monoVertex.Annotations, monoVertex.Labels) {
k8sObj := j.Cache.getK8sObjectFromMonoVertex(monoVertex)
Expand Down
2 changes: 1 addition & 1 deletion admiral/pkg/controller/admiral/vertex.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (d *VertexController) Updated(ctx context.Context, obj interface{}, oldObj
func addUpdateVertex(j *VertexController, ctx context.Context, obj interface{}) error {
vertex, ok := obj.(v1alpha1.Vertex)
if !ok {
return nil
return fmt.Errorf("failed to covert informer object to Vertex")
}
if !common.ShouldIgnore(vertex.Annotations, vertex.Labels) {
k8sObj := j.Cache.getK8sObjectFromVertex(vertex)
Expand Down

0 comments on commit 232eeb1

Please sign in to comment.