Which function do you want to add comments to?
UpdateDatasetStatus in pkg/ddc/goosefs/dataset.go.
What comments do you want to add?
// UpdateDatasetStatus updates the status of the dataset
// UpdateDatasetStatus updates the status of the dataset to the specified phase.
// This function performs the following steps:
// 1. Retrieves the current runtime status.
// 2. Updates the dataset status, including phase, conditions, and cache states.
// 3. If the dataset's HCFS status is not set, it retrieves the HCFS status.
// 4. If there are any changes to the dataset status, it updates the status in the Kubernetes API.
// The function uses retry logic to handle conflicts when updating the dataset status.
// Parameters:
// - phase: The new phase to set for the dataset.
// Returns:
// - err: An error if any step fails.
Which function do you want to add comments to?
UpdateDatasetStatus in pkg/ddc/goosefs/dataset.go.
What comments do you want to add?