-
Notifications
You must be signed in to change notification settings - Fork 29
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
drop extension / update crd #147
Conversation
impl Default for Extension { | ||
fn default() -> Self { | ||
Extension { | ||
name: "pg_stat_statements".to_owned(), | ||
version: "1.9".to_owned(), | ||
enabled: true, | ||
schema: "postgres".to_owned(), | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
impl Default for Extension { | |
fn default() -> Self { | |
Extension { | |
name: "pg_stat_statements".to_owned(), | |
version: "1.9".to_owned(), | |
enabled: true, | |
schema: "postgres".to_owned(), | |
} | |
} | |
} |
I think the default should be an empty vec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats the basis for this being empty? This is the default method and it is explicit. You only gets used if you're calling ::Default()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's an example case for using this? I could see us using it as a default CRD value if we wanted this extension enabled whenever the user provides nothing in spec.extensions
(like you had previously configured), but we want that to be empty in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use ::Default()
a lot in tests or wherever I want to construct a default set of values for struct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 seems reasonable!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default_extensions
is an empty vec regardless of implementing Default on the Extension
Co-authored-by: Ian Stanton <ian@coredb.io>
Co-authored-by: Ian Stanton <ian@coredb.io>
Co-authored-by: Ian Stanton <ian@coredb.io>
* Enable CNPG by default * pgmq enabled on initial creation * adjust tests * Fix tests * fmt * Fix race condition
Operator creates/drops postgres extensions.
Updated the CRD for extensions to be a list of objects, instead of a list of strings. Each object has as attribute:
enabled
. Operator will use that attribute to switch its behavior.