Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flagext: Add new type URLEscaped #265

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kavirajk
Copy link
Contributor

@kavirajk kavirajk commented Feb 7, 2023

What this PR does:
Sometimes we need to store just escaped URL in the config like S3 URL that contains credentials which can include characters like : and /. Currently we cannot use normal flagext.URLValue as it just uses unescaped URL.

Please check issue
grafana/loki#1607

Which issue(s) this PR fixes:

Fixes grafana/loki#1607

Checklist

  • Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Sometimes we need to store just escaped URL in the config like S3 URL that contains credentials which can include characters like
`:` and `/`. Currently we cannot use normal `flagext.URLValue` as it just uses unescaped URL.

Please check issue
grafana/loki#1607
kavirajk added a commit to grafana/loki that referenced this pull request Feb 7, 2023
Fixes: #1607

Introduced this type in another PR
grafana/dskit#265
@kavirajk kavirajk marked this pull request as ready for review February 7, 2023 21:43
@pstibrany
Copy link
Member

Is this work around for properly formatting strings in YAML file?

@kavirajk
Copy link
Contributor Author

kavirajk commented Feb 8, 2023

Is this work around for properly formatting strings in YAML file?

Kinda. So basically user should be able to give unescaped S3 bucket URL in both yaml config and as a CLI flag.

Our internal dependency aws.ConfigFromURL expects escaped URL always (from weaveworks/common).

Trying to transparenly handle this case. But realized it's hard to do it in backward compatible way. e.g: If people already working with escaped URL. Tried few things but looks bit tricky. Converting to draft PR till I find right way to do it.

@kavirajk kavirajk marked this pull request as draft February 8, 2023 08:04
Signed-off-by: Kaviraj <[email protected]>
charleskorn pushed a commit that referenced this pull request Aug 3, 2023
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.

s3_secret_access_key does not allow slashes
2 participants