Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/ddc/efc/operations/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

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 the exec method (which wraps kubectl exec) does not invoke a shell by default. The pipe symbol will be treated as a literal argument to the mount command, causing it to fail. To fix this, the command should be executed via a shell, for example: []string{"sh", "-c", "mount | grep " + common.EFCMountType}.

// fails, it logs the error and returns false; otherwise, it returns true.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The comment notes that an error is logged if the command fails. In the current implementation (line 92), this is logged at the Error level. Since Ready() is typically used for polling readiness, a 'not ready' state (where grep returns a non-zero exit code) is an expected condition rather than an exceptional error. Logging this at the Error level may result in excessive log noise during normal operation. Consider using a lower log level for the 'not ready' case and only logging at the Error level for actual execution failures (e.g., pod connection issues).

func (a EFCFileUtils) Ready() (ready bool) {
var (
command = []string{"mount", "|", "grep", common.EFCMountType}
Expand Down
Loading