diff --git a/driver/manager.go b/driver/manager.go index 37436a22..13826cc8 100644 --- a/driver/manager.go +++ b/driver/manager.go @@ -147,9 +147,11 @@ func GetFactories(instanceRequired bool) []Factory { type cachedDriver struct { Driver - client *client.Client - err error - once sync.Once + client *client.Client + err error + once sync.Once + featuresOnce sync.Once + features map[Feature]bool } func (d *cachedDriver) Client(ctx context.Context) (*client.Client, error) { @@ -158,3 +160,10 @@ func (d *cachedDriver) Client(ctx context.Context) (*client.Client, error) { }) return d.client, d.err } + +func (d *cachedDriver) Features() map[Feature]bool { + d.featuresOnce.Do(func() { + d.features = d.Driver.Features() + }) + return d.features +}