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

镜像仓库凭证包含$导致解析问题 #147

Open
TIEDPAG opened this issue Apr 2, 2024 · 0 comments
Open

镜像仓库凭证包含$导致解析问题 #147

TIEDPAG opened this issue Apr 2, 2024 · 0 comments

Comments

@TIEDPAG
Copy link

TIEDPAG commented Apr 2, 2024

Issue Description

Type: feature request
提供关闭凭证使用os.ExpandEnv的方式

Describe what feature you want

我们使用过程中遇到一个问题,当镜像仓库的帐号包含$时,如aaa$bbb,最终经过解析之后变为了aaa,翻查了一下代码
发现是使用了os.ExpandEnv导致的,不把凭证直接写入到文件确实是最佳实践,但是如果将凭证存储到环境变量时,一般是使用纯环境变量,而不是拼接的方式,我有以下建议:

  • 提供不使用os.ExpandEnvapi处理用户/密码的方式
  • 仅对以$开头的值进行渲染
  • 使用新的明确功能的字段来使用,比如用户可以使用username/usernameForEnv两者其中之一来设置其对应值

Additional context

这里提供代码路径和截图: image-syncer/pkg/client
image

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

No branches or pull requests

1 participant