Skip to content

Conversation

dineshba
Copy link
Contributor

This PR fixes #577

This PR will:

  • make clusterdata to have read and write functionality
stolonctl clusterdata read <options>
stolonctl clusterdata write <options>

write can read cluser data from stdin as well from file. In this way we can combine both read and write operations using |

stolonctl clustedata read --cluster-name example --store-backend etcd | stolonctl clusterdata write --cluster-name example-copy --store-backend consul

@dineshba dineshba force-pushed the write-cluster-data branch 2 times, most recently from e2da564 to 3790a15 Compare October 30, 2018 17:20
@sgotti
Copy link
Member

sgotti commented Nov 8, 2018

@dineshba Thanks for the PR! Let me know when it's ready for review.

@dineshba
Copy link
Contributor Author

dineshba commented Nov 8, 2018

It's ready for review @sgotti. Please have a look and provide your feedbacks.

Copy link
Member

@sgotti sgotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dineshba Did an initial review.

In addition you should manage dependencies using go.mod (please use latest go1.11.2) and also vendor them so they could work also with go 1.10 (go mod vendor).

@dineshba
Copy link
Contributor Author

Hi @sgotti, Added dependencies in go.mod also (used latest go1.11.2).

Copy link
Member

@sgotti sgotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fetched your PR. Some notes:

  • Please use latest go1.11.2 to generate go.mod and go.sum since previous versions had bugs generating the wrong sum.

  • Semaphore k8s test is failing because the clusterdata command has changed. These lines:

    OUT=$(./bin/stolonctl --cluster-name kube-stolon --store-backend kubernetes --kube-resource-kind configmap clusterdata | jq .cluster.status.phase)

    ./bin/stolonctl --cluster-name kube-stolon --store-backend kubernetes --kube-resource-kind configmap clusterdata | jq .

require an additional read argument.

  • The commands doc should be updated to reflect this behavior and the generated doc should be regenerated (calling scripts/gen_commands_doc.sh and committing changes).

  • Add a breaking change note to the CHANGELOG.md describing this breaking change in the stolonctl clusterdata command since this will break some current user workflow and needs to be documented.

  • Let's add a go generate comments to generate the mocks (see inline comment). So we know which source is mocked and they can be created/updated with a simple go generate ./.... Of course they should be committed like you did, just use go generate and related comments so everyone knows how to generate them. In future a script could be added to automate/test this.

@dineshba
Copy link
Contributor Author

dineshba commented Nov 24, 2018

Hi @sgotti

  1. I fixed the Semaphore k8s failing tests
  2. Added the upgrade notes under section v0.14.0
  3. Generated docs and pushed the latest doc files.

Please have a look and provide your inputs.

On side note, as we are having 9 commits as of now for this PR, shall we squash commits and make it one or two ?

@dineshba
Copy link
Contributor Author

@sgotti If possible, please have a look at this PR. We wanted this feature badly in our production.

@sgotti
Copy link
Member

sgotti commented Dec 20, 2018

@dineshba PR looks good to me. Please also add a BIG warning in the clusterdata write option to inform that this shouldn't be used if you don't know what you're doing (since it could destroy a cluster) and squash in one single commit.

@dineshba
Copy link
Contributor Author

Hi @sgotti Added warning in the docs refer. And squashed the commits.
Please have a look and provide your inputs

@dineshba dineshba force-pushed the write-cluster-data branch 8 times, most recently from 353deab to a06da63 Compare December 28, 2018 04:16
@dineshba
Copy link
Contributor Author

Hi @sgotti builds were failing for checksum error in go.sum file. Fixed it. Please have a look.

@sgotti
Copy link
Member

sgotti commented Jan 24, 2019

@dineshba Sorry for the delay. LGTM. Merging.

@sgotti sgotti merged commit 25c0fce into sorintlab:master Jan 24, 2019
@sgotti sgotti added this to the v0.14.0 milestone Apr 19, 2019
@sgotti sgotti modified the milestone: v0.14.0 Jun 6, 2019
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.

Migrate from one store to another store
3 participants