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

First set of changes for persistent repository. #170

Merged
merged 1 commit into from
Feb 9, 2016

Conversation

jackgr
Copy link
Contributor

@jackgr jackgr commented Jan 4, 2016

Initial PR for persistence based on MongoDB. Includes all code changes and tests correctly against a localhost instance of MongoDB. Automated tests fail because MongoDB is not running in the test environment. Next PR will automate setup of MongoDB service in the target cluster when dm is installed, and unblock unit tests.

@jackgr
Copy link
Contributor Author

jackgr commented Feb 5, 2016

@vaikas-google updated to skip the tests if mongodb is not running. Now ready to go. PTAL

@jtblin
Copy link
Contributor

jtblin commented Feb 5, 2016

Could the persistence layer made pluggable by using an interface? I don't have anything against mongodb but it isn't in our current stack so I'd rather not have to care about it. Apologies if it isn't the right forum to discuss this, but I was curious about why we picked mongodb and not make it pluggable like following the cloudproviders pattern in kubernetes for example.

@jackgr
Copy link
Contributor Author

jackgr commented Feb 5, 2016

@jtblin: it is already an interface. See repository/repository.go. There are currently two implementations, in-memory and persistent. The latter is MongoDB. Should be easy enough to add another. I suppose we could provide a repository plug-in API to make it a little cleaner. Can you open an issue for it?

@jtblin
Copy link
Contributor

jtblin commented Feb 5, 2016

ok I see. Sorry about that, I just looked quickly at the diff and it was looking like we were just adding mongodb in manager/deployments.go. Yes a plug-in API would make it cleamer, I'll open an issue about that. Thanks for the explanation.

@jackgr jackgr force-pushed the persistence branch 4 times, most recently from 811d3da to 0dd5af3 Compare February 6, 2016 18:15
"gopkg.in/mgo.v2/bson"
)

type pDeployment struct {
Copy link

Choose a reason for hiding this comment

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

why not just deployment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a persistent deployment. There's a transient deployment named tDeployment in transient.go. Yes, they're in different packages, so they could be the same, but given that we're defining types that differ significantly, I thought it better to give them different names.

@jackgr jackgr assigned jackgr and unassigned vaikas Feb 8, 2016
@jackgr
Copy link
Contributor Author

jackgr commented Feb 8, 2016

@technosophos PTAL

@@ -0,0 +1,325 @@
/*
Copy link

Choose a reason for hiding this comment

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

Is this just a rename for the existent repository?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. We have both in service. Manager falls back the transient repository if the persistent one is not available.

@jackgr
Copy link
Contributor Author

jackgr commented Feb 9, 2016

@vaikas-google Can I get an LGTM?

@vaikas
Copy link

vaikas commented Feb 9, 2016

LGTM

vaikas pushed a commit that referenced this pull request Feb 9, 2016
First set of changes for persistent repository.
@vaikas vaikas merged commit 476e71f into helm:master Feb 9, 2016
@jackgr jackgr deleted the persistence branch February 9, 2016 20:57
@jackgr
Copy link
Contributor Author

jackgr commented Mar 2, 2016

Fixes #52.

@jackgr jackgr mentioned this pull request Mar 2, 2016
MichaelMorrisEst pushed a commit to Nordix/helm that referenced this pull request Nov 17, 2023
MichaelMorrisEst pushed a commit to Nordix/helm that referenced this pull request Nov 17, 2023
Signed-off-by: yxxhero <aiopsclub@163.com>
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.

None yet

4 participants