From 6a2c542c02046aac5cf0592646e47ed6ed7260c0 Mon Sep 17 00:00:00 2001 From: Rohith Date: Mon, 11 Jun 2018 10:38:42 +0100 Subject: [PATCH] - fixing up the spelling mistake; was probably added before the verify-misspelling PR --- upup/pkg/fi/cloudup/alitasks/loadbalancer.go | 4 ++-- upup/pkg/fi/cloudup/template_functions.go | 16 +++------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/upup/pkg/fi/cloudup/alitasks/loadbalancer.go b/upup/pkg/fi/cloudup/alitasks/loadbalancer.go index 9566bf6e13..218d4ad010 100644 --- a/upup/pkg/fi/cloudup/alitasks/loadbalancer.go +++ b/upup/pkg/fi/cloudup/alitasks/loadbalancer.go @@ -68,7 +68,7 @@ func (l *LoadBalancer) Find(c *fi.Context) (*LoadBalancer, error) { return nil, nil } if len(responseLoadBalancers) > 1 { - glog.V(4).Info("The number of specified loadbalancer whith the same name exceeds 1, loadbalancerName:%q", *l.Name) + glog.V(4).Info("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", *l.Name) } glog.V(2).Infof("found matching LoadBalancer: %q", *l.Name) @@ -122,7 +122,7 @@ func (l *LoadBalancer) FindIPAddress(context *fi.Context) (*string, error) { return nil, nil } if len(responseLoadBalancers) > 1 { - glog.V(4).Info("The number of specified loadbalancer whith the same name exceeds 1, loadbalancerName:%q", *l.Name) + glog.V(4).Info("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", *l.Name) } address := responseLoadBalancers[0].Address diff --git a/upup/pkg/fi/cloudup/template_functions.go b/upup/pkg/fi/cloudup/template_functions.go index 77baeb1466..84ec8f3228 100644 --- a/upup/pkg/fi/cloudup/template_functions.go +++ b/upup/pkg/fi/cloudup/template_functions.go @@ -59,8 +59,9 @@ type TemplateFunctions struct { func (tf *TemplateFunctions) AddTo(dest template.FuncMap) { dest["EtcdScheme"] = tf.EtcdScheme dest["SharedVPC"] = tf.SharedVPC - dest["UseEtcdTLS"] = tf.UseEtcdTLS dest["ToJSON"] = tf.ToJSON + dest["UseBootstrapTokens"] = tf.modelContext.UseBootstrapTokens + dest["UseEtcdTLS"] = tf.modelContext.UseEtcdTLS // Remember that we may be on a different arch from the target. Hard-code for now. dest["Arch"] = func() string { return "amd64" } dest["replace"] = func(s, find, replace string) string { @@ -110,17 +111,6 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap) { } } -// UseEtcdTLS checks if cluster is using etcd tls -func (tf *TemplateFunctions) UseEtcdTLS() bool { - for _, x := range tf.cluster.Spec.EtcdClusters { - if x.EnableEtcdTLS { - return true - } - } - - return false -} - // ToJSON returns a json representation of the struct or on error an empty string func (tf *TemplateFunctions) ToJSON(data interface{}) string { encoded, err := json.Marshal(data) @@ -133,7 +123,7 @@ func (tf *TemplateFunctions) ToJSON(data interface{}) string { // EtcdScheme parses and grabs the protocol to the etcd cluster func (tf *TemplateFunctions) EtcdScheme() string { - if tf.UseEtcdTLS() { + if tf.modelContext.UseEtcdTLS() { return "https" }