Skip to content

Commit 15fb4ee

Browse files
committed
fix CI issue
1 parent 1966494 commit 15fb4ee

11 files changed

Lines changed: 54 additions & 52 deletions

pkg/ddc/alluxio/cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ func (e *AlluxioEngine) queryCacheStatus() (states cacheStates, err error) {
6868
// - When the Dataset's UfsTotal field is empty
6969
// - When the Dataset's UfsTotal field contains the metadata sync pending message
7070
// The cached percentage is calculated as (cached bytes / UfsTotal bytes) * 100.
71-
//
71+
//
7272
// Parameters:
7373
// - dataset (v1alpha1.Dataset): Pointer to the Dataset object containing UFS metadata.
7474
// The Status.UfsTotal field must be a valid human-readable size string (e.g. "10GiB")
7575
// - states (cacheStates): Pointer to the cache state structure that will be modified in-place.
7676
// The cached field must be a valid human-readable size string (e.g. "5GiB")
77-
//
77+
//
7878
// Returns:
7979
// - None: Modifies the states.cachedPercentage field directly with formatted percentage string.
8080
// The percentage is stored as a string using cachedPercentageFormat (e.g. "45.60%")

pkg/ddc/alluxio/load_data.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ func (e *AlluxioEngine) genDataLoadValue(image string, targetDataset *datav1alph
175175
// It obtains master pod details, creates file utilities, and checks readiness.
176176
//
177177
// Returns:
178-
// ready bool - Runtime readiness status (true = ready, false = not ready).
178+
//
179+
// ready bool - Runtime readiness status (true = ready, false = not ready).
179180
func (e *AlluxioEngine) CheckRuntimeReady() (ready bool) {
180181
podName, containerName := e.getMasterPodInfo()
181182
fileUtils := operations.NewAlluxioFileUtils(podName, containerName, e.namespace, e.Log)

pkg/ddc/alluxio/transform_resources.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ func (e *AlluxioEngine) transformResourcesForMaster(runtime *datav1alpha1.Alluxi
4848
}
4949

5050
// transformResourcesForWorker is responsible for transforming and setting resource limits for the Alluxio Worker component.
51-
// This function updates the resource requirements for the Worker and JobWorker based on the runtime configuration
51+
// This function updates the resource requirements for the Worker and JobWorker based on the runtime configuration
5252
// and ensures that memory requests meet the required constraints.
5353
//
5454
// Parameters:
55-
// - runtime: *datav1alpha1.AlluxioRuntime, the runtime configuration of Alluxio, including resource definitions
56-
// for Worker and JobWorker.
55+
// - runtime: *datav1alpha1.AlluxioRuntime, the runtime configuration of Alluxio, including resource definitions
56+
// for Worker and JobWorker.
5757
// - value: *Alluxio, the Alluxio runtime instance used to store the transformed resource information.
58-
//
58+
//
5959
// Return value:
6060
// - error: Returns an error if any issue occurs during resource transformation; otherwise, returns nil.
6161
func (e *AlluxioEngine) transformResourcesForWorker(runtime *datav1alpha1.AlluxioRuntime, value *Alluxio) error {

pkg/ddc/alluxio/transform_resources_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,12 @@ func TestTransformResourcesForWorkerWithOnlyRequest(t *testing.T) {
450450
// resource requests are handled as expected.
451451
//
452452
// The function performs the following steps:
453-
// 1. Defines resource requirements with limits for memory (20Gi) and CPU (500m).
454-
// 2. Sets up test cases to validate the transformation logic, including scenarios with and without
455-
// tiered store configurations.
456-
// 3. Initializes an AlluxioEngine instance with a fake client and runtime objects for testing.
457-
// 4. Transforms the resource requirements for the worker using the AlluxioEngine.
458-
// 5. Validates the transformed resource limits and requests against the expected results.
453+
// 1. Defines resource requirements with limits for memory (20Gi) and CPU (500m).
454+
// 2. Sets up test cases to validate the transformation logic, including scenarios with and without
455+
// tiered store configurations.
456+
// 3. Initializes an AlluxioEngine instance with a fake client and runtime objects for testing.
457+
// 4. Transforms the resource requirements for the worker using the AlluxioEngine.
458+
// 5. Validates the transformed resource limits and requests against the expected results.
459459
//
460460
// Test cases include:
461461
// - A scenario where tiered store configuration is provided, ensuring memory limits and requests are set correctly.

pkg/ddc/alluxio/transform_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ func TestTransformMaster(t *testing.T) {
183183
}
184184
}
185185

186-
// TestTransformWorkers verifies that the transformWorkers function correctly transforms
187-
// the worker configuration of AlluxioRuntime into the expected Alluxio structure.
188-
// It tests different network modes, node selectors, and image pull secrets to ensure
186+
// TestTransformWorkers verifies that the transformWorkers function correctly transforms
187+
// the worker configuration of AlluxioRuntime into the expected Alluxio structure.
188+
// It tests different network modes, node selectors, and image pull secrets to ensure
189189
// correct transformation behavior.
190190
func TestTransformWorkers(t *testing.T) {
191191
testCases := map[string]struct {
@@ -882,10 +882,10 @@ func TestAlluxioEngine_allocatePorts(t *testing.T) {
882882
//
883883
// Test Cases:
884884
// 1. "master properties is not null":
885-
// - Ensures that when master-specific properties exist, they override the global properties.
885+
// - Ensures that when master-specific properties exist, they override the global properties.
886886
//
887887
// 2. "properties is not null for master":
888-
// - Ensures that both master-specific and additional global properties are correctly handled.
888+
// - Ensures that both master-specific and additional global properties are correctly handled.
889889
//
890890
// The function iterates over multiple test cases and checks if the transformed properties
891891
// match the expected values. If the transformation does not produce the expected result, the test fails.

pkg/ddc/jindo/dataset_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ func TestUpdateDatasetStatus(t *testing.T) {
253253
}
254254
}
255255

256-
// TestBindToDataset tests the BindToDataset method of JindoEngine to verify whether it can correctly bind the dataset to the runtime
257-
// and update the dataset's cache state and HCFS status. The test creates mock Dataset and JindoRuntime objects,
256+
// TestBindToDataset tests the BindToDataset method of JindoEngine to verify whether it can correctly bind the dataset to the runtime
257+
// and update the dataset's cache state and HCFS status. The test creates mock Dataset and JindoRuntime objects,
258258
// uses a fake client to simulate operations, and finally checks if the dataset's Phase, CacheStates, and HCFSStatus match the expected results.
259259
func TestBindToDataset(t *testing.T) {
260260
testDatasetInputs := []*datav1alpha1.Dataset{

pkg/ddc/jindo/delete_volume_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,19 @@ func doTestCases(testCases []TestCase, t *testing.T) {
8383
//
8484
// Test Strategy:
8585
// 1. Setup test environment with mocked Kubernetes resources:
86-
// - PVs with 'CreatedBy=fluid' annotation to simulate Fluid-managed persistent volumes
87-
// - PVCs with different configurations (normal vs error cases)
88-
// 2. Create 3 test scenarios using parameterized test pattern:
89-
// Case 1: Normal deletion (JindoEngineCommon)
90-
// - Input: Valid PV/PVC without conflicting annotations
91-
// - Expected: Successful deletion (isDeleted=true, isErr=false)
92-
// Case 2: Protected PVC deletion (JindoEngineErr)
93-
// - Input: PVC with 'CreatedBy=fluid' annotation (protected resource)
94-
// - Expected: Failed deletion (isErr=true)
95-
// Case 3: Missing runtime scenario (JindoEngineNoRunTime)
96-
// - Input: Engine with runtime=false configuration
97-
// - Expected: Failed deletion (isErr=true)
98-
// 3. Verification: Uses doTestCases() helper to validate deletion outcomes against expectations
86+
// - PVs with 'CreatedBy=fluid' annotation to simulate Fluid-managed persistent volumes
87+
// - PVCs with different configurations (normal vs error cases)
88+
// 2. Create 3 test scenarios using parameterized test pattern:
89+
// Case 1: Normal deletion (JindoEngineCommon)
90+
// - Input: Valid PV/PVC without conflicting annotations
91+
// - Expected: Successful deletion (isDeleted=true, isErr=false)
92+
// Case 2: Protected PVC deletion (JindoEngineErr)
93+
// - Input: PVC with 'CreatedBy=fluid' annotation (protected resource)
94+
// - Expected: Failed deletion (isErr=true)
95+
// Case 3: Missing runtime scenario (JindoEngineNoRunTime)
96+
// - Input: Engine with runtime=false configuration
97+
// - Expected: Failed deletion (isErr=true)
98+
// 3. Verification: Uses doTestCases() helper to validate deletion outcomes against expectations
9999
//
100100
// Test Resources:
101101
// - fake.NewFakeClientWithScheme: Simulates Kubernetes API server with predefined resources

pkg/ddc/juicefs/datasetinfo_parser.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,21 @@ func GetFSInfoFromConfigMap(client client.Client, name string, namespace string)
6767
return parseFSInfoFromConfigMap(configMap)
6868
}
6969

70-
// parseFSInfoFromConfigMap extracts file system configuration information
71-
// from the provided ConfigMap. It parses the data field of the ConfigMap
72-
// into a JuiceFS structure and populates the returned map with relevant
73-
// configuration details. If the parsing fails or the data field is missing,
70+
// parseFSInfoFromConfigMap extracts file system configuration information
71+
// from the provided ConfigMap. It parses the data field of the ConfigMap
72+
// into a JuiceFS structure and populates the returned map with relevant
73+
// configuration details. If the parsing fails or the data field is missing,
7474
// an error is returned.
7575
//
7676
// Parameters:
77-
// - configMap: A pointer to a v1.ConfigMap object that contains the
78-
// configuration data.
77+
// - configMap: A pointer to a v1.ConfigMap object that contains the
78+
// configuration data.
7979
//
8080
// Returns:
81-
// - info: A map containing parsed configuration details such as MetaUrlSecret,
82-
// TokenSecret, AccessKeySecret, SecretKeySecret, FormatCmd, Name, and Edition.
83-
// - err: An error if the data parsing process fails or if the required data
84-
// field is missing.
81+
// - info: A map containing parsed configuration details such as MetaUrlSecret,
82+
// TokenSecret, AccessKeySecret, SecretKeySecret, FormatCmd, Name, and Edition.
83+
// - err: An error if the data parsing process fails or if the required data
84+
// field is missing.
8585
func parseFSInfoFromConfigMap(configMap *v1.ConfigMap) (info map[string]string, err error) {
8686
var value JuiceFS
8787
info = map[string]string{}

pkg/ddc/juicefs/datasetinfo_parser_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func TestGetFSInfoFromConfigMap(t *testing.T) {
170170
}
171171

172172
// Test_parseFSInfoFromConfigMap is a unit test function for the parseFSInfoFromConfigMap method.
173-
// It validates whether the function correctly extracts and parses dataset information
173+
// It validates whether the function correctly extracts and parses dataset information
174174
// from a given Kubernetes ConfigMap.
175175
//
176176
// Steps:

pkg/ddc/juicefs/delete_volume_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ type TestCase struct {
4141

4242
// newTestJuiceEngine creates a JuiceFSEngine for testing
4343
// Parameters:
44-
// - client: fake client
44+
// - client: fake client
4545
// - name: the name of the JuiceFS engine
4646
// - namespace: the namespace of the JuiceFS engine
4747
// - withRunTime: whether the JuiceFS engine has runtime
48+
//
4849
// Returns:
4950
// - JuiceFSEngine: the JuiceFS engine for testing
5051
func newTestJuiceEngine(client client.Client, name string, namespace string, withRunTime bool) *JuiceFSEngine {
51-
// 1. Create a JuiceFSRuntime and RuntimeInfo
52+
// 1. Create a JuiceFSRuntime and RuntimeInfo
5253
runTime := &datav1alpha1.JuiceFSRuntime{}
5354
runTimeInfo, _ := base.BuildRuntimeInfo(name, namespace, common.JuiceFSRuntime)
5455
// 2. If the JuiceFS engine does not have runtime, set the runtime and runtimeInfo to nil
@@ -214,17 +215,17 @@ func TestJuiceFSEngine_deleteFusePersistentVolume(t *testing.T) {
214215
// - Proper handling of PVC finalizers (e.g., kubernetes.io/pvc-protection)
215216
// - Failure scenarios when Runtime integration is disabled
216217
// - Interaction with mocked Kubernetes API using fake client
217-
//
218+
//
218219
// The test suite includes two primary cases:
219220
// 1. Normal deletion with Runtime enabled (expected success)
220221
// 2. Deletion failure when Runtime is disabled (simulates missing dependency)
221-
//
222+
//
222223
// Setup steps:
223224
// - Creates test PVCs with protection finalizer to simulate real-world conditions
224225
// - Uses deep copies to ensure test data isolation
225226
// - Configures fake client with predefined test objects for controlled testing
226227
// - Exercises both enabled/disabled Runtime engine variations
227-
//
228+
//
228229
// This test ensures JuiceFS Engine correctly handles PVC lifecycle operations while respecting Kubernetes resource protection mechanisms.
229230
func TestJuiceFSEngine_deleteFusePersistentVolumeClaim(t *testing.T) {
230231
testPVCInputs := []*v1.PersistentVolumeClaim{

0 commit comments

Comments
 (0)