Skip to content

Commit

Permalink
Merge pull request #10981 from hakman/automated-cherry-pick-of-#10976…
Browse files Browse the repository at this point in the history
…-upstream-release-1.20

Automated cherry pick of #10976: Add CloudLabels as --extra-tags to aws-ebs-csi driver
  • Loading branch information
k8s-ci-robot authored Mar 5, 2021
2 parents 808d915 + 0c580f1 commit eb8378c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion upup/models/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ spec:
- --endpoint=$(CSI_ENDPOINT)
- --logtostderr
- --k8s-tag-cluster-id={{ ClusterName }}
- --extra-tags=KubernetesCluster={{ ClusterName }}
- --extra-tags={{ CsiExtraTags }}
- --v=5
env:
- name: CSI_ENDPOINT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ func (b *BootstrapChannelBuilder) buildAddons(c *fi.ModelBuilderContext) (*chann
if b.Cluster.Spec.CloudConfig != nil && b.Cluster.Spec.CloudConfig.AWSEBSCSIDriver != nil && fi.BoolValue(b.Cluster.Spec.CloudConfig.AWSEBSCSIDriver.Enabled) {
key := "aws-ebs-csi-driver.addons.k8s.io"

version := "0.8.0-kops.1"
version := "0.8.0-kops.2"
{
id := "k8s-1.17"
location := key + "/" + id + ".yaml"
Expand Down
8 changes: 8 additions & 0 deletions upup/pkg/fi/cloudup/template_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
dest["WeaveSecret"] = func() string { return weavesecretString }
}

dest["CsiExtraTags"] = func() string {
s := fmt.Sprintf("KubernetesCluster=%s", cluster.ObjectMeta.Name)
for n, v := range cluster.Spec.CloudLabels {
s += fmt.Sprintf(",%s=%s", n, v)
}
return s
}

return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ spec:
name: aws-ebs-csi-driver.addons.k8s.io
selector:
k8s-addon: aws-ebs-csi-driver.addons.k8s.io
version: 0.8.0-kops.1
version: 0.8.0-kops.2

0 comments on commit eb8378c

Please sign in to comment.