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

There should be an option in Postgres CRD to drop database and role on deletion #10

Closed
arnarg opened this issue Aug 28, 2019 · 4 comments · Fixed by #19
Closed

There should be an option in Postgres CRD to drop database and role on deletion #10

arnarg opened this issue Aug 28, 2019 · 4 comments · Fixed by #19

Comments

@arnarg
Copy link

arnarg commented Aug 28, 2019

This could be a variable spec.keepResources in the Postgres CRD of type boolean.

When set to true it should keep the owner group role and database on deletion. This should be default.

When set to false it should drop the owner group role and database on deletion.

@arnarg
Copy link
Author

arnarg commented Oct 24, 2019

@hitman99 I'm having a bit of trouble with this like the issue is worded now.

Bool properties in golang will always (as far as I'm aware) default to false when using json unmarshal. Thus it's quite difficult to see if the user left the field unspecified or he set it to false on purpose.

I say we turn the wording around, like dropOnDelete or something like that. What do you think?

@hitman99
Copy link
Member

@arnarg I see your point. Reword sounds the property as you suggested seems a good way to workaround it. In addition, we could look into defaulting

@arnarg
Copy link
Author

arnarg commented Oct 28, 2019

In addition, we could look into defaulting

Yeah I noticed that in the documentation as well when researching this but it's currently in beta and only in 1.16.

The only other way I can think of is to use mutating admission webhook but I think that adds too much complexity for one boolean variable.

@hitman99
Copy link
Member

Yeah, it's only beta in 1.16. For now your suggestion seems to be the best (rewording the property).

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