util

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EngineVersionsMatch

func EngineVersionsMatch(desiredEV, latestEV string) bool

EngineVersionsMatch returns true if desired and latest engine versions match and false otherwise precondition: both desiredEV and latestEV are non-nil this handles the case where only the major EV is specified, e.g. "6.x" (or similar), but the latest version shows the minor version, e.g. "6.0.5".

func GetTags

func GetTags(
	ctx context.Context,
	sdkapi elasticacheiface.ElastiCacheAPI,
	metrics *metrics.Metrics,
	resourceARN string,
) ([]*svcapitypes.Tag, error)

GetTags retrieves the resource's associated tags.

func SyncTags

func SyncTags(
	ctx context.Context,
	desiredTags []*svcapitypes.Tag,
	latestTags []*svcapitypes.Tag,
	latestACKResourceMetadata *ackv1alpha1.ResourceMetadata,
	toACKTags func(tags []*svcapitypes.Tag) acktags.Tags,
	sdkapi elasticacheiface.ElastiCacheAPI,
	metrics *metrics.Metrics,
) (err error)

SyncTags keeps the resource's tags in sync

NOTE(jaypipes): Elasticache's Tagging APIs differ from other AWS APIs in the following ways:

  1. The names of the tagging API operations are different. Other APIs use the Tagris `ListTagsForResource`, `TagResource` and `UntagResource` API calls. RDS uses `ListTagsForResource`, `AddTagsToResource` and `RemoveTagsFromResource`.

  2. Even though the name of the `ListTagsForResource` API call is the same, the structure of the input and the output are different from other APIs. For the input, instead of a `ResourceArn` field, Elasticache names the field `ResourceName`, but actually expects an ARN, not the cache cluster name. This is the same for the `AddTagsToResource` and `RemoveTagsFromResource` input shapes. For the output shape, the field is called `TagList` instead of `Tags` but is otherwise the same struct with a `Key` and `Value` member field.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL