-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Impossible to replace ConfigMap #2445
Comments
Strange, the code you shared is working for me on OpenShift 3.11 and minikube v1.12.2 on FKC 4.11.0 |
ohk, I can reproduce |
ClassCastException issue (IntelliJ Expression evaluation)Affects versions: >= 4.10.2 Sames issue can be observed when Issue won't happen if argument is wrapped with List: client.configMaps().inNamespace(NAMESPACE).delete(Collections.singleonList(newResource));
// Or
client.configMaps().inNamespace(NAMESPACE).delete(new HasMetadata[]{newResource}); I'm not sure about this, but I'm strongly thinking IntelliJ's Debug->Evaluate tools makes a mess with type inference and Generics in As you can see in the previous screenshots, when performing unnecessary casting, Evaluate works as expected. See also |
Ah, makes sense. Thanks for the investigation. So I guess this can be closed now? |
I'm still working on it. See if I can find some solution to the problem. It worries me that we hit into this problem not just when debugging 😟 |
I'd like to point out that I'm also seeing this issue, and it's not in a debugger. If you want to see that, clone https://github.com/thorntail-examples/configmap, run |
Thx @Ladicek, this helps a lot. BTW, I can track the affecting issue to 4.10.2. Don't your tests fail with this version? |
No, it's OK with 4.10.3. Perhaps it's a different issue, but manifests in the same way :-) |
Just to be sure, I reran the test with the latest |
Hi @Ladicek I'm not sure your issue is related to this I'm able to see the test failures, but it's related to a timeout (probably because the configmaps never get replaced). I think this is caused by the comparison methods used to determine if the resource must be replaced or left as is. But this has nothing to do with the issue at hand. Did you actually see some similar message (ClassCastException)? In a nutshell, problem for |
Hi, I came across this issue while searching why the ConfigMaps are not updated in the cluster. Same exceptions while debugging in IDEA and if executing on OpenShift 3.11 it just didn't replace the ConfigMaps. |
@manusa yes, the tests fail because the ConfigMap is never replaced. Whether there's a |
TBH I had the same issue as @Ladicek. While debugging I saw the exception and I was thinking "Yeah, that's it". |
ConfigMaps not getting replaced are related to: Lines 439 to 442 in c1e4862
Lines 37 to 49 in c1e4862
Probably your failing cases are due to this (this was actually introduced in 4.11.0). Could you please confirm in a debug session that your configmap replacements are getting skipped? |
In the simple reproducer, I provided, the CM is replaced. In much more complex IT or even ST it happens it is not replaced. |
Hi @manusa , confirmed. For me it's running into line 441 and skipping while compared it's definitly different data. |
Line 107 and 108 in ResourceCompare return 'null'. Therefore isEqualSpec returns true in line 111. |
I can confirm that my ConfigMap isn't updated because the |
Thx all for your collaboration, sent a PR reverting that behavior. |
Patch should be available in https://github.com/fabric8io/kubernetes-client/releases/tag/v4.11.1 |
I can reproduce this issue in version |
here is where I had to apply the cast : https://github.com/spring-cloud/spring-cloud-kubernetes/pull/1036/files#diff-4ddeab245bfc52856d8238ad19d4bcb38b009a73be2c3b8acd97d878e20f15a1 It's fairly easy to test, but you require the source code locally. You need to build the image (by simply running |
Hi @wind57 Could you please open a new issue if the problem persists for you so we can keep track of it, and implement a fix if necessary? |
sure! If I see it again, will create a reproducible example. |
After upgrading to |
Hi.
I've upgraded to version 4.11.0 and I started having an issue with replacing ConfigMaps.
Reproducer
Output of
createOrReplace(ConfigMap)
Expected output
updated CM
Did the API changed in 4.11.0 or is it a bug?
Thank you!
The text was updated successfully, but these errors were encountered: