mirror of https://github.com/kubernetes/kops.git
Sort external policies when checking for changes
This commit is contained in:
parent
86ea3694bd
commit
925350f836
|
|
@ -18,6 +18,7 @@ package model
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
|
|
@ -254,6 +255,7 @@ func (b *IAMModelBuilder) buildIAMTasks(role iam.Subject, iamName string, c *fi.
|
|||
p := *(b.Cluster.Spec.ExternalPolicies)
|
||||
externalPolicies = append(externalPolicies, p[roleKey]...)
|
||||
}
|
||||
sort.Strings(externalPolicies)
|
||||
|
||||
name := fmt.Sprintf("%s-policyoverride", roleKey)
|
||||
t := &awstasks.IAMRolePolicy{
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import (
|
|||
"fmt"
|
||||
"hash/fnv"
|
||||
"net/url"
|
||||
"sort"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
|
|
@ -76,6 +77,7 @@ func (e *IAMRolePolicy) Find(c *fi.Context) (*IAMRolePolicy, error) {
|
|||
policies = append(policies, aws.StringValue(policy.PolicyArn))
|
||||
}
|
||||
}
|
||||
sort.Strings(policies)
|
||||
|
||||
actual.ID = e.ID
|
||||
actual.Name = e.Name
|
||||
|
|
|
|||
Loading…
Reference in New Issue