Skip to content

Commit

Permalink
Merge pull request #3226 from KashifSaadat/fix-lifecycle-changes
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Correctly set lifecycle on LB resources

When the cluster is configured with an ELB, the following resources show up on every update as requiring changes:
```
Will modify resources:
  DNSName/api.kash-kops.example.com
  	Lifecycle           	 <nil> -> Sync

    LoadBalancer/api.kash-kops.example.com
    	Lifecycle           	 <nil> -> Sync

    LoadBalancerAttachment/api-master-eu-west-1a
    	Lifecycle           	 <nil> -> Sync

    LoadBalancerAttachment/api-master-eu-west-1b
    	Lifecycle           	 <nil> -> Sync

    LoadBalancerAttachment/api-master-eu-west-1c
    	Lifecycle           	 <nil> -> Sync
```

This PR sets the lifecycle property on the above awstask objects.
  • Loading branch information
Kubernetes Submit Queue authored Aug 17, 2017
2 parents 16f6fe4 + 34486b0 commit 189fa3c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions upup/pkg/fi/cloudup/awstasks/dnsname.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func (e *DNSName) Find(c *fi.Context) (*DNSName, error) {
actual.Zone = e.Zone
actual.Name = e.Name
actual.ResourceType = e.ResourceType
actual.Lifecycle = e.Lifecycle

if found.AliasTarget != nil {
dnsName := aws.StringValue(found.AliasTarget.DNSName)
Expand Down
5 changes: 2 additions & 3 deletions upup/pkg/fi/cloudup/awstasks/load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ package awstasks

import (
"fmt"

"sort"
"strconv"

"strings"

"github.com/aws/aws-sdk-go/aws"
Expand All @@ -32,7 +31,6 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
"k8s.io/kops/upup/pkg/fi/cloudup/cloudformation"
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
"sort"
)

// LoadBalancer manages an ELB. We find the existing ELB using the Name tag.
Expand Down Expand Up @@ -286,6 +284,7 @@ func (e *LoadBalancer) Find(c *fi.Context) (*LoadBalancer, error) {
actual.DNSName = lb.DNSName
actual.HostedZoneId = lb.CanonicalHostedZoneNameID
actual.Scheme = lb.Scheme
actual.Lifecycle = e.Lifecycle

for _, subnet := range lb.Subnets {
actual.Subnets = append(actual.Subnets, &Subnet{ID: subnet})
Expand Down
1 change: 1 addition & 0 deletions upup/pkg/fi/cloudup/awstasks/load_balancer_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (e *LoadBalancerAttachment) Find(c *fi.Context) (*LoadBalancerAttachment, e

// Prevent spurious changes
actual.Name = e.Name // ELB attachments don't have tags
actual.Lifecycle = e.Lifecycle

return actual, nil
}
Expand Down

0 comments on commit 189fa3c

Please sign in to comment.