Skip to content
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

FIX: Annotate and Label existing DNSEndpoints #443

Merged
merged 1 commit into from
Apr 15, 2021
Merged

Conversation

k0da
Copy link
Collaborator

@k0da k0da commented Apr 14, 2021

When upgrading from 0.7.5 to 0.7.6 new generated objectmeta wasn't
concidered during DNSEndpoint reconcilation. Fix this by respecting
computed Labels and Annotations while reconciling DNSEndpoint.

fixes https://github.com/AbsaOSS/k8gb/issues/324

Signed-off-by: Dinar Valeev dinar.valeev@absa.africa

Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just a small suggestion re assert failure output

reconcileAndUpdateGslb(t, settings)
err = settings.client.Get(context.TODO(), settings.request.NamespacedName, dnsEndpoint)
require.NoError(t, err, "Failed to load DNS endpoint")
got := dnsEndpoint.Annotations["k8gb.absa.oss/dnstype"]

// assert
assert.Equal(t, got, want, "got:\n %q annotation value,\n\n want:\n %q", got, want, got, want)
assert.Equal(t, want, got, "got:\n %q annotation value,\n\n want:\n %q", got, want, got, want)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert.Equal(t, want, got, "got:\n %q annotation value,\n\n want:\n %q", got, want, got, want)
assert.Equal(t, want, got, "got:\n %q annotation value,\n\n want:\n %q", got, want)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ytsarev thanks, amended

When upgrading from 0.7.5 to 0.7.6 new generated objectmeta wasn't
concidered during DNSEndpoint reconcilation. Fix this by respecting
computed Labels and Annotations while reconciling DNSEndpoint.

Signed-off-by: Dinar Valeev <dinar.valeev@absa.africa>
@k0da k0da requested a review from ytsarev April 14, 2021 22:35
@k0da k0da merged commit 740c80d into master Apr 15, 2021
@k0da k0da deleted the endpoint_label branch May 6, 2021 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Existing DNSEndpoint resources are not re-labeled with dnstype after v0.7.5 upgrade
2 participants