Skip to content

Commit

Permalink
Merge 0314f38 into backport/jm/gh-3406/terminally-suited-molly
Browse files Browse the repository at this point in the history
  • Loading branch information
hc-github-team-consul-core authored Apr 19, 2024
2 parents 58b9479 + 0314f38 commit af68802
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ func (r *ConfigEntryController) ReconcileEntry(ctx context.Context, crdCtrl Cont

requiresMigration := false
sourceDatacenter := entry.GetMeta()[common.DatacenterKey]
matchesConsul := configEntry.MatchesConsul(entry)

// Check if the config entry is managed by our datacenter.
// Do not process resource if the entry was not created within our datacenter
Expand All @@ -236,15 +237,15 @@ func (r *ConfigEntryController) ReconcileEntry(ctx context.Context, crdCtrl Cont
// This functionality exists to help folks who are upgrading from older helm
// chart versions where they had previously created config entries themselves but
// now want to manage them through custom resources.
if configEntry.GetObjectMeta().Annotations[common.MigrateEntryKey] != common.MigrateEntryTrue {
if !matchesConsul && configEntry.GetObjectMeta().Annotations[common.MigrateEntryKey] != common.MigrateEntryTrue {
return r.syncFailed(ctx, logger, crdCtrl, configEntry, ExternallyManagedConfigError,
sourceDatacenterMismatchErr(sourceDatacenter))
}

requiresMigration = true
}

if !configEntry.MatchesConsul(entry) {
if !matchesConsul {
if requiresMigration {
// If we're migrating this config entry but the custom resource
// doesn't match what's in Consul currently we error out so that
Expand Down

0 comments on commit af68802

Please sign in to comment.