Skip to content
Closed
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
30 changes: 22 additions & 8 deletions pkg/ddc/alluxio/hcfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,32 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

// newAlluxioEngineHCFS creates and returns a new AlluxioEngine instance.
// It initializes the engine using the provided client, name, and namespace,
// and builds the Alluxio runtime information.
// Parameters:
// - client: The client used to interact with the Kubernetes API.
// - name: The name of the Alluxio engine.
// - namespace: The namespace of the Alluxio engine.
// Returns:
// - Returns a configured AlluxioEngine instance.
func newAlluxioEngineHCFS(client client.Client, name string, namespace string) *AlluxioEngine {
// Create a new AlluxioRuntime instance
runTime := &v1alpha1.AlluxioRuntime{}
// Build the Alluxio runtime information using the name and namespace
runTimeInfo, _ := base.BuildRuntimeInfo(name, namespace, "alluxio")

// Create and return a new AlluxioEngine instance
engine := &AlluxioEngine{
runtime: runTime,
name: name,
namespace: namespace,
Client: client,
runtimeInfo: runTimeInfo,
Log: fake.NullLogger(),
}
return engine
runtime: runTime, // Initialize the runtime object
name: name, // Set the engine name
namespace: namespace, // Set the engine namespace
Client: client, // Set the Kubernetes API client
runtimeInfo: runTimeInfo, // Set the runtime information
Log: fake.NullLogger(), // Set the logger (fake logger)
}

return engine // Return the configured AlluxioEngine instance
}

func TestGetHCFSStatus(t *testing.T) {
Expand Down
Loading