Skip to content

Commit

Permalink
Add support for GlobalConfig using ThirdPartyResources.
Browse files Browse the repository at this point in the history
  • Loading branch information
caseydavenport committed Dec 6, 2016
1 parent 4c11c2c commit 00f19d4
Show file tree
Hide file tree
Showing 13 changed files with 898 additions and 84 deletions.
330 changes: 330 additions & 0 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/backend/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ type Client interface {
// the datastore and then generates subsequent KVPair updates for
// changes to the datastore.
Syncer(callbacks SyncerCallbacks) Syncer

// EnsureInitialized ensures that the backend is initialized
// any ready to be used.
EnsureInitialized() error
}

type Syncer interface {
Expand Down
4 changes: 4 additions & 0 deletions lib/backend/compat/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func NewAdaptor(c api.Client) *ModelAdaptor {
return &ModelAdaptor{client: c}
}

func (c *ModelAdaptor) EnsureInitialized() error {
return c.client.EnsureInitialized()
}

// Create an entry in the datastore. This errors if the entry already exists.
func (c *ModelAdaptor) Create(d *model.KVPair) (*model.KVPair, error) {
var err error
Expand Down
4 changes: 4 additions & 0 deletions lib/backend/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ func NewEtcdClient(config *EtcdConfig) (*EtcdClient, error) {
return &EtcdClient{etcdClient: client, etcdKeysAPI: keys}, nil
}

func (c *EtcdClient) EnsureInitialized() error {
return nil
}

func (c *EtcdClient) Syncer(callbacks api.SyncerCallbacks) api.Syncer {
return newSyncer(c.etcdKeysAPI, callbacks)
}
Expand Down
Loading

0 comments on commit 00f19d4

Please sign in to comment.