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

registry-facade: Remove unnecessary varilable declaration. #11948

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

utam0k
Copy link
Contributor

@utam0k utam0k commented Aug 8, 2022

Description

just small refactoring

Related Issue(s)

Fixes #

How to test

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

@utam0k utam0k requested a review from a team August 8, 2022 04:07
@github-actions github-actions bot added team: workspace Issue belongs to the Workspace team and removed size/XS labels Aug 8, 2022
@@ -359,8 +359,7 @@ func (sbs ipfsBlobSource) HasBlob(ctx context.Context, spec *api.ImageSpec, dgst
func (sbs ipfsBlobSource) GetBlob(ctx context.Context, spec *api.ImageSpec, dgst digest.Digest) (dontCache bool, mediaType string, url string, data io.ReadCloser, err error) {
log := log.WithField("digest", dgst)

var ipfsCID string
ipfsCID, err = sbs.source.Redis.Get(ctx, dgst.String()).Result()
ipfsCID, err := sbs.source.Redis.Get(ctx, dgst.String()).Result()
Copy link
Contributor

Choose a reason for hiding this comment

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

This is intended, because we declare the err variable at line 359.
Otherwise, we can't catch this line's error and update to line 359 err variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Otherwise, we can't catch this line's error and update to line 359 err variable.

Oh, I didn't know that. So you are saying that we can't use err for return value?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oops, sorry my bad, I did not see at line 365, we set the error as err = distv2.ErrorCodeBlobUnknown.

@utam0k utam0k closed this Aug 8, 2022
@jenting jenting reopened this Aug 8, 2022
@roboquat roboquat merged commit 3d97d55 into main Aug 8, 2022
@roboquat roboquat deleted the to/unne-val branch August 8, 2022 06:37
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note-none size/XS team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants