@@ -48,29 +48,31 @@ type ClientSecret struct {
48
48
// happens and all existing MongoDBs are required to get agents upgraded (otherwise the "You need to upgrade the
49
49
// automation agent before publishing other changes" error happens for automation config pushes from the Operator)
50
50
func UpgradeAllIfNeeded (ctx context.Context , cs ClientSecret , omConnectionFactory om.ConnectionFactory , watchNamespace []string , isMulti bool ) {
51
- mux .Lock ()
52
- defer mux .Unlock ()
51
+ /*
52
+ mux.Lock()
53
+ defer mux.Unlock()
53
54
54
- if ! time .Now ().After (nextScheduledTime ) {
55
- return
56
- }
57
- log := zap .S ()
58
- log .Info ("Performing a regular upgrade of Agents for all the MongoDB resources in the cluster..." )
55
+ if !time.Now().After(nextScheduledTime) {
56
+ return
57
+ }
58
+ log := zap.S()
59
+ log.Info("Performing a regular upgrade of Agents for all the MongoDB resources in the cluster...")
59
60
60
- allMDBs , err := readAllMongoDBs (ctx , cs .Client , watchNamespace , isMulti )
61
- if err != nil {
62
- log .Errorf ("Failed to read MongoDB resources to ensure Agents have the latest version: %s" , err )
63
- return
64
- }
61
+ allMDBs, err := readAllMongoDBs(ctx, cs.Client, watchNamespace, isMulti)
62
+ if err != nil {
63
+ log.Errorf("Failed to read MongoDB resources to ensure Agents have the latest version: %s", err)
64
+ return
65
+ }
65
66
66
- err = doUpgrade (ctx , cs .Client , cs .SecretClient , omConnectionFactory , allMDBs )
67
- if err != nil {
68
- log .Errorf ("Failed to perform upgrade of Agents: %s" , err )
69
- }
67
+ err = doUpgrade(ctx, cs.Client, cs.SecretClient, omConnectionFactory, allMDBs)
68
+ if err != nil {
69
+ log.Errorf("Failed to perform upgrade of Agents: %s", err)
70
+ }
70
71
71
- log .Info ("The upgrade of Agents for all the MongoDB resources in the cluster is finished." )
72
+ log.Info("The upgrade of Agents for all the MongoDB resources in the cluster is finished.")
72
73
73
- nextScheduledTime = nextScheduledTime .Add (pause )
74
+ nextScheduledTime = nextScheduledTime.Add(pause)
75
+ */
74
76
}
75
77
76
78
// ScheduleUpgrade allows to reset the timer to Now() which makes sure the next MongoDB reconciliation will ensure
0 commit comments