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
This is another approach to solve the same problem as #3124
Adds ebs_tags_inherit_labels config option to propagate labels to EBS volume tags
Tags are compared against existing EBS tags (already fetched via DescribeVolumes) — CreateTags is only called when a tag is missing or has changed value
Tagging runs after populateVolumeMetaData in both mixed and ebs storage resize modes
Labels from the ebs_tags_inherit_labels that are not in the PostgreSQL CR and are in the EBS tags are removed
NOTE: This requires to add ec2:CreateTags and ec2:DeleteTags to the operator IAM role policy
Configuration
ebs_tags_inherit_labels: "application,team"
Test plan
Configure ebs_tags_inherit_labels in operator config
Create a PostgreSQL CR with the inherit labels
Verify EBS volumes are tagged with the correct values after a sync cycle
Update label value and verify the EBS tag is updated on the next sync
Verify no CreateTags calls are made when tags already match
Remove one of the inherit labels from the PostgreSQL CR
Verify EBS volume don't have the removed label
NOTE: This PR was written in part with the assistance of generative AI
As an option we can make the config more generic with the possibility to extend it later (e.g. aws_resources_inherit_labels), so the labels can be extended to other aws resources.
why can we not re-use the keys from inherited_labels config option to tag volumes. Is there a specific reason we want to have an extra options for volume tagging?
why can we not re-use the keys from inherited_labels config option to tag volumes. Is there a specific reason we want to have an extra options for volume tagging?
The issue is we cannot add the application to the inherited_labels and we would need it in the AWS resources (EBS volume and LBs). I also tried with a new config item to be opt-in for OS, and make it more generic than just magically convert our internal annotation to the application in the AWS resources.
The reason will be displayed to describe this comment to others. Learn more.
why is there a diff on teams_test.go? Can you remove it from this PR?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is another approach to solve the same problem as #3124
ebs_tags_inherit_labelsconfig option to propagate labels to EBS volume tagsDescribeVolumes) —CreateTagsis only called when a tag is missing or has changed valuepopulateVolumeMetaDatain bothmixedandebsstorage resize modesebs_tags_inherit_labelsthat are not in the PostgreSQL CR and are in the EBS tags are removedNOTE: This requires to add
ec2:CreateTagsandec2:DeleteTagsto the operator IAM role policyConfiguration
Test plan
NOTE: This PR was written in part with the assistance of generative AI