Browse Source

Don't warn about containers without labels

master
Chris Smith 5 years ago
parent
commit
941fdf6315
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      dotege.go

+ 7
- 1
dotege.go View File

225
 }
225
 }
226
 
226
 
227
 func deployCertForContainer(container *model.Container) {
227
 func deployCertForContainer(container *model.Container) {
228
-	err, cert := certificateManager.GetCertificate(getHostnamesForContainer(container))
228
+	hostnames := getHostnamesForContainer(container)
229
+	if len(hostnames) == 0 {
230
+		logger.Debugf("No labels found for container %s", container.Name)
231
+		return
232
+	}
233
+
234
+	err, cert := certificateManager.GetCertificate(hostnames)
229
 	if err != nil {
235
 	if err != nil {
230
 		logger.Warnf("Unable to generate certificate for %s: %s", container.Name, err.Error())
236
 		logger.Warnf("Unable to generate certificate for %s: %s", container.Name, err.Error())
231
 	} else {
237
 	} else {

Loading…
Cancel
Save