Skip to content

Commit

Permalink
Modify error handling on loadbalancer task of ALICloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Lily922 committed Jun 4, 2018
1 parent 084989a commit 8f58f4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/model/alimodel/api_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package alimodel
import (
"errors"
"fmt"
"strings"

"k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/dns"
Expand Down Expand Up @@ -104,11 +105,13 @@ func (b *APILoadBalancerModelBuilder) Build(c *fi.ModelBuilderContext) error {
{

sourceItems := ""
var cidrs []string
for _, cidr := range b.Cluster.Spec.KubernetesAPIAccess {
if cidr != "0.0.0.0" && cidr != "0.0.0.0/0" {
sourceItems = sourceItems + cidr + ","
cidrs = append(cidrs, cidr)
}
}
sourceItems = strings.Join(cidrs, ",")

loadbalancerwhiteList = &alitasks.LoadBalancerWhiteList{
Name: s("api." + b.ClusterName()),
Expand Down
3 changes: 2 additions & 1 deletion upup/pkg/fi/cloudup/alitasks/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ func (l *LoadBalancer) Find(c *fi.Context) (*LoadBalancer, error) {
}
tags, _, err := cloud.SlbClient().DescribeTags(describeTagsArgs)
if err != nil {
glog.V(4).Info("Error getting tags on loadbalancerID:%q", *actual.LoadbalancerId)
return nil, fmt.Errorf("error getting tags on loadbalancer: %v", err)
}

if len(tags) != 0 {
actual.Tags = make(map[string]string)
for _, tag := range tags {
Expand Down

0 comments on commit 8f58f4e

Please sign in to comment.