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/alluxio/ufs.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import (
"os"
)

// IsMountWithConfigMap checks if the mount configuration is stored in a ConfigMap.
// It looks up the environment variable MountConfigStorage and compares it to ConfigmapStorageName.
// If the environment variable is set and matches, it returns true; otherwise, it returns the default value 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 description of the function's behavior is not entirely accurate. It omits the case where the environment variable is set but does not match ConfigmapStorageName, in which the function would return false. This can be misleading to developers reading the code. A more precise comment would improve clarity.

Suggested change
// If the environment variable is set and matches, it returns true; otherwise, it returns the default value true.
// If the environment variable is set, it returns true if the value matches ConfigmapStorageName, and false otherwise. If the variable is not set, it defaults to true.

func IsMountWithConfigMap() bool {
if envVal, exists := os.LookupEnv(MountConfigStorage); exists {
return envVal == ConfigmapStorageName
Expand Down
Loading