Skip to content

No observedGeneration in Customer Resource status #1698

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

Open
thcdrt opened this issue Nov 19, 2021 · 7 comments
Open

No observedGeneration in Customer Resource status #1698

thcdrt opened this issue Nov 19, 2021 · 7 comments

Comments

@thcdrt
Copy link

thcdrt commented Nov 19, 2021

Hello community,

Some context

  • Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.6.3
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? OVH Managed Kubernetes
  • Are you running Postgres Operator in production? no
  • Type of issue? feature request

Issue

When retrieving the Custom Resource pg with the command:
kubectl get postgresqls.acid.zalan.do -o=jsonpath='{.items[0].status}'

I get :
{"PostgresClusterStatus":"Running"}

I would have expected to have the field observedGeneration like in many Custom Resources / Resources.

I don't know how to check programmatically that an update on the Custom Resource has been processed without observedGeneration mechanism.
I mean if for example I modify the version of the Postgres and I only check the PostgresClusterStatus value it could be Running but not on the right Postgres version.
The only way I see is using ResourceVersion but it's not really user friendly.

What do you think ?

Thank you,
Thomas

@FxKu
Copy link
Member

FxKu commented Nov 19, 2021

It's true, that our status subresource is not following the schema one expects from K8s resources. Our internal K8s teams has also already complained 😄 This could and should def. be improved in the future. PRs are welcome.

@hzliangbin
Copy link

/assign

@hzliangbin
Copy link

@FxKu hi, I wanna give a try. May I take it ?

@FxKu
Copy link
Member

FxKu commented Dec 7, 2021

@hzliangbin yes, please 😃 You might want to create a PR first with your ideas before going straight into implementation. We need to make sure we stay backwards compatible by keeping the PostgresClusterStatus I think. But the PostgresStatus is a struct which can easily be extended.

@thcdrt
Copy link
Author

thcdrt commented Feb 22, 2022

Hello @hzliangbin, did you have time to take a look at it ?

@hzliangbin
Copy link

@FxKu @thcdrt really sorry for being late. I think it should be carefully designed which status fields included. or just add a
ObservedGeneration is fined?

@thcdrt
Copy link
Author

thcdrt commented Aug 8, 2022

For me, ObservedGeneration field should be enough but we should set it synchronously with PostgresClusterStatus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants