Skip to content

Conversation

xescugc
Copy link
Member

@xescugc xescugc commented Aug 25, 2021

As in some cases, like 'tags', they have keys that cannot be converted directly into variables names
so we have to normalize them.

For this we reused the 'tag' logic and abstracted it to the 'util' lib so it can be shared between the 2 packages

Closes #218

@xescugc xescugc self-assigned this Aug 25, 2021
@xescugc xescugc force-pushed the fg-normalize-variables branch 2 times, most recently from 6188405 to 3e9bf14 Compare August 30, 2021 11:25
util/name.go Outdated

var invalidNameRegexp = regexp.MustCompile(`[^a-z0-9_]`)

// NormalizeName will convert the n into an low case alphanymeric value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lower-case alphanumeric* ?
I guess it's normal for empty string not to be checked here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say yes, it's a helper to normalize things.

Copy link
Contributor

@xlr-8 xlr-8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RS & merge

As in some cases, like 'tags', they have keys that cannot be converted direclty into valirables names
so we have to normailze them.

For this we reused the 'tag' logic and abstracted it to the 'util' lib so it can be shared between the 2 packages
@xescugc xescugc force-pushed the fg-normalize-variables branch from d45609f to c3d0094 Compare August 30, 2021 14:02
@xescugc xescugc merged commit 09f8688 into master Aug 30, 2021
@xescugc xescugc deleted the fg-normalize-variables branch August 30, 2021 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS provider giving some gibberish in tags.
2 participants