-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support namespace ExtendedOptions in cluster spec #282
Support namespace ExtendedOptions in cluster spec #282
Conversation
Codecov Report
@@ Coverage Diff @@
## master #282 +/- ##
==========================================
- Coverage 76.02% 75.99% -0.04%
==========================================
Files 32 32
Lines 2394 2416 +22
==========================================
+ Hits 1820 1836 +16
- Misses 429 432 +3
- Partials 145 148 +3 Continue to review full report at Codecov.
|
// ExtendedOptions stores the extended namespace options. | ||
type ExtendedOptions struct { | ||
Type string `json:"type,omitempty"` | ||
Options map[string]DynamicOption `json:"options,omitempty"` |
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've never seen interface types in Kubernetes API types before. I wonder if having this be map[string]json.RawMessage
would give you the same benefits (auto-generated DeepCopy implementation, more control over serialization) while being more Kubernetes-friendly?
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.
Thanks, @schallert , json.RawMessage
really makes the implementation much simpler. Updated.
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.
LGTM, but it would be good to test on a live operated cluster before we merge, both with and without extended options. I've seen some... "unintuitive" (to put it nicely) behavior from Kubernetes before when serializing / deserializing anything non-standard.
Sure, we've done some testing on a real cluster. |
* master: Backwards compatibility when using the original update annoation with an OnDelete update strategy (#284) Add support for parallel node updates within a statefulset (#283) Support namespace ExtendedOptions in cluster spec (#282) [controller] Support multi instance placement add (#275) [gomod] Update M3DB dependency (#277) [cmd] Fix instrument package name (#280) # Conflicts: # pkg/k8sops/annotations/annotations.go
This adds support for namespace
ExtendedOptions
field in cluster spec map (passing its value to namespace create request, if present).Note that I have used intermediary transformation via json (from cluster spec to protobuf) to avoid implementing manual, error prone conversion of dynamic
map[string]interface{}
which is used inExtendedOptions
.