-
Notifications
You must be signed in to change notification settings - Fork 1.3k
This PR is to add comments to etMasterStatefulset in fluid/pkg/ddc/alluxio/utils.go. #6080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -75,6 +75,16 @@ func (e *AlluxioEngine) getMasterPod(name string, namespace string) (pod *v1.Pod | |||||||||||||
| return pod, err | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| // getMasterStatefulset retrieves the Alluxio Master StatefulSet with the specified name | ||||||||||||||
| // and namespace from the Kubernetes cluster using the embedded client. | ||||||||||||||
| // | ||||||||||||||
| // Parameters: | ||||||||||||||
| // - name: the name of the StatefulSet resource. | ||||||||||||||
| // - namespace: the Kubernetes namespace where the StatefulSet resides. | ||||||||||||||
| // | ||||||||||||||
| // Returns: | ||||||||||||||
| // - master: a pointer to the appsv1.StatefulSet object if found; nil on error. | ||||||||||||||
| // - err: non-nil if the retrieval fails (e.g., resource not found, network issue). | ||||||||||||||
|
Comment on lines
+85
to
+87
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment states that
Suggested change
|
||||||||||||||
| func (e *AlluxioEngine) getMasterStatefulset(name string, namespace string) (master *appsv1.StatefulSet, err error) { | ||||||||||||||
| master = &appsv1.StatefulSet{} | ||||||||||||||
| err = e.Client.Get(context.TODO(), types.NamespacedName{ | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding GoDoc here — the description of the parameters and behavior is clear. One small accuracy nit on the return value: the comment says
master: a pointer to the appsv1.StatefulSet object if found; nil on error., but the implementation always allocatesmaster = &appsv1.StatefulSet{}before callinge.Client.Get, so the returned pointer is never nil. On error it just points to a zero-value StatefulSet.Consider rewording to match the actual behavior, for example:
Keeping the doc precise here helps callers reason about nil checks vs. error checks.