alphagov/vcloud-edge_gateway — pull request #65 by mattbostock (2014-05-15 13:14:12+00:00)
Title: [#71128590] Don't set healthcheck URI for non-HTTP checks

Don't set a healthcheck URI for non-HTTP load balancer healthchecks.

In vCloud Director version 5.1 and 5.5, VMWare does not support a
healthcheck URI for SSL healthchecks[1]. In vCloud Director version 5.5,
a load balancer will refuse connections if a health check URL is set for
an SSL healthcheck.

TCP healthchecks obviously do not support a healthcheck URI given they
do not operate at layer 7.

This also fixes an issue related to ecfba39; that commit checks for a pool
service protocol of HTTP and sets the healthcheck URL accordingly. The
changes there did not however account for configurations where the pool
uses HTTP as the service protocol but TCP for the healthcheck.

The logic here is necessarily complex because we deal with:
- defined configuration versus the default
- healthcheck protocols (default or defined) versus service protocols

Raise an exception if a healthcheck URI is specified for a load
balancer healthcheck using any protocol other than HTTP.

Also adds tests for the above behaviour:

- Add a spec test to ensure that the default URI for healthchecks
using the HTTP protocol is '/'. The behaviour we are testing for was
implemented in e9c524b.

- Add a spec test to ensure that the default URI for healthchecks
using the HTTPS protocol is ''. The behaviour we are testing for was
implemented in e9c524b.

- Add a spec test to ensure that the default URI for healthchecks
using the TCP protocol, when the load balancer service protocol is
'HTTP', is ''. The behaviour we are testing for was implemented in
this same commit.

- Add two spec tests that expect an exception to be raised if we
attempt to define a healthcheck URI for a TCP or HTTPS healthcheck.
Only HTTP healthchecks support a healthcheck URI. The behaviour we
are testing for was implemented in this same commit.

* * *

Also bump version to 0.5.0.

[1]:
http://pubs.vmware.com/vcd-55/topic/com.vmware.vcloud.admin.doc_55/GUID-C12B3954-155F-48AF-9855-E0DE026752D0.html