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

stolonctl: don't show null cluster spec options #723

Closed
viggy28 opened this issue Oct 23, 2019 · 2 comments
Closed

stolonctl: don't show null cluster spec options #723

viggy28 opened this issue Oct 23, 2019 · 2 comments

Comments

@viggy28
Copy link

viggy28 commented Oct 23, 2019

Submission type

  • Bug report

Stolon version

v0.13.0 (and the recent commit too)

Unable to remove these parameters additionalWalSenders, additionalMasterReplicationSlots & automaticPgRestart from cluster spec.

Expected behaviour you didn't see

As per https://github.com/sorintlab/stolon/blob/master/doc/cluster_spec.md, patching cluster spec with null should remove the parameter whereas it didn't happen

Steps to reproduce the problem

Cluster spec already has default value of
"additionalWalSenders": null, "additionalMasterReplicationSlots": null, and "automaticPgRestart": null.

stolonctl --cluster-name stolon-cluster --store-backend=etcdv3 update --patch '{"automaticPgRestart":null}' doesn't do anything.

It's likely that

AutomaticPgRestart *bool `json:"automaticPgRestart"`
omitempty is not mentioned in the JSON tag.

@sgotti sgotti changed the title Unable to remove few parameters from cluster spec stolonctl: don't show null cluster spec options Oct 24, 2019
@sgotti
Copy link
Member

sgotti commented Oct 24, 2019

@viggy28 I think that what's confusing is that they are printed as null during a stolonctl spec. They were really removed (so I'm going to change your title) and there's no bug or issue on this side.

omitempty will avoid showing them as null when marshalled to json and print.

@sgotti
Copy link
Member

sgotti commented Feb 17, 2020

Fixed by #736

@sgotti sgotti closed this as completed Feb 17, 2020
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

No branches or pull requests

2 participants