Implement replicaLoadBalancer boolean flag. (#38)

The flag adds a replica service with the name cluster_name-repl and
a DNS name that defaults to {cluster}-repl.{team}.{hostedzone}.

The implementation converted Service field of the cluster into a map
with one or two elements and deals with the cases when the new flag
is changed on a running cluster
(the update and the sync should create or delete the replica service).
In order to pick up master and replica service and master endpoint
when listing cluster resources.

* Update the spec when updating the cluster.
This commit is contained in:
Oleksii Kliukin
2017-06-07 13:54:17 +02:00
committed by GitHub
parent 7b0ca31bfb
commit dc36c4ca12
26 changed files with 329 additions and 166 deletions
+4 -4
View File
@@ -9,7 +9,7 @@ import (
"time"
)
type Decoder interface {
type decoder interface {
Decode(value string) error
}
@@ -21,15 +21,15 @@ type fieldInfo struct {
type stringTemplate string
func decoderFrom(field reflect.Value) (d Decoder) {
func decoderFrom(field reflect.Value) (d decoder) {
// it may be impossible for a struct field to fail this check
if !field.CanInterface() {
return
}
d, ok := field.Interface().(Decoder)
d, ok := field.Interface().(decoder)
if !ok && field.CanAddr() {
d, _ = field.Addr().Interface().(Decoder)
d, _ = field.Addr().Interface().(decoder)
}
return d