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

[BUG] GetWorkflowAttributes fetches incorrect results #2287

Closed
2 tasks done
pmahindrakar-oss opened this issue Mar 24, 2022 · 0 comments
Closed
2 tasks done

[BUG] GetWorkflowAttributes fetches incorrect results #2287

pmahindrakar-oss opened this issue Mar 24, 2022 · 0 comments
Assignees
Labels
bug Something isn't working flyteadmin Issue for FlyteAdmin Service

Comments

@pmahindrakar-oss
Copy link
Contributor

pmahindrakar-oss commented Mar 24, 2022

Describe the bug

Following is the GetWorkflowAttributes

GetWorkflowAttributes(ctx, &admin.WorkflowAttributesGetRequest{
		Project:      project,
		Domain:       domain,
		Workflow:     wfName,
		ResourceType: rsType,
	}

which should return a matching workflow attribute of rsType for project-domain-wfName combination

But it fetches results for project-domain combination even for any random workflow name

This is because at the GORM layer flyteadmin does an in query on wfName which also contains an empty string

https://github.com/flyteorg/flyteadmin/blob/cc40d268a290d106338f107b89f04a34a0c0116d/pkg/repositories/gormimpl/resource_repo.go#L98

Following is the query it runs which is incorrect. It should have done an exact match on the workflow.

select * from resources where resource_type = 'WORKFLOW_EXECUTION_CONFIG'  AND domain = 'development' AND project IN ('flytesnacks') AND workflow IN ('','workflow') AND launch_plan IN ('')

cc : @katrogan @EngHabu

Affects #2070

Expected behavior

GetWorkflowAttributes should only fetch if there is an exact match for the passed in workflow

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flyteadmin Issue for FlyteAdmin Service
Projects
None yet
Development

No branches or pull requests

1 participant