Use IntOrString for TCP health check ports

Clean up code to be more testable.  Add test cases for named and numeric
ports in TCP health checks.  Improve tests.
This commit is contained in:
Tim Hockin
2014-08-10 23:44:42 -07:00
parent 7201227cb1
commit c67c1edfb4
4 changed files with 99 additions and 19 deletions

View File

@@ -146,8 +146,8 @@ type HTTPGetProbe struct {
// TCPSocketProbe describes a liveness probe based on opening a socket
type TCPSocketProbe struct {
// Port is the port to connect to. Required.
Port int `yaml:"port,omitempty" json:"port,omitempty"`
// Required: Port to connect to.
Port util.IntOrString `yaml:"port,omitempty" json:"port,omitempty"`
}
// LivenessProbe describes a liveness probe to be examined to the container.

View File

@@ -149,8 +149,8 @@ type HTTPGetProbe struct {
// TCPSocketProbe describes a liveness probe based on opening a socket
type TCPSocketProbe struct {
// Port is the port to connect to. Required.
Port int `yaml:"port,omitempty" json:"port,omitempty"`
// Required: Port to connect to.
Port util.IntOrString `yaml:"port,omitempty" json:"port,omitempty"`
}
// LivenessProbe describes a liveness probe to be examined to the container.