Skip to content

Commit e077de3

Browse files
committed
address review comments
1 parent b71131c commit e077de3

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

percona/controller/pgcluster/owner_ref_migration.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ func (r *PGClusterReconciler) reconcileOwnerRefMigrationStatus(ctx context.Conte
5454
if _, err := mapper.RESTMapping(LegacyGVK.GroupKind(), LegacyGVK.Version); err != nil {
5555
if meta.IsNoMatchError(err) {
5656
log.Info("legacy PostgresCluster CRD not found; no need to check references", "gvk", LegacyGVK)
57+
58+
err := setStatusCondition(ctx, r.Client, cr, metav1.Condition{
59+
Type: "APIGroupMigration",
60+
Status: metav1.ConditionTrue,
61+
Reason: "APIGroupMigrationNotNeeded",
62+
Message: "Legacy API group is not installed",
63+
ObservedGeneration: cr.GetGeneration(),
64+
})
65+
if err != nil {
66+
return errors.Wrap(err, "set status condition to true")
67+
}
68+
5769
return nil
5870
}
5971
return errors.Wrap(err, "discover legacy PostgresCluster GVK")
@@ -127,7 +139,7 @@ func (r *PGClusterReconciler) reconcileOwnerRefMigrationStatus(ctx context.Conte
127139
ObservedGeneration: cr.GetGeneration(),
128140
})
129141
if err != nil {
130-
return errors.Wrap(err, "set status condition to false")
142+
return errors.Wrap(err, "set status condition to true")
131143
}
132144

133145
return nil

0 commit comments

Comments
 (0)