java-operator-sdk icon indicating copy to clipboard operation
java-operator-sdk copied to clipboard

Try to get lease namespace if unspecified

Open honnix opened this issue 3 years ago • 7 comments

This PR makes providing lease namespace optional. If unspecified, it will try to read from a file pointed by system property or env var kubenamespace with default value as /var/run/secrets/kubernetes.io/serviceaccount/namespace which is injected by k8s. The code is inspired by https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/Config.java.

The idea is to simplify use code because in most cases users will need to do the same. Please let me know if this makes sense. Thanks.

@csviri @metacosm

honnix avatar Sep 11 '22 17:09 honnix

Shouldn't we consider this rather a bug? and put it to main?

wdyt @metacosm @honnix ?

csviri avatar Sep 12 '22 11:09 csviri

@csviri I guess we can. :) Strictly speaking it is still more like a feature, but given this small breaking change, shipping it sooner seems to be better.

honnix avatar Sep 12 '22 11:09 honnix

I'm making a small tweak.

honnix avatar Sep 12 '22 12:09 honnix

Could you please help merge this so it doesn't stay too long and get conflict? Thank you.

honnix avatar Sep 21 '22 20:09 honnix

yep, fine by me, @metacosm could you take a look pls?

csviri avatar Sep 22 '22 07:09 csviri

I already approved it… 😁

metacosm avatar Sep 22 '22 17:09 metacosm

The only question that remains is whether we should merge it in main or next

metacosm avatar Sep 22 '22 17:09 metacosm

If going to main results a bug fix release right way, it might make sense due to the small breaking change. It feels better to ship it sooner than later.

honnix avatar Sep 22 '22 19:09 honnix

I think this is kinda gray area, it's not a bug fix, rather an improvement IMHO. But fine with merging it to the main, and have a release.

csviri avatar Sep 22 '22 19:09 csviri

I think this is kinda gray area, it's not a bug fix, rather an improvement IMHO. But fine with merging it to the main, and have a release.

Yeah agreed. I don't have a strong opinion. Either way is ok for me.

honnix avatar Sep 22 '22 20:09 honnix

merged to main, thank you @honnix !!

csviri avatar Sep 23 '22 07:09 csviri

Thank you all!

honnix avatar Sep 23 '22 07:09 honnix

Thank you!

metacosm avatar Sep 23 '22 07:09 metacosm