-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression - Text registry migration broken on master #3876
Comments
Wrote a simple test to show the issue func TestTXTMigration(t *testing.T) {
ctx := context.Background()
p := inmemory.NewInMemoryProvider()
p.CreateZone(testZone)
p.ApplyChanges(ctx, &plan.Changes{
Create: []*endpoint.Endpoint{
newEndpointWithOwner("oldformat.test-zone.example.org", "foo.loadbalancer.com", endpoint.RecordTypeCNAME, ""),
newEndpointWithOwner("oldformat.test-zone.example.org", "\"heritage=external-dns,external-dns/owner=owner\"", endpoint.RecordTypeTXT, ""),
newEndpointWithOwner("oldformat2.test-zone.example.org", "bar.loadbalancer.com", endpoint.RecordTypeA, ""),
newEndpointWithOwner("oldformat2.test-zone.example.org", "\"heritage=external-dns,external-dns/owner=owner\"", endpoint.RecordTypeTXT, ""),
},
})
r, _ := NewTXTRegistry(p, "", "", "owner", time.Hour, "wc", []string{endpoint.RecordTypeCNAME, endpoint.RecordTypeA, endpoint.RecordTypeNS}, false, nil)
records, err := r.Records(ctx)
assert.NoError(t, err)
testPlan := plan.Plan{
Current: records,
Desired: []*endpoint.Endpoint{
{
DNSName: "oldformat.test-zone.example.org",
Targets: endpoint.Targets{"foo.loadbalancer.com"},
RecordType: endpoint.RecordTypeCNAME,
},
{
DNSName: "oldformat2.test-zone.example.org",
Targets: endpoint.Targets{"bar.loadbalancer.com"},
RecordType: endpoint.RecordTypeA,
},
},
Policies: []plan.Policy{&plan.SyncPolicy{}},
ManagedRecords: []string{"A", "AAAA", "CNAME"},
}
txtMigrationChanges := testPlan.Calculate()
err = r.ApplyChanges(ctx, txtMigrationChanges.Changes)
assert.NoError(t, err)
} This breaks in two places where it's trying to updateOld and New but these new txt record types don't exist. |
This should no longer be an issue once #3774 is released |
@DP19 We experience this issue when upgrading from
Any workaround? |
@danil-smirnov yes, upgrade to 0.13.5 first and let it make the new txt records. You should be able to upgrade to the lastest version after that. |
@danil-smirnov That might just be due to v0.13.5 not updating all of the txt records. Can you run that version with the |
You are right @DP19 - I haven't applied a two-step upgrade to the Cloudflare instance. After I went through 0.13.5 error was fixed. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
@DP19 : why the upgrade should pass specifically by 0.13.5 version? 0.13.1, 0.13.2, 0.13.4 are not good? |
I think they are; the migration you put in place for those versions should work without issue. I think we just picked this version because it was the last release before the change that went in and caused this issue; letting other fixes / changes also run between 0.12.0 and 0.13.5. |
@DP19 : Thanks for the reply!
Yeah, that's what I thought too. However, I'm still puzzled about the reasoning for not fixing the force update and waiting for the "new new" format instead.
We could use your change until the new new format is available. |
@alebedev87 I believe he thought at the time it would be merged and in by the next release; I haven't looked at the code to see if it will still work now with all of the other changes but if someone wants to take a shot at that I'd be all for it 🤷🏻 |
curious if the need for a two-step upgrade still exists. I've got a situation where I need to go from 0.11.x to 0.14.x or 0.15.x - is it still necessary to go through 0.13.5 in this case? thanks. EDIT: given that #3774 isn't merged, I'm going to guess the answer is yes, a two step migration is still required? |
What happened:
Updating from pre v0.12.0 to latest master causes records to be attempted to be deleted that don't exist yet.
What you expected to happen:
The migration to the new txt records in v0.12.0 should apply without issue
How to reproduce it (as minimally and precisely as possible):
Run external dns in an environment pre v0.12.0 with
--registry=txt
Run latest master with
--registry=txt
to see attempts to delete records that don't exist yetAnything else we need to know?:
Admittedly I don't know if this is for all providers; but it is happening for the google provider in my environment. The names in the log output have been changed but it's the gist of what's happening.
I stepped through the code and I see that it seems to be related to the move to handle this migration via a
ForceUpdate
strategy in #3635These two lines end up with the same records to change and in the txt registry code they both generate the new recordType-record TXT:
https://github.com/kubernetes-sigs/external-dns/blob/master/registry/txt.go#L277
https://github.com/kubernetes-sigs/external-dns/blob/master/registry/txt.go#L286
This ends up submitting a delete and recreate of the new TXT record when the recordType-record TXT entry doesn't exist yet.
Environment:
external-dns --version
): master--policy=sync --registry=txt --source=istio-virtualservice --domain-filter=some-domain.com --provider=google --txt-owner-id=cluster-1
The text was updated successfully, but these errors were encountered: