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

Regarding watch event failures and retries #682

Open
tankunsheng opened this issue Nov 27, 2020 · 0 comments
Open

Regarding watch event failures and retries #682

tankunsheng opened this issue Nov 27, 2020 · 0 comments

Comments

@tankunsheng
Copy link

Looking at the examples of the implementation of watches for resources. How would the reconciliation work in the event that a creation/update/deletion event fails and needs to be retried again?

It does not seem right to handle the retry from within the code. Is there someway to reschedule a retry?

From the example of the watchDeploymentNotifiers below:

function watchDeploymentNotifiers (client) {
  const stream = client.apis['kubernetes-client.io'].v1.watch.deploymentnotifiers.getStream()
  const jsonStream = new JSONStream()
  stream.pipe(jsonStream)

  const watchers = {}
  jsonStream.on('data', async event => {
    const id = `${event.object.metadata.namespace}/${event.object.metadata.name}`
    if (event.type === 'ADDED') {

      // What happens if the logic fails here and errors out
      // How do I ensure that the watch for this particular resource version is triggered again?

    } else if (event.type === 'DELETED') {
    
    }
  })
}
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

No branches or pull requests

1 participant