You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4.**Automatic Type Determination**: Namespace presence determines ClusterResourceSnapshot vs ResourceSnapshot
519
+
5.**Proper Status Management**: Gets status copy, modifies it, then sets it back
520
+
6.**Generic Logging**: Updated terminology from cluster-specific to generic
521
+
522
+
**Impact**: This function is now fully generic and works with both cluster-scoped and namespace-scoped resources, completing another major piece of the interface-based refactoring.
523
+
524
+
## Current Status
525
+
- ✅ `validatePlacement`: Fully generic, uses utility functions and interfaces
ifcrb, ok:=bindingObj.(*placementv1beta1.ClusterResourceBinding); ok {
81
92
scheduledBindings[i] =crb
82
93
} else {
83
-
// This should only happen for StagedUpdateRun with ResourceBinding, but initialize currently only handles ClusterStagedUpdateRun
84
94
returnnil, nil, fmt.Errorf("expected ClusterResourceBinding but got %T - initialize function needs further refactoring for namespace-scoped resources", bindingObj)
// recordOverrideSnapshots finds all the override snapshots that are associated with each cluster and record them in the ClusterStagedUpdateRun status.
err:=controller.NewUserError(fmt.Errorf("no clusterResourceSnapshots with index `%d` found for clusterResourcePlacement `%s`", snapshotIndex, placementName))
546
-
klog.ErrorS(err, "No specified clusterResourceSnapshots found", "clusterStagedUpdateRun", updateRunRef)
err:=controller.NewUnexpectedBehaviorError(fmt.Errorf("no master clusterResourceSnapshot found for clusterResourcePlacement `%s` with index `%d`", placementName, snapshotIndex))
563
-
klog.ErrorS(err, "Failed to find master clusterResourceSnapshot", "clusterStagedUpdateRun", updateRunRef)
564
+
err:=controller.NewUnexpectedBehaviorError(fmt.Errorf("no master resourceSnapshot found for placement `%s` with index `%d`", placementKey, snapshotIndex))
565
+
klog.ErrorS(err, "Failed to find master resourceSnapshot", "stagedUpdateRun", updateRunRef)
klog.ErrorS(err, "Failed to find all matching overrides for the clusterStagedUpdateRun", "masterResourceSnapshot", klog.KObj(masterResourceSnapshot), "clusterStagedUpdateRun", updateRunRef)
574
+
klog.ErrorS(err, "Failed to find all matching overrides for the stagedUpdateRun", "masterResourceSnapshot", klog.KObj(masterResourceSnapshot), "stagedUpdateRun", updateRunRef)
klog.ErrorS(err, "Failed to pick the override snapshots for cluster", "cluster", clusterStatus.ClusterName, "masterResourceSnapshot", klog.KObj(masterResourceSnapshot), "clusterStagedUpdateRun", updateRunRef)
588
+
klog.ErrorS(err, "Failed to pick the override snapshots for cluster", "cluster", clusterStatus.ClusterName, "masterResourceSnapshot", klog.KObj(masterResourceSnapshot), "stagedUpdateRun", updateRunRef)
0 commit comments