From d0d38d830f38771de5249f9cb72fd35d6c7440a3 Mon Sep 17 00:00:00 2001 From: xs <3034819436@qq.com> Date: Tue, 27 May 2025 20:30:00 +0800 Subject: [PATCH 1/2] Add Notation to TestTransformPodMetadata(t *testing.T) in pkg\ddc\alluxio\transform_test.go. Signed-off-by: xs <3034819436@qq.com> --- pkg/ddc/alluxio/transform_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkg/ddc/alluxio/transform_test.go b/pkg/ddc/alluxio/transform_test.go index 9a881ee6022..7e98f34ab37 100755 --- a/pkg/ddc/alluxio/transform_test.go +++ b/pkg/ddc/alluxio/transform_test.go @@ -493,6 +493,23 @@ func TestTransformShortCircuit(t *testing.T) { } } + +// TestTransformPodMetadata tests the transformation of Pod metadata (labels and annotations) +// for AlluxioRuntime components. It verifies that common metadata specified in the Runtime's +// PodMetadata is correctly applied to Master, Worker, and Fuse components, while ensuring +// component-specific metadata overrides the common settings when present. +// +// Test cases: +// 1. Set common labels and annotations: +// Verifies that labels/annotations from Runtime.Spec.PodMetadata are propagated to +// all components (Master, Worker, Fuse) when no component-specific metadata exists. +// +// 2. Set master and worker labels/annotations: +// Validates that component-specific metadata in Master/Worker PodMetadata takes precedence +// over common metadata, while Fuse uses common metadata when no Fuse-specific settings exist. +// +// The test checks if the transformed Alluxio configuration matches the expected output +// after applying the metadata transformation rules. func TestTransformPodMetadata(t *testing.T) { engine := &AlluxioEngine{Log: fake.NullLogger()} From d51fdd63fb7161f71361d82390337fb0176076ce Mon Sep 17 00:00:00 2001 From: root Date: Thu, 29 May 2025 17:45:15 +0800 Subject: [PATCH 2/2] fix: format code with gofmt Signed-off-by: root --- pkg/ddc/alluxio/transform_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/ddc/alluxio/transform_test.go b/pkg/ddc/alluxio/transform_test.go index 7e98f34ab37..4f5be365de7 100755 --- a/pkg/ddc/alluxio/transform_test.go +++ b/pkg/ddc/alluxio/transform_test.go @@ -493,14 +493,13 @@ func TestTransformShortCircuit(t *testing.T) { } } - // TestTransformPodMetadata tests the transformation of Pod metadata (labels and annotations) // for AlluxioRuntime components. It verifies that common metadata specified in the Runtime's // PodMetadata is correctly applied to Master, Worker, and Fuse components, while ensuring // component-specific metadata overrides the common settings when present. // // Test cases: -// 1. Set common labels and annotations: +// 1. Set common labels and annotations: // Verifies that labels/annotations from Runtime.Spec.PodMetadata are propagated to // all components (Master, Worker, Fuse) when no component-specific metadata exists. //