Skip to content

Commit 321047e

Browse files
[Bugfix] fix spec/label/annotation changes can't trigger redownload
1 parent 957f541 commit 321047e

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

pkg/modelagent/scout.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ func (w *Scout) updateBaseModel(old, new interface{}) {
362362
hasChanges = hasChanges || (result != "")
363363
}
364364

365-
if hasChanges && w.shouldDownloadModelInUpdateEvent(newBaseModel.Spec.Storage) {
365+
if hasChanges && w.shouldDownloadModel(newBaseModel.Spec.Storage) {
366366
w.logger.Infof("BaseModel %s needs refresh in namespace %s", newBaseModel.GetName(), newBaseModel.GetNamespace())
367367
w.generateDownloadOverrideTaskBasedOnBaseModel(newBaseModel)
368368
}
@@ -417,7 +417,7 @@ func (w *Scout) updateClusterBaseModel(old, new interface{}) {
417417
hasChanges = hasChanges || (result != "")
418418
}
419419

420-
if hasChanges && w.shouldDownloadModelInUpdateEvent(newClusterBaseModel.Spec.Storage) {
420+
if hasChanges && w.shouldDownloadModel(newClusterBaseModel.Spec.Storage) {
421421
w.logger.Infof("ClusterBaseModel %s need refresh", newClusterBaseModel.GetName())
422422
w.generateDownloadOverrideTaskBasedOnClusterBaseModel(newClusterBaseModel)
423423
}
@@ -547,12 +547,6 @@ func (w *Scout) shouldDownloadModel(storageSpec *v1beta1.StorageSpec) bool {
547547
return w.shouldDownloadModelCommon(storageSpec, true)
548548
}
549549

550-
// shouldDownloadModelInUpdateEvent mirrors shouldDownloadModel logic but uses a default false decision,
551-
// allowing callers to opt-in specific cases for updates if needed.
552-
func (w *Scout) shouldDownloadModelInUpdateEvent(storageSpec *v1beta1.StorageSpec) bool {
553-
return w.shouldDownloadModelCommon(storageSpec, false)
554-
}
555-
556550
func (w *Scout) nodeMatchesSelectorTerm(term v1.NodeSelectorTerm) bool {
557551
// Check match expressions
558552
for _, expr := range term.MatchExpressions {

0 commit comments

Comments
 (0)