Skip to content

Commit feb86bf

Browse files
zsmondycheyang
andauthored
This PR is to add comments to SetupMaster in pkg\ddc\goosefs\master.go. (#4880)
* Add Notation to SetupMaster in pkg\ddc\goosefs\master.go. Signed-off-by: zsmondy) <2082346011@qq.com> * go fmt pkg/ddc/goosefs/master.go Signed-off-by: cheyang <cheyang@163.com> --------- Signed-off-by: zsmondy) <2082346011@qq.com> Signed-off-by: cheyang <cheyang@163.com> Co-authored-by: cheyang <cheyang@163.com>
1 parent f9e57d8 commit feb86bf

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

pkg/ddc/goosefs/master.go

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,28 @@ func (e *GooseFSEngine) ShouldSetupMaster() (should bool, err error) {
123123
return
124124
}
125125

126-
// SetupMaster setups the master and updates the status
127-
// It will print the information in the Debug window according to the Master status
128-
// It return any cache error encountered
126+
// SetupMaster setups the master and updates the status of the runtime.
127+
//
128+
// This function performs the following steps:
129+
// 1. Checks if the master StatefulSet exists:
130+
// - If not found, initializes the master via `setupMasterInternal()`.
131+
// - If found, logs the current ready replicas.
132+
//
133+
// 2. Updates the runtime status:
134+
// - Sets the master phase to `RuntimePhaseNotReady`.
135+
// - Records desired master replicas (defaulting to 1 if unspecified).
136+
// - Initializes worker selectors and sets the value file configmap.
137+
// - Adds a condition indicating the master is initialized.
138+
//
139+
// 3. Uses retry logic to handle concurrent updates to the runtime status.
140+
//
141+
// Parameters:
142+
// - e: *GooseFSEngine
143+
// The engine instance containing client, logger, namespace, and configuration for the GooseFS runtime.
144+
//
145+
// Returns:
146+
// - error
147+
// Returns an error if the master setup fails or the runtime status update encounters an issue.
129148
func (e *GooseFSEngine) SetupMaster() (err error) {
130149
masterName := e.getMasterName()
131150

0 commit comments

Comments
 (0)