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 --cacert flag to velero cli commands #2364

Merged
merged 4 commits into from Apr 3, 2020

Conversation

mansam
Copy link
Contributor

@mansam mansam commented Mar 25, 2020

Fixes #2330

Adds a --cacert flag to the log and describe commands
that takes a path to a PEM-encoded certificate bundle
as an alternative to --insecure-skip-tls-verify for
dealing with self-signed certificates.

Signed-off-by: Sam Lucidi slucidi@redhat.com

Adds a --cacert flag to the log and describe commands
that takes a path to a PEM-encoded certificate bundle
as an alternative to --insecure-skip-tls-verify for
dealing with self-signed certificates.

Signed-off-by: Sam Lucidi <slucidi@redhat.com>
mansam added a commit to mansam/velero that referenced this pull request Mar 25, 2020
Signed-off-by: Sam Lucidi <slucidi@redhat.com>
@mansam mansam marked this pull request as ready for review March 25, 2020 22:15
@mansam mansam changed the title [WIP] Add --cacert flag to velero cli commands Add --cacert flag to velero cli commands Mar 25, 2020
@carlisia carlisia requested review from skriss, nrb, carlisia and ashish-amarnath and removed request for skriss March 30, 2020 21:43
skriss
skriss previously approved these changes Mar 30, 2020
Copy link
Member

@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.

looks great, thanks @mansam!

carlisia
carlisia previously approved these changes Mar 30, 2020
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.

If you think these two comments make sense in your installer PR #2368 (comment), then please name the file/path var here the same. Other then that, this lgtm!

@nrb
Copy link
Contributor

nrb commented Mar 31, 2020

Could we have documentation for the commands added, too?

nrb
nrb previously requested changes Mar 31, 2020
Copy link
Contributor

@nrb nrb left a comment

Choose a reason for hiding this comment

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

This mostly looks good, only one change I can see that should be made.

caPool.AppendCertsFromPEM(caCert)
}
httpClient := new(http.Client)
httpClient.Transport = &http.Transport{
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we probably want to use the timeout passed to Stream on the transport, since the Go HTTP client doesn't have one by default and will just wait forever if it's not specified (https://golang.org/src/net/http/transport.go#L211).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like the right call. While fixing that I also set the rest of the values on the transport to match go's DefaultTransport. https://golang.org/src/net/http/transport.go#L42

Signed-off-by: Sam Lucidi <slucidi@redhat.com>
Signed-off-by: Sam Lucidi <slucidi@redhat.com>
@mansam mansam dismissed stale reviews from carlisia and skriss via 5fd333c March 31, 2020 21:16
@mansam
Copy link
Contributor Author

mansam commented Mar 31, 2020

Happy to add documentation for the new flags though I don't see a good place to do so. @nrb where would you recommend I add that?

@carlisia
Copy link
Contributor

carlisia commented Apr 1, 2020

Happy to add documentation for the new flags though I don't see a good place to do so. @nrb where would you recommend I add that?

Hm yeah, that is a very good question. My preference is it should go under "Use", much like the page on "Run in any namespace". A small text on the reason why it's neeced/what it solves, what commands to use it with, and the documentation for how to use it (basically the documentation for the cmd itself, name of cmd + file name/path).

@nrb what is your preference?

@nrb
Copy link
Contributor

nrb commented Apr 1, 2020

🤔 Yeah, this question's always the tough one to answer.

Given your team is mostly concerned with restic integration @mansam, I was thinking https://velero.io/docs/v1.3.1/restic/, but this is useful beyond restic.

I think @carlisia's suggestion for an entry under the Use heading is good, too. Maybe a new page documenting using the entirety of the feature set end-to-end called "Custom Certificate Bundles"? If it's a brand new page, I'm ok with that documentation being in it's own PR.

carlisia
carlisia previously approved these changes Apr 1, 2020
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.

👍

@skriss
Copy link
Member

skriss commented Apr 2, 2020

@nrb @carlisia sounds like this is OK to merge as-is with a followup PR adding a new docs page?

Signed-off-by: Sam Lucidi <slucidi@redhat.com>
@carlisia
Copy link
Contributor

carlisia commented Apr 2, 2020

Yes, this lgtm!

@carlisia carlisia requested review from skriss, nrb and carlisia April 2, 2020 16:39
@carlisia carlisia merged commit c822360 into vmware-tanzu:master Apr 3, 2020
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.

[Custom CA] Add support for Velero client to specify a custom CA bundle
4 participants