diff --git a/pkg/clusterresource/controller.go b/pkg/clusterresource/controller.go index 2a3b20674a..2824d5ed66 100644 --- a/pkg/clusterresource/controller.go +++ b/pkg/clusterresource/controller.go @@ -183,7 +183,9 @@ func (c *controller) getCustomTemplateValues( ResourceType: admin.MatchableResource_CLUSTER_RESOURCE, }) if err != nil { - collectedErrs = append(collectedErrs, err) + if _, ok := err.(errors.FlyteAdminError); !ok || err.(errors.FlyteAdminError).Code() != codes.NotFound { + collectedErrs = append(collectedErrs, err) + } } if resource != nil && resource.Attributes != nil && resource.Attributes.GetClusterResourceAttributes() != nil { for templateKey, templateValue := range resource.Attributes.GetClusterResourceAttributes().Attributes { diff --git a/pkg/repositories/gormimpl/resource_repo.go b/pkg/repositories/gormimpl/resource_repo.go index 57bfb7c525..2f3d370095 100644 --- a/pkg/repositories/gormimpl/resource_repo.go +++ b/pkg/repositories/gormimpl/resource_repo.go @@ -111,7 +111,7 @@ func (r *ResourceRepo) Get(ctx context.Context, ID interfaces.ResourceID) (model } if tx.RecordNotFound() || len(resources) == 0 { return models.Resource{}, flyteAdminErrors.NewFlyteAdminErrorf(codes.NotFound, - "%+v", ID) + "Resource [%+v] not found", ID) } return resources[0], nil } diff --git a/tests/attributes_test.go b/tests/attributes_test.go index b75891fc26..2e4506c49a 100644 --- a/tests/attributes_test.go +++ b/tests/attributes_test.go @@ -88,7 +88,7 @@ func TestUpdateProjectDomainAttributes(t *testing.T) { ResourceType: admin.MatchableResource_TASK_RESOURCE, }) assert.Nil(t, response) - assert.EqualError(t, err, "rpc error: code = NotFound desc = {Project:admintests Domain:development Workflow: LaunchPlan: ResourceType:TASK_RESOURCE}") + assert.EqualError(t, err, "rpc error: code = NotFound desc = Resource [{Project:admintests Domain:development Workflow: LaunchPlan: ResourceType:TASK_RESOURCE}] not found") } func TestUpdateWorkflowAttributes(t *testing.T) { @@ -142,5 +142,5 @@ func TestUpdateWorkflowAttributes(t *testing.T) { Workflow: "workflow", ResourceType: admin.MatchableResource_TASK_RESOURCE, }) - assert.EqualError(t, err, "rpc error: code = NotFound desc = {Project:admintests Domain:development Workflow:workflow LaunchPlan: ResourceType:TASK_RESOURCE}") + assert.EqualError(t, err, "rpc error: code = NotFound desc = Resource [{Project:admintests Domain:development Workflow:workflow LaunchPlan: ResourceType:TASK_RESOURCE}] not found") }