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

Support namespace ExtendedOptions in cluster spec #282

Merged
merged 5 commits into from
Mar 5, 2021

Conversation

linasm
Copy link
Collaborator

@linasm linasm commented Mar 3, 2021

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 in ExtendedOptions.

@codecov
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #282 (954eb0f) into master (66671e8) will decrease coverage by 0.03%.
The diff coverage is 63.63%.

Impacted file tree graph

@@            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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66671e8...954eb0f. Read the comment docs.

// ExtendedOptions stores the extended namespace options.
type ExtendedOptions struct {
Type string `json:"type,omitempty"`
Options map[string]DynamicOption `json:"options,omitempty"`
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@linasm linasm requested a review from schallert March 3, 2021 20:09
Copy link
Collaborator

@schallert schallert left a 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.

@linasm linasm merged commit b722629 into master Mar 5, 2021
@linasm linasm deleted the linasm/support-extended-ns-opts-in-cluster-spec branch March 5, 2021 15:09
@linasm
Copy link
Collaborator Author

linasm commented Mar 5, 2021

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.

soundvibe added a commit that referenced this pull request Apr 1, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants