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

Improve the error message for optional key quals validation in Steampipe tables where we have anyof key quals instead of required or optional #4459

Open
ParthaI opened this issue Dec 18, 2024 · 0 comments
Assignees

Comments

@ParthaI
Copy link

ParthaI commented Dec 18, 2024

For instance, in the aws_ecr_image_scan_finding table, the key column configuration is as follows:

KeyColumns: []*plugin.KeyColumn{
    {Name: "repository_name", Require: plugin.Required},
    {Name: "image_tag", Require: plugin.AnyOf},
    {Name: "image_digest", Require: plugin.AnyOf},
},

Here, repository_name is a required qualifier, and either image_tag or image_digest is sufficient to make the API call.

Issue with Error Message:
When no any of optional key quals(image_tag or image_digest) are provided in the query, for example select * from aws_ecr_image_scan_finding where repository_name = 'test';
I receive the following error:

Error: rpc error: code = Internal desc = aws: rpc error: code = Internal desc = 'List' call for table 'aws_ecr_image_scan_finding' is missing 2 required quals: 
    column:'image_tag' operator: =
    column:'image_digest' operator: =

The error message incorrectly implies that both image_tag and image_digest are required, when in reality, any one of them is sufficient.

However, the table functionality works as expected. If we include either of the columns (image_tag or image_digest), such as in the query select * from aws_ecr_image_scan_finding where repository_name = 'test' and image_tag = 'latest', it executes successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants