Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add support for default pools for env providers #9
Conversation
axw
reviewed
Jan 27, 2015
| - conf, err := st.EnvironConfig() | ||
| - if err != nil { | ||
| - return errors.Trace(err) | ||
| + conf, err := st.EnvironConfig() |
axw
Jan 27, 2015
Collaborator
This looks fine for now, though I think we should rework this later so that state is not calling into the storage package. It would be better if we made these sorts of decisions in the API server code. Validation is tricky, and probably means extending the policy code.
wallyworld
Jan 27, 2015
Owner
Agreed. Rework definitely needed. I felt dirty for sure, but it was expedient.
axw
reviewed
Jan 27, 2015
| + ) | ||
| + } | ||
| + } | ||
| + if cons.Pool != "" { |
wallyworld
Jan 27, 2015
Owner
True, fixed. I did leave it there for a reason but can't recall why now. Must have been a crap reason.
axw
reviewed
Jan 27, 2015
| @@ -69,3 +69,25 @@ func IsProviderSupported(envType string, providerType ProviderType) bool { | ||
| } | ||
| return false | ||
| } | ||
| + | ||
| +type defaultStoragePool map[StorageKind]string |
axw
Jan 27, 2015
Collaborator
Doesn't really matter, but I feel compelled to say that use of a map is overkill when there can be at most 2 entries :)
|
Possible simplification re cons.Pool != "" check, but otherwise LGTM. |
wallyworld commentedJan 27, 2015
There's now a registry of default pools for environment types.
If storage is specified without a pool, the default is used.