Skip to content

Commit

Permalink
fix(scheduler): fix overwrite fedobject annotations bug
Browse files Browse the repository at this point in the history
  • Loading branch information
limhawjia committed Jul 22, 2023
1 parent 6eb28ee commit 1b353c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/controllers/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ func (s *Scheduler) persistSchedulingResult(
return worker.StatusError
}

logger.V(1).Info("Updated federated object")
logger.V(1).Info("Scheduling success")
s.eventRecorder.Eventf(
fedObject,
corev1.EventTypeNormal,
Expand Down
10 changes: 5 additions & 5 deletions pkg/controllers/scheduler/schedulingtriggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ var knownSchedulingAnnotations = sets.New(
)

func getSchedulingAnnotations(fedObject fedcorev1a1.GenericFederatedObject) []keyValue[string, string] {
annotations := fedObject.GetAnnotations() // this is a deep copy
for k := range annotations {
if !knownSchedulingAnnotations.Has(k) {
delete(annotations, k)
result := map[string]string{}
for k, v := range fedObject.GetAnnotations() {
if knownSchedulingAnnotations.Has(k) {
result[k] = v
}
}
return sortMap(annotations)
return sortMap(result)
}

func getReplicaCount(
Expand Down

0 comments on commit 1b353c1

Please sign in to comment.