feat(publisher): Check if app port is open before publishing it. Fixes 3115 #3156
Conversation
@glogiotatidis why use ExecStartPost like in deis-builder?. |
@@ -113,12 +115,29 @@ func (s *Server) IsPublishableApp(name string) bool { | |||
log.Println(err) | |||
return false | |||
} | |||
if version >= latestRunningVersion(s.EtcdClient, appName) { | |||
|
|||
if version >= latestRunningVersion(s.EtcdClient, appName) && isPortOpen(hostAndPort) { |
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.
let's separate this call out on line 96. IsPublishableApp determines if the container name follows a regex, where IsPortOpen would be useful on its own.
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.
Updated.
1b90854
to
297d915
Compare
@aledbf I'm not aware of this fleet functionality. I'd prefer thought that this goes to publisher so that Deis gets to have the final call and it's fleetd independent. Thanks for the suggestion though :) |
https://get.docker.io is currently down, so this may fail until we can merge #3162 and rebase it off that. |
…s 3115 Check if the port that container exposes is open before adding to Etcd.
Rebased |
Having publisher check that the app port is open before publishing it seems like a good idea. Code LGTM. |
ooh, tests and everything! LGTM! |
feat(publisher): Check if app port is open before publishing it. Fixes 3115
nice work, @glogiotatidis |
Great! |
fixes #3115