Commit 9ef85a7e authored by Maxim Ivanov's avatar Maxim Ivanov

Restore buildTags in createTags

parent 54203aaa
......@@ -174,6 +174,10 @@ func (c *awsTagging) readRepairClusterTags(client EC2, resourceID string, lifecy
}
}
if len(addTags) == 0 {
return nil
}
if err := c.createTags(client, resourceID, lifecycle, addTags); err != nil {
return fmt.Errorf("error adding missing tags to resource %q: %v", resourceID, err)
}
......@@ -184,7 +188,9 @@ func (c *awsTagging) readRepairClusterTags(client EC2, resourceID string, lifecy
// createTags calls EC2 CreateTags, but adds retry-on-failure logic
// We retry mainly because if we create an object, we cannot tag it until it is "fully created" (eventual consistency)
// The error code varies though (depending on what we are tagging), so we simply retry on all errors
func (t *awsTagging) createTags(client EC2, resourceID string, lifecycle ResourceLifecycle, tags map[string]string) error {
func (t *awsTagging) createTags(client EC2, resourceID string, lifecycle ResourceLifecycle, additionalTags map[string]string) error {
tags := t.buildTags(lifecycle, additionalTags)
if tags == nil || len(tags) == 0 {
return nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment