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

Adding project filters for NodeExport #382

Merged
merged 2 commits into from
May 20, 2019

Conversation

lancewf
Copy link
Contributor

@lancewf lancewf commented May 17, 2019

🔩 Description

Adding project filtering for the cfgmgmt.proto NodeExport RPCs.

⛓️ Related Resources

#68

✅ Checklist

  • Necessary tests added/updated?
  • Necessary docs added/updated?
  • Code actually executed?
  • Vetting performed (unit tests, lint, etc.)?

@lancewf lancewf added the WIP label May 17, 2019
@lancewf lancewf force-pushed the lancewf/project_filter_NodeExport branch from 827599c to d3f54b4 Compare May 17, 2019 20:05
@lancewf lancewf changed the title WIP: Adding project filters for NodeExport Adding project filters for NodeExport May 17, 2019
@lancewf lancewf requested a review from a team May 17, 2019 20:05
@lancewf lancewf added iamv2 This issue or pull request applies to iamv2 work for Automate and removed WIP labels May 17, 2019
@lancewf lancewf force-pushed the lancewf/project_filter_NodeExport branch from d3f54b4 to 1935d55 Compare May 17, 2019 20:06
actualNodeNames = append(actualNodeNames, nodeName)
}
}
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this part. Do we not have a type for the response returned here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have an exposed type. The type is here https://github.com/chef/automate/blob/master/components/config-mgmt-service/grpcserver/node_export.go#L31.

I found it easier to just parse the JSON.


actualNodeNames := make([]string, 0)
jsonparser.ArrayEach(data, func(node []byte, _ jsonparser.ValueType, _ int, err error) {
if err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this test is not trying to verify basic correctness of the endpoint, but it feels bad to ignore errors here...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds right. I will update this test to fail on a returned error.

Signed-off-by: Lance Finfrock <[email protected]>
@lancewf lancewf merged commit 7819e53 into master May 20, 2019
@chef-ci chef-ci deleted the lancewf/project_filter_NodeExport branch May 20, 2019 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iamv2 This issue or pull request applies to iamv2 work for Automate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants