Skip to content
Merged
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
13 changes: 13 additions & 0 deletions pkg/ddc/base/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,19 @@ func GetRuntimeInfo(reader client.Reader, name, namespace string) (runtimeInfo R
return runtimeInfo, err
}

// GetRuntimeStatus gets the runtime status according to the runtime type, name, and namespace.
// This function is primarily responsible for retrieving the current status of a specific runtime
// based on its type from the Kubernetes cluster.
//
// Parameters:
// - client (client.Client): The Kubernetes client used to interact with the API server.
// - runtimeType (string): The type of the runtime (e.g., AlluxioRuntime, JindoRuntime, GooseFSRuntime).
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 (e.g., AlluxioRuntime) are potentially misleading. In Fluid, these types are typically represented as lowercase strings (e.g., "alluxio", "jindo", "goosefs") which correspond to the values of the constants in the common package. Using the CamelCase names might lead users to pass incorrect string values.

Suggested change
// - runtimeType (string): The type of the runtime (e.g., AlluxioRuntime, JindoRuntime, GooseFSRuntime).
// - runtimeType (string): The type of the runtime (e.g., "alluxio", "jindo", "goosefs").

// - name (string): The name of the runtime.
// - namespace (string): The namespace where the runtime is located.
//
// Returns:
// - status (*datav1alpha1.RuntimeStatus): The status of the requested runtime.
// - err (error): Returns an error if the runtime status cannot be retrieved or the runtime type is unsupported, otherwise returns nil.
func GetRuntimeStatus(client client.Client, runtimeType, name, namespace string) (status *datav1alpha1.RuntimeStatus, err error) {
switch runtimeType {
case common.AlluxioRuntime:
Expand Down
Loading