Skip to content

SDK should respect DefaultGetConfig of the plugin for tables #319

Closed

Description

steampipe-plugin-sdk version: v3.2.0-rc.0

Problem Description

Have below in the plugins DefaultGetConfig and DefaultIgnoreConfig

		DefaultGetConfig: &plugin.GetConfig{
			IgnoreConfig: &plugin.IgnoreConfig{
				ShouldIgnoreErrorFunc: isNotFoundErrorWithContext([]string{"ResourceNotFoundException", "NoSuchEntity"}),
			},
		    DefaultIgnoreConfig: &plugin.IgnoreConfig{
			    ShouldIgnoreErrorFunc: shouldIgnoreErrorTableDefault([]string{"AccessDeniedException", "AccessDenied"}),
		    },
		},

and at table level, I have below Get Config

func tableAwsIamUser(ctx context.Context) *plugin.Table {
	return &plugin.Table{
		Name:        "aws_iam_user",
		Description: "AWS IAM User",
		Get: &plugin.GetConfig{
			KeyColumns: plugin.AnyColumn([]string{"name", "arn"}),
			Hydrate: getIamUser,
		},

On running query select name from aws_osborn.aws_iam_user where name = 'lalit123' I get below error

Error: NoSuchEntity: The user with name lalit123 cannot be found.
	status code: 404, request id: bfdfdb51-11ff-412f-9704-3ad1adde95f0 (SQLSTATE HV000)

But if I add the NoSuchEntity error to DefaultIgnoreConfig in the plugin it works fine and ignores the error

		    DefaultIgnoreConfig: &plugin.IgnoreConfig{
			    ShouldIgnoreErrorFunc: shouldIgnoreErrorTableDefault([]string{"AccessDeniedException", "AccessDenied","NoSuchEntity"}),
		    },
select name from aws_osborn.aws_iam_user where name = 'lalit123'
+------+
| name |
+------+
+------+

I have the below question on the above:

  1. Is it the expected behavior?
  2. Is there any precedent between the default plugin config, the table config, and the hydrate config that we should be aware of?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions