func addDefaultPool(pm PoolManager, pool *storage.Config) error { _, err := pm.Get(pool.Name()) if err != nil && !errors.IsNotFound(err) { return errors.Annotatef(err, "loading default pool %q", pool.Name()) } if err != nil { // We got a not found error, so default pool doesn't exist. if _, err := pm.Create(pool.Name(), pool.Provider(), pool.Attrs()); err != nil { return errors.Annotatef(err, "creating default pool %q", pool.Name()) } } return nil }
// ValidateConfig is defined on the Provider interface. func (e *ebsProvider) ValidateConfig(cfg *storage.Config) error { _, err := newEbsConfig(cfg.Attrs()) return errors.Trace(err) }
// ValidateConfig is defined on the Provider interface. func (e *azureStorageProvider) ValidateConfig(cfg *storage.Config) error { _, err := newAzureStorageConfig(cfg.Attrs()) return errors.Trace(err) }