fix: default insecure flag to false for registry create#913
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #913 +/- ##
=========================================
- Coverage 10.99% 8.80% -2.19%
=========================================
Files 173 280 +107
Lines 8671 13965 +5294
=========================================
+ Hits 953 1230 +277
- Misses 7612 12618 +5006
- Partials 106 117 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: madmecodes <ayushguptadev1@gmail.com>
0d368e9 to
e56ffdd
Compare
| --description string Description of the registry | ||
| -h, --help help for create | ||
| --insecure Whether Harbor will verify the server certificate (default true) | ||
| --insecure Whether Harbor will verify the server certificate |
There was a problem hiding this comment.
It will NOT verify the server certifcate
There was a problem hiding this comment.
@mreiche you are right. @madmecodes, please go ahead and adapt the flags description such that it uses tls for the registry aka a secure connection.
qcserestipy
left a comment
There was a problem hiding this comment.
LGTM, thank you for your contribution. Before merging please adapt the --insecure flags description.
| --description string Description of the registry | ||
| -h, --help help for create | ||
| --insecure Whether Harbor will verify the server certificate (default true) | ||
| --insecure Whether Harbor will verify the server certificate |
There was a problem hiding this comment.
@mreiche you are right. @madmecodes, please go ahead and adapt the flags description such that it uses tls for the registry aka a secure connection.
Summary
Fixes #899
The
--insecureflag inregistry createhad its default set totrue, which meant every registry was created as insecure even when the user didn't pass--insecure. Changed the default tofalseso registries are secure by default and the user has to opt in to insecure mode explicitly.Changes
cmd/harbor/root/registry/create.go: changedBoolVarPdefault fromtruetofalseTest plan
harbor registry create --name test --type docker-hub --url https://docker.iowithout--insecureand verifyinsecureisfalsein the output--insecureand verifyinsecureistrue