@@ -458,14 +458,14 @@ func (p *RedisProvider) TagElasticacheNode(ctx context.Context, elasticacheClien
458458 // Get default tags
459459 cacheTags , clusterID , err := p .getDefaultElasticacheTags (ctx , r )
460460 if err != nil {
461- msg := "Failed to build default tags"
461+ msg := "failed to build default tags"
462462 return croType .StatusMessage (msg ), errorUtil .Wrapf (err , msg )
463463 }
464464
465465 // Filter out already applied tags
466- filteredTags , err := filterAlreadyAppliedTags (ctx , elasticacheClient , arn , cacheTags )
466+ filteredTags , err := filterAlreadyAppliedTags (ctx , elasticacheClient , arn , * cache . CacheClusterId , cacheTags )
467467 if err != nil {
468- msg := "Failed to filter already applied tags"
468+ msg := "failed to filter already applied tags"
469469 return croType .StatusMessage (msg ), errorUtil .Wrapf (err , msg )
470470 }
471471
@@ -479,9 +479,9 @@ func (p *RedisProvider) TagElasticacheNode(ctx context.Context, elasticacheClien
479479 msg := "failed to add tags to aws elasticache :"
480480 return croType .StatusMessage (msg ), err
481481 }
482- logrus .Infof ("Successfully applied %d new/updated tags to cluster %s" , len (filteredTags ), arn )
482+ logrus .Infof ("successfully applied %d new/updated tags to cluster %s" , len (filteredTags ), * cache . CacheClusterId )
483483 } else {
484- logrus .Infof ("Redis cluster %s: no tag changes required" , arn )
484+ logrus .Infof ("redis cluster %s: no tag changes required" , * cache . CacheClusterId )
485485 }
486486
487487 // if snapshots exist add tags to them
@@ -497,7 +497,7 @@ func (p *RedisProvider) TagElasticacheNode(ctx context.Context, elasticacheClien
497497 resources .ResetMetric (metricName )
498498 for _ , snapshot := range snapshotList .Snapshots {
499499 snapshotArn := fmt .Sprintf ("arn:aws:elasticache:%s:%s:snapshot:%s" , region , * id .Account , * snapshot .SnapshotName )
500- logrus .Infof ("Adding operator tags to snapshot : %s" , * snapshot .SnapshotName )
500+ logrus .Infof ("adding operator tags to snapshot : %s" , * snapshot .SnapshotName )
501501 snapshotInput := & elasticache.AddTagsToResourceInput {
502502 ResourceName : aws .String (snapshotArn ),
503503 Tags : cacheTags ,
@@ -1260,6 +1260,7 @@ func (p *RedisProvider) applySpecifiedSecurityUpdates(ctx context.Context, elast
12601260 }
12611261 return nil
12621262}
1263+
12631264func (p * RedisProvider ) applyServiceUpdate (ctx context.Context , elasticacheClient ElastiCacheAPI , replicationgroupid , serviceupdateName * string ) error {
12641265 logger := p .Logger .WithField ("action" , "applyServiceUpdate" )
12651266
@@ -1292,14 +1293,14 @@ func validServiceUpdateStates(status string) bool {
12921293}
12931294
12941295// filterAlreadyAppliedTags removes tags from `desired` that already exist (same key and value) on the resource.
1295- func filterAlreadyAppliedTags (ctx context.Context , client ElastiCacheAPI , resourceARN string , desired []elasticachetypes.Tag ) ([]elasticachetypes.Tag , error ) {
1296+ func filterAlreadyAppliedTags (ctx context.Context , client ElastiCacheAPI , resourceARN string , cacheClusterID string , desired []elasticachetypes.Tag ) ([]elasticachetypes.Tag , error ) {
12961297 // List current tags on the resource
12971298 resp , err := client .ListTagsForResource (ctx , & elasticache.ListTagsForResourceInput {
12981299 ResourceName : aws .String (resourceARN ),
12991300 })
13001301 if err != nil {
13011302 // If we can't list tags (permission issue), fall back to applying all tags
1302- logrus .Warnf ("Could not list existing tags for %s: %v. Will attempt to apply all tags (may result in unnecessary API calls for already-applied tags)." , resourceARN , err )
1303+ logrus .Warnf ("could not list existing tags for %s: %v. Will attempt to apply all tags (may result in unnecessary API calls for already-applied tags)." , cacheClusterID , err )
13031304 return desired , nil
13041305 }
13051306
0 commit comments