Skip to content

Conversation

vishesh92
Copy link
Contributor

@vishesh92 vishesh92 commented Jan 30, 2019

@manishtomar According to documentation, ipfilteredby is not required. And if you don't set ipfilteredby for cloudfront middleware, registry crashes and you get the error panic: interface conversion: interface {} is nil, not string.

This PR fixes this issue and some minor formatting issues with cloudfront configuration docs.

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "fix-cloudfront-middleware" git@github.com:vishesh92/distribution.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354339184
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

@vishesh92 vishesh92 force-pushed the fix-cloudfront-middleware branch 3 times, most recently from 809fad8 to 6f111d0 Compare January 30, 2019 13:16
@vishesh92 vishesh92 force-pushed the fix-cloudfront-middleware branch 2 times, most recently from fa1c1ee to 49d16e9 Compare January 30, 2019 13:50
@manishtomar
Copy link
Contributor

@vishesh92 What is the fix here?

@vishesh92
Copy link
Contributor Author

@manishtomar According to documentation, ipfilteredby is not required. And if you don't set ipfilteredby for cloudfront middleware, registry crashes and you get the error panic: interface conversion: interface {} is nil, not string.

This PR fixes this issue and some minor formatting issues with cloudfront configuration docs.

@manishtomar
Copy link
Contributor

@vishesh92 Code looks good. However the build is failing due to linter check. Not sure why. Can you please check and see if something stands out w.r.t this PR?

@vishesh92
Copy link
Contributor Author

@manishtomar make check is failing because of staticcheck warnings(https://travis-ci.org/docker/distribution/builds/486428072#L657). But there are no warnings in the file I made changes to. I am not sure why the build for master is passing.

@vishesh92
Copy link
Contributor Author

I triggered a build on master branch and Its failing there as well. https://travis-ci.org/vishesh92/distribution/builds/487321788

Its happening because version of gometalinter is not fixed and some changes were recently merged there: alecthomas/gometalinter#579

@manishtomar
Copy link
Contributor

@vishesh92 Thanks for the info. Let me make a PR with fixes.

@manishtomar
Copy link
Contributor

Closed and reopened to trigger build

@codecov
Copy link

codecov bot commented Feb 5, 2019

Codecov Report

Merging #2837 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2837   +/-   ##
=======================================
  Coverage   60.45%   60.45%           
=======================================
  Files         102      102           
  Lines        8001     8001           
=======================================
  Hits         4837     4837           
  Misses       2517     2517           
  Partials      647      647
Flag Coverage Δ
#linux 60.45% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3ddc35...e1e72e9. Read the comment docs.

Copy link
Contributor

@manishtomar manishtomar left a comment

Choose a reason for hiding this comment

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

Could you please address the comment? Thanks!

case "", "none":
awsIPs = nil
case "aws":
newAWSIPs(ipRangesURL, updateFrequency, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noticed another bug (not w.r.t this PR): please assign this to awsIPs:

awsIPs = newAWSIPs(ipRangesURL, updateFrequency, nil)

@vishesh92 vishesh92 force-pushed the fix-cloudfront-middleware branch from 49d16e9 to f7de676 Compare February 7, 2019 06:50
@vishesh92
Copy link
Contributor Author

@manishtomar I have made those changes.

Copy link
Contributor

@manishtomar manishtomar left a comment

Choose a reason for hiding this comment

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

Thanks for the changes @vishesh92. LGTM. @dmcgowan @caervs Could any of you merge this?

@vishesh92
Copy link
Contributor Author

@dmcgowan @caervs @manishtomar any update on this?

Copy link
Contributor

@caervs caervs left a comment

Choose a reason for hiding this comment

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

@vishesh92 sorry for the delay. One last change from me and then I think we're good to merge.

Signed-off-by: Vishesh Jindal <vishesh92@gmail.com>
Signed-off-by: Vishesh Jindal <vishesh92@gmail.com>
@vishesh92 vishesh92 force-pushed the fix-cloudfront-middleware branch from f7de676 to e1e72e9 Compare March 2, 2019 03:29
@vishesh92
Copy link
Contributor Author

@caervs resolved your comments.

@caervs
Copy link
Contributor

caervs commented Mar 5, 2019

@caervs resolved your comments.

@vishesh92 thank you!

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.

4 participants