You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AWSCluster resources has a spec.AdditionalTags k-v map that is a place end users (aka me!) can place kvs that I want to use as resource tags in AWS (mostly for cost tracking).
The idea is that these tags are propagated to all resources descendent from the AWSCluster, such as ec2 instances and their root storage volumes.
Today, these tags make it to ec2 instances but not the root storage volumes. Only the awsmachine.spec.AdditionalTags make it to the root storage volumes. The layering of AdditionalTags is great for providing overrides (or additions) at various levels but the AdditionalTags from the AWSCluster should propagate to all resources.
I believe this is a bug; but I could imagine someone arguing that it is a design choice - it would be a surprising one and one that creates more work for the end user (as the user would need to explicitly also set AdditionalTags on the AWSMachine manifest).
Fix
This is an easy fix. See PR shortly.
Here's the ensureStorageTags method which only pulls tags from the machine L1121.
r.Log.Error(err, "Failed to fetch the changed volume tags in EC2 instance")
}
}
}
Just above its callsite, you can see that for ec2 instances the ensureTags method merges tags from the machine with those from the cluster through machineScope.AdditionalTags().
Bug Description
The AWSCluster resources has a spec.AdditionalTags k-v map that is a place end users (aka me!) can place kvs that I want to use as resource tags in AWS (mostly for cost tracking).
The idea is that these tags are propagated to all resources descendent from the AWSCluster, such as ec2 instances and their root storage volumes.
Today, these tags make it to ec2 instances but not the root storage volumes. Only the awsmachine.spec.AdditionalTags make it to the root storage volumes. The layering of AdditionalTags is great for providing overrides (or additions) at various levels but the
AdditionalTags
from theAWSCluster
should propagate to all resources.I believe this is a bug; but I could imagine someone arguing that it is a design choice - it would be a surprising one and one that creates more work for the end user (as the user would need to explicitly also set AdditionalTags on the AWSMachine manifest).
Fix
This is an easy fix. See PR shortly.
Here's the
ensureStorageTags
method which only pulls tags from the machine L1121.cluster-api-provider-aws/controllers/awsmachine_controller.go
Lines 1114 to 1140 in b90c18c
Just above its callsite, you can see that for ec2 instances the
ensureTags
method merges tags from the machine with those from the cluster throughmachineScope.AdditionalTags()
.cluster-api-provider-aws/controllers/awsmachine_controller.go
Lines 585 to 593 in b90c18c
Prior work
The
ensureStorageTags
method was introduced in this PR: #2463The text was updated successfully, but these errors were encountered: