Skip to content

Fix nas config and logConfig#135

Merged
rsonghuster merged 1 commit intomasterfrom
fix-nasConfig
Jan 20, 2026
Merged

Fix nas config and logConfig#135
rsonghuster merged 1 commit intomasterfrom
fix-nasConfig

Conversation

@liuzewen99
Copy link
Collaborator

No description provided.

@liuzewen99 liuzewen99 force-pushed the fix-nasConfig branch 4 times, most recently from abbd147 to b4c3f0d Compare January 19, 2026 10:20
Copy link
Contributor

Choose a reason for hiding this comment

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

这个感觉有点问题啊,不应该是跟 376-380 行一样的逻辑吗

Copy link
Contributor

Choose a reason for hiding this comment

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

这里已经是 sls Auto 的逻辑了, 为什么还有 existingLogConfig?

Copy link
Contributor

@rsonghuster rsonghuster Jan 19, 2026

Choose a reason for hiding this comment

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

mountDir 一般是 /home 或者 /mnt 开头, 你这个测试起来应该跑不过

Image

Copy link
Contributor

Choose a reason for hiding this comment

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

这个 params.serverAddr 名字叫 params.nasDir 更容易理解点, 而且和 fc 的 serverAddr 没有冲突

Copy link
Contributor

Choose a reason for hiding this comment

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

customMountDir 改成 fcDir 吧,更容易理解点

Copy link
Contributor

@rsonghuster rsonghuster Jan 19, 2026

Choose a reason for hiding this comment

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

如果这个函数仅仅是校验 fcDir

Image

我建议使用更科学的代码, 比如:

  1. 必须是 / 开头
  2. /mnt/ 和 /mnt 这种没有子目录的不被允许
  3. 这些前缀开头不被允许
    [
    '/bin', '/boot', '/dev', '/etc', '/lib', '/lib64',
    '/media', '/opt', '/proc', '/root', '/run',
    '/sbin', '/srv', '/sys', '/usr', '/var'
    ]
  4. 长度不要超过 128

Copy link
Contributor

Choose a reason for hiding this comment

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

265-286 行没有任何意思, 不满足直接报错就好了

Copy link
Contributor

Choose a reason for hiding this comment

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

直接报错

Copy link
Contributor

Choose a reason for hiding this comment

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

直接报错, 你传给 fc, fc 那边还是会报错, 还不如直接拦了

Copy link
Contributor

Choose a reason for hiding this comment

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

函数validateAndNormalizePath名字就叫 checkFcDir , 语义明确点

Copy link
Contributor

Choose a reason for hiding this comment

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

我只是举个例子啊! 不是固定的 /mnt 。。。。。

@liuzewen99 liuzewen99 force-pushed the fix-nasConfig branch 3 times, most recently from ad984e2 to 8c3890c Compare January 20, 2026 08:53
@rsonghuster rsonghuster merged commit 0cb5e83 into master Jan 20, 2026
7 of 8 checks passed
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.

2 participants

Comments