-
Notifications
You must be signed in to change notification settings - Fork 1.2k
This PR is to add comments to Ready in pkg/ddc/efc/operations/base.go. #5812
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,6 +77,9 @@ func (a EFCFileUtils) DeleteDir(dir string) (err error) { | |
| return | ||
| } | ||
|
|
||
| // Ready checks whether the EFC mount type exists in the current runtime environment. | ||
| // It executes a mount command to search for the EFC mount type. If the command | ||
| // fails, it logs the error and returns false; otherwise, it returns true. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment notes that an error is logged if the command fails. In the current implementation (line 92), this is logged at the |
||
| func (a EFCFileUtils) Ready() (ready bool) { | ||
| var ( | ||
| command = []string{"mount", "|", "grep", common.EFCMountType} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment describes executing a mount command with a pipe (
|) to search for the EFC mount type. However, the implementation of the command on line 85 ([]string{"mount", "|", "grep", common.EFCMountType}) will not work as intended because theexecmethod (which wrapskubectl exec) does not invoke a shell by default. The pipe symbol will be treated as a literal argument to themountcommand, causing it to fail. To fix this, the command should be executed via a shell, for example:[]string{"sh", "-c", "mount | grep " + common.EFCMountType}.