Skip to content

Commit

Permalink
Skip the iamPolicy.DNSZone task when using gossip
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciprian Hacman committed Sep 10, 2020
1 parent a5fc889 commit e42a010
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/model/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"k8s.io/klog/v2"
"k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/dns"
"k8s.io/kops/pkg/model/iam"
"k8s.io/kops/pkg/util/stringorslice"
"k8s.io/kops/upup/pkg/fi"
Expand Down Expand Up @@ -164,11 +165,13 @@ func (b *IAMModelBuilder) buildIAMRolePolicy(role iam.Subject, iamName string, i
},
}

// This is slightly tricky; we need to know the hosted zone id,
// but we might be creating the hosted zone dynamically.
// We create a stub-reference which will be combined by the execution engine.
iamPolicy.DNSZone = &awstasks.DNSZone{
Name: fi.String(b.NameForDNSZone()),
if dns.IsGossipHostname(b.Cluster.ObjectMeta.Name) {
// This is slightly tricky; we need to know the hosted zone id,
// but we might be creating the hosted zone dynamically.
// We create a stub-reference which will be combined by the execution engine.
iamPolicy.DNSZone = &awstasks.DNSZone{
Name: fi.String(b.NameForDNSZone()),
}
}

t := &awstasks.IAMRolePolicy{
Expand Down

0 comments on commit e42a010

Please sign in to comment.