Skip to content

Conversation

@TrafalgarZZZ
Copy link
Member

@TrafalgarZZZ TrafalgarZZZ commented Oct 8, 2024

Ⅰ. Describe what this PR does

Make some code refactoring for func base.BuildRuntimeInfo.

  • Make tieredstore an optional argument when building a runtime info.

Ⅱ. Does this pull request fix one issue?

part of #3671

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

In pkg/ddc/base/runtime.go, func GetRuntimeInfo() now looks like:

opts := []RuntimeInfoOption{
        WithTieredStore(datav1alpha1.TieredStore{}),
	WithMetadataList(GetMetadataListFromAnnotation(alluxioRuntime)),
}
runtimeInfo, err = BuildRuntimeInfo(name, namespace, common.AlluxioRuntime, opts...)
if err != nil {
	return runtimeInfo, err
}
runtimeInfo.SetFuseNodeSelector(alluxioRuntime.Spec.Fuse.NodeSelector)
runtimeInfo.SetupFuseCleanPolicy(alluxioRuntime.Spec.Fuse.CleanPolicy)

This can be further refactored:

opts := []RuntimeInfoOption{
        WithTieredStore(datav1alpha1.TieredStore{}),
	WithMetadataList(GetMetadataListFromAnnotation(alluxioRuntime)),
        WithFuseOptions(alluxioRuntime.Spec.Fuse.NodeSelector, alluxioRuntime.Spec.Fuse.CleanPolicy)
}
runtimeInfo, err = BuildRuntimeInfo(name, namespace, common.AlluxioRuntime, opts...)
if err != nil {
	return runtimeInfo, err
}

This is planned in next PR.

Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 8, 2024

Copy link
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@fluid-e2e-bot
Copy link

fluid-e2e-bot bot commented Oct 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheyang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cheyang
Copy link
Collaborator

cheyang commented Oct 8, 2024

/test fluid-e2e

@TrafalgarZZZ
Copy link
Member Author

/retest

1 similar comment
@cheyang
Copy link
Collaborator

cheyang commented Oct 9, 2024

/retest

@fluid-e2e-bot fluid-e2e-bot bot merged commit 30e646d into fluid-cloudnative:master Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants