-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Delete and Modify events are not getting trigged #3652
Comments
And also noticed that with the below code snippet thread is getting stuck. private boolean checkConfigFilesPresent(String nameSpace, String secretName, ArrayList fileNameList) {
please check this one also. |
Getting watches right is tricky, I would strongly encourage you to use the |
Thank you for your suggestion. I implemented the following code snippet to monitor Kubernetes secrets. However, when performing different operations like adding, modifying, and deleting a secret, no events were triggered. `package com.example.demo.informer; import io.kubernetes.client.informer.ResourceEventHandler; import java.util.concurrent.TimeUnit; public class SecretWatcher implements Runnable {
} Could you please suggest how to resolve this issue so that all events are properly triggered? My request is to continuously monitor Kubernetes secrets, ensuring that whenever any action is performed on a secret, the appropriate event is triggered. |
Please review the InformerExample here: |
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 |
Describe the bug
I am watching kubernate secret in infine loop, in any change happened to secret, watch should trigger appropriate events like ADDED or MODIFIED or DELETED.
but in my case DELETE event is not triggered and most important point is that Thread is getting struck.
Client Version
19.0.0
Kubernetes Version
1.23.10
Java Version
. Java 17
below is code snippet to reproduce the issue.
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.apis.CoreV1Api;
import io.kubernetes.client.openapi.models.V1Secret;
import io.kubernetes.client.openapi.models.V1SecretList;
import io.kubernetes.client.util.Config;
import io.kubernetes.client.util.Watch;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.util.List;
public class SecretWatcher {
}
Kindly suggest how we can achieve all event triggered correctly.
The text was updated successfully, but these errors were encountered: