From 94dbb9037c643dfa76134c8e8e9bf7b206ef34b7 Mon Sep 17 00:00:00 2001 From: ZKK-830 <231220034@smail.nju.edu.cn> Date: Mon, 15 Jun 2026 17:46:03 +0800 Subject: [PATCH] Add comments/notation to mockAlluxioObjectsForTests in pkg/ddc/alluxio/mock_utils.go. Signed-off-by: ZKK-830 <231220034@smail.nju.edu.cn> --- pkg/ddc/alluxio/mock_utils.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/ddc/alluxio/mock_utils.go b/pkg/ddc/alluxio/mock_utils.go index f64abfa42bf..52ec81186d8 100644 --- a/pkg/ddc/alluxio/mock_utils.go +++ b/pkg/ddc/alluxio/mock_utils.go @@ -141,6 +141,12 @@ func mockAlluxioEngineForTests(dataset *datav1alpha1.Dataset, runtime *datav1alp return engine } +// mockAlluxioObjectsForTests creates mocked Kubernetes resources for Alluxio unit tests. +// It validates that the given dataset and runtime form a valid pair (matching namespace, +// name and owner reference) and panics otherwise. Based on the provided dataset, runtime +// and engine, it constructs master and worker StatefulSets, fuse DaemonSet, master Services, +// ConfigMaps, PersistentVolume and PersistentVolumeClaim with labels and owner references +// consistent with a Fluid-managed Alluxio deployment. func mockAlluxioObjectsForTests(dataset *datav1alpha1.Dataset, runtime *datav1alpha1.AlluxioRuntime, engine *AlluxioEngine) mockedObjects { if dataset.Namespace != runtime.Namespace || dataset.Name != runtime.Name ||