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

NPE in KubernetesResourceUtil.sortEventListBasedOnTimestamp caused by event's lastTimestamp being null #3027

Closed
simkam opened this issue Apr 21, 2021 · 4 comments · Fixed by #3030
Milestone

Comments

@simkam
Copy link
Contributor

simkam commented Apr 21, 2021

with version 4.13.0

java.lang.NullPointerException: text
	at java.util.Objects.requireNonNull(Objects.java:228)
	at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1848)
	at java.time.Instant.parse(Instant.java:395)
	at io.fabric8.kubernetes.client.utils.KubernetesResourceUtil.lambda$sortEventListBasedOnTimestamp$0(KubernetesResourceUtil.java:330)
	at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
	at java.util.TimSort.sort(TimSort.java:234)
	at java.util.Arrays.sort(Arrays.java:1512)
	at java.util.ArrayList.sort(ArrayList.java:1464)
	at io.fabric8.kubernetes.client.utils.KubernetesResourceUtil.sortEventListBasedOnTimestamp(KubernetesResourceUtil.java:328)

According to kubernetes/kubernetes#90482, the firstTimestamp/lastTimestamp and eventTime fields are optional, so clients must tolerate events without those timestamps set.

@rohanKanojia
Copy link
Member

@simkam : Would it be possible for you to raise a PR to fix this?

@simkam
Copy link
Contributor Author

simkam commented Apr 21, 2021

Hi @rohanKanojia, I sent PR with fix. I would like have the fix backported also to 4.13.x branch? Should I open another PR for 4.13.x?

@rohanKanojia rohanKanojia added this to the 4.13.3 milestone Apr 21, 2021
@manusa
Copy link
Member

manusa commented Apr 22, 2021

Hi @rohanKanojia, I sent PR with fix. I would like have the fix backported also to 4.13.x branch? Should I open another PR for 4.13.x?

Your commit was cherry-picked. Release process for 4.13.3 started a few minutes ago.

@rohanKanojia
Copy link
Member

@simkam : 4.13.3 has been released https://repo1.maven.org/maven2/io/fabric8/kubernetes-client/4.13.3/ . You should be able to find your issue fixed

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 a pull request may close this issue.

3 participants