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

don't fail FetchBundle if bundle does not exist #598

Merged
merged 2 commits into from
Oct 17, 2018

Conversation

azdagron
Copy link
Member

The datastore was recently refactored to use Request/Response messages
uniformly. Before that refactor, FetchBundle returned a Bundle message
directly from the RPC and therefore had to fail if the bundle didn't
exist (since it couldn't return a nil response).

This commit changes the behavior of FetchBundle to match that of the
other Fetch methods. Namely, if the requested bundle is not found, the
call succeeds and returns an empty response object (i.e., the bundle
pointer will be nil).

All FetchBundle callers have been audited to make sure they handle an
nil bundle appropriately.

The datastore was recently refactored to use Request/Response messages
uniformly. Before that refactor, FetchBundle returned a Bundle message
directly from the RPC and therefore had to fail if the bundle didn't
exist (since it couldn't return a nil response).

This commit changes the behavior of FetchBundle to match that of the
other Fetch methods. Namely, if the requested bundle is not found, the
call succeeds and returns an empty response object (i.e., the bundle
pointer will be nil).

All FetchBundle callers have been audited to make sure they handle an
nil bundle appropriately.

Signed-off-by: Andrew Harding <azdagron@gmail.com>
Signed-off-by: Andrew Harding <azdagron@gmail.com>
Copy link
Contributor

@marcosy marcosy left a comment

Choose a reason for hiding this comment

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

Great! Looks good to me

@azdagron azdagron merged commit a127a5b into spiffe:master Oct 17, 2018
@azdagron azdagron deleted the fetch-bundle-success-if-not-found branch October 29, 2018 15:35
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

Successfully merging this pull request may close these issues.

3 participants