-
Notifications
You must be signed in to change notification settings - Fork 58
Skip downloading the cert if tinkServerTLS is not enabled #140
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,10 +13,11 @@ import ( | |
| ) | ||
|
|
||
| type tinkConfig struct { | ||
| registry string | ||
| baseURL string | ||
| tinkerbell string | ||
| syslogHost string | ||
| registry string | ||
| baseURL string | ||
| tinkerbell string | ||
| syslogHost string | ||
| tinkServerTLS bool | ||
|
|
||
| // TODO add others | ||
| } | ||
|
|
@@ -39,19 +40,22 @@ func main() { | |
| cmdLines := strings.Split(string(content), " ") | ||
| cfg := parseCmdLine(cmdLines) | ||
|
|
||
| path := fmt.Sprintf("/etc/docker/certs.d/%s/", cfg.registry) | ||
| // if tinkServerTLS is not enabled, skip downloading the certs | ||
| if cfg.tinkServerTLS { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this not be set in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I say we just get rid of this. Fetching the certs is very likely to be done in an unsafe manner and we're better off not making it easy to shoot your foot. |
||
| path := fmt.Sprintf("/etc/docker/certs.d/%s/", cfg.registry) | ||
|
|
||
| // Create the directory | ||
| err = os.MkdirAll(path, os.ModeDir) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| // Download the configuration | ||
| err = downloadFile(path+"ca.crt", cfg.baseURL+"/ca.pem") | ||
| if err != nil { | ||
| panic(err) | ||
| // Create the directory | ||
| err = os.MkdirAll(path, os.ModeDir) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| // Download the configuration | ||
| err = downloadFile(path+"ca.crt", cfg.baseURL+"/ca.pem") | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| fmt.Println("Downloaded the repository certificates, starting the Docker Engine") | ||
| } | ||
| fmt.Println("Downloaded the repository certificates, starting the Docker Engine") | ||
|
|
||
| d := dockerConfig{ | ||
| Debug: true, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't look like this value is being set anywhere. You might want to add to
parseCmdLine.