Skip to content

Commit

Permalink
Merge pull request #11444 from codablock/stable-ebs-tags
Browse files Browse the repository at this point in the history
Sort --extra-tags of ebs-csi-driver
  • Loading branch information
k8s-ci-robot committed May 10, 2021
2 parents d04946d + 859171e commit c3cd96b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions upup/pkg/fi/cloudup/template_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"fmt"
"os"
"path"
"sort"
"strconv"
"strings"
"text/template"
Expand Down Expand Up @@ -208,11 +209,15 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
}

dest["CsiExtraTags"] = func() string {
s := fmt.Sprintf("KubernetesCluster=%s", cluster.ObjectMeta.Name)
labels := []string{
fmt.Sprintf("KubernetesCluster=%s", cluster.ObjectMeta.Name),
}
for n, v := range cluster.Spec.CloudLabels {
s += fmt.Sprintf(",%s=%s", n, v)
labels = append(labels, fmt.Sprintf("%s=%s", n, v))
}
return s
// ensure stable sorting of tags
sort.Strings(labels)
return strings.Join(labels, ",")
}

dest["UseServiceAccountIAM"] = tf.UseServiceAccountIAM
Expand Down

0 comments on commit c3cd96b

Please sign in to comment.