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

Ignore ErrKeyNotFound error for the KV provider #10082

Merged
merged 3 commits into from Sep 25, 2023

Conversation

sunyakun
Copy link
Contributor

@sunyakun sunyakun commented Aug 15, 2023

What does this PR do?

Fixes #8092

Motivation

When the root key does not exist, listing the kv store will result in an 'ErrKeyNotFound' error. In this case, the kv provider will not send a dynamic.Message to the configurationChan for updating the configuration. So when we delete the root key in the kv store to clear all traefik configurations, traefik will always retain the last configuration.

More

  • Added/updated tests
  • [ ] Added/updated documentation

Additional Notes

While fixing this bug, I encountered another potential bug caused by the kvtools/redis library when using Redis as the kv store. The kv provider utilizes the WatchTree interface to monitor events of key changes in the kv store. However, when we delete the root key in Redis, the WatchTree fails to notify the kv provider about the modification of certain keys. Therefore, even though I have fixed the buildConfiguration function of the kv provider, this bug may still persist when Redis is used as the kv store. About the bug of kvtools/redis , I have created an issue: kvtools/redis#4

@sunyakun

This comment was marked as outdated.

@ldez
Copy link
Member

ldez commented Aug 15, 2023

@sunyakun
Copy link
Contributor Author

sunyakun commented Aug 15, 2023

Okay, I will remove the second change. However, for the first one, I moved the setupStore function to SetUpSuite and the cleanup action to TearDownSuite, which is executed by the go-checker. This means we don't need to care about setting and cleaning some common things in every testcase. Are you sure I should remove it?

@ldez
Copy link
Member

ldez commented Aug 15, 2023

Are you sure I should remove it?

yes

Copy link
Member

@rtribotte rtribotte left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@kevinpollet kevinpollet changed the title Ignore the 'ErrKeyNotFound' error for the kv provider Ignor ErrKeyNotFound error for the KV provider Sep 25, 2023
@kevinpollet kevinpollet changed the title Ignor ErrKeyNotFound error for the KV provider Ignore ErrKeyNotFound error for the KV provider Sep 25, 2023
Copy link
Member

@kevinpollet kevinpollet left a comment

Choose a reason for hiding this comment

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

Thanks 👍

Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants