Skip to content

Commit 0835c54

Browse files
committed
Add success messages for all retry.Do cases
1 parent cf2a319 commit 0835c54

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

internal/pkg/application/application.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func UpdateApplicationInstance(ctx context.Context, cfg *config.Config, instance
6464
return nil, err
6565
}
6666

67+
mgr.Logger.Info("application update applied", "name", cfg.ApplicationName)
6768
return app, nil
6869
})
6970
if err != nil {
@@ -105,15 +106,13 @@ func UpdateApplicationUser(ctx context.Context, target *resolved.Instance, gcpPr
105106
return retry.RetryableError(fmt.Errorf("user not up to date"))
106107
}
107108

109+
mgr.Logger.Info("user is up to date, setting database password", "user", target.AppUsername)
108110
return nil
109111
})
110-
111112
if err != nil {
112113
return err
113114
}
114115

115-
mgr.Logger.Info("user is up to date, setting database password", "user", target.AppUsername)
116-
117116
return database.SetDatabasePassword(ctx, target.Name, target.AppUsername, target.AppPassword, gcpProject, mgr)
118117
}
119118

internal/pkg/database/database.go

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ func getSqlUser(ctx context.Context, instance string, userName string, gcpProjec
168168
}
169169
return nil, err
170170
}
171+
mgr.Logger.Info("got Cloud SQL user", "user", userName)
171172
return user, nil
172173
})
173174
if err != nil {

internal/pkg/instance/instance.go

+8
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ func PrepareSourceInstance(ctx context.Context, source *resolved.Instance, targe
150150
return err
151151
}
152152

153+
mgr.Logger.Info("update of source instance applied")
153154
return nil
154155
})
155156

@@ -216,6 +217,7 @@ func WaitForCnrmResourcesToGoAway(ctx context.Context, name string, mgr *common_
216217
return retry.RetryableError(errors.New("resource still exists"))
217218
}
218219
if k8s_errors.IsNotFound(err) {
220+
mgr.Logger.Info("resource has been deleted", "kind", r.kind)
219221
return nil
220222
}
221223
logger.Warn("failed to get resource, retrying...", "kind", r.kind, "error", err.Error())
@@ -263,6 +265,8 @@ func PrepareTargetInstance(ctx context.Context, target *resolved.Instance, mgr *
263265
}
264266
return err
265267
}
268+
269+
mgr.Logger.Info("update of target instance applied")
266270
return nil
267271
})
268272
if err != nil {
@@ -312,6 +316,8 @@ func UpdateTargetInstanceAfterPromotion(ctx context.Context, target *resolved.In
312316
}
313317
return err
314318
}
319+
320+
mgr.Logger.Info("update of target instance applied")
315321
return nil
316322
})
317323
if err != nil {
@@ -382,6 +388,8 @@ func CleanupAuthNetworks(ctx context.Context, target *resolved.Instance, mgr *co
382388
}
383389
return err
384390
}
391+
392+
mgr.Logger.Info("update of target instance applied")
385393
return nil
386394
})
387395
if err != nil {

internal/pkg/migration/migration.go

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ func DeleteMigrationJob(ctx context.Context, migrationName string, gcpProject *r
7474
}
7575
}
7676

77+
mgr.Logger.Info("migration job deleted", "name", migrationName)
7778
return nil
7879
})
7980
if err != nil {
@@ -182,6 +183,7 @@ func GetMigrationJob(ctx context.Context, migrationName string, gcpProject *reso
182183
return nil, retry.RetryableError(fmt.Errorf("failed to get migration job: %w", err))
183184
}
184185

186+
mgr.Logger.Info("got migration job", "name", migrationJob.Name)
185187
return migrationJob, err
186188
})
187189

0 commit comments

Comments
 (0)