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

Add support for private registry with custom port in restic-helper image #1999

Merged
merged 11 commits into from
Dec 4, 2019

Conversation

cognoz
Copy link
Contributor

@cognoz cognoz commented Oct 25, 2019

Closes #1972

example of image definition with custom registry port in CM:

data:
  image: nexus-registry.domain.domain:18116/heptio-images/velero-restic-restore-helper:v1.1.0

…age definition

Signed-off-by: Roman Klimenko <cognoz@ya.ru>
@skriss
Copy link
Contributor

skriss commented Oct 25, 2019

Thanks for the PR @cognoz! We do need you to add DCO signoff to your commit -- git commit --amend --signoff followed by git push -f should do the trick.

@skriss
Copy link
Contributor

skriss commented Nov 13, 2019

@cognoz I think the code looks reasonable. I would like to add a couple new test cases though:

  • one for an image name that doesn't have a / (i.e. len(parts) == 1) - validate that the default image is returned
  • one for an image that uses a custom port for the registry, and doesn't have a tag - validate that the tag gets added
  • one for an image that uses a custom port for the registry, and does have a tag - validate that it's returned as-is

You should be able to just copy/paste and modify from the existing test cases. Once that's done, I think we can merge this.

@skriss
Copy link
Contributor

skriss commented Nov 15, 2019

@cognoz thanks for making the updates, this LGTM! One last request - could you add a changelog with a brief description of the bug fix? See https://velero.io/docs/master/code-standards/ for details.

Copy link
Contributor

@skriss skriss left a comment

Choose a reason for hiding this comment

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

LGTM pending changelog.

@skriss
Copy link
Contributor

skriss commented Nov 15, 2019

cc @carlisia @prydonius @nrb - PTAL

@cognoz
Copy link
Contributor Author

cognoz commented Nov 21, 2019

Changelog added, thx for guidelines!

@skriss
Copy link
Contributor

skriss commented Dec 4, 2019

@carlisia @nrb @prydonius ping - this one's waiting for review/merge.

Copy link
Contributor

@carlisia carlisia left a comment

Choose a reason for hiding this comment

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

I like the new test, but is there a possibility for a case where the config map could haev invalid data in the key? If possible I'd like to make it so the modified test is an additional test, and keep the case for config map with invalid data in 'image' key returns default image.

@skriss
Copy link
Contributor

skriss commented Dec 4, 2019

@carlisia if you look at the code you'll notice that we're no longer trying to split image names based on :, so the test case you're referring to isn't really the best test of the logic anymore. The replacement case that was added (an image without a /) is effectively the "invalid data" case now, and validates that the default image is returned in such a case.

Copy link
Contributor

@carlisia carlisia left a comment

Choose a reason for hiding this comment

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

👍

sseago pushed a commit to sseago/velero that referenced this pull request Jan 3, 2020
…age (vmware-tanzu#1999)

* Add support for private registry with custom port in restic-helper image definition

Signed-off-by: Roman Klimenko <cognoz@ya.ru>
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.

Unparsable error with custom restic helper image with extra ":" in name (registry port)
3 participants