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
12 changes: 12 additions & 0 deletions pkg/ddc/base/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ type CachePath struct {
Quota *resource.Quantity
}

// BuildRuntimeInfo creates and initializes a RuntimeInfoInterface instance with the specified name, namespace, and runtime type.
// It applies any number of optional configuration functions (opts) to customize the runtime information before returning.
//
// Parameters:
// - name (string): The name of the runtime.
// - namespace (string): The namespace of the runtime.
// - runtimeType (string): The type of the runtime (e.g., Alluxio, JuiceFS).
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 examples provided for runtimeType ('Alluxio', 'JuiceFS') use capitalized names, which might be misleading as the actual runtime type strings in Fluid are typically lowercase (e.g., 'alluxio', 'juicefs') and are defined as constants in the common package. It is recommended to reference these constants directly (e.g., common.AlluxioRuntime) to ensure correctness and consistency with other documentation in this file (see line 619).

Suggested change
// - runtimeType (string): The type of the runtime (e.g., Alluxio, JuiceFS).
// - runtimeType (string): The type of the runtime (e.g., common.AlluxioRuntime, common.JuiceFSRuntime).

// - opts (...RuntimeInfoOption): Optional configuration functions that modify the RuntimeInfo struct.
//
// Returns:
// - runtime (RuntimeInfoInterface): A fully configured runtime information object.
// - err (error): Returns an error if any of the provided options fails to apply.
func BuildRuntimeInfo(name string,
namespace string,
runtimeType string,
Expand Down