Commit b28c3793 authored by fibonacci1729's avatar fibonacci1729

add feature flag to use storage driver configmaps

parent 8c56533a
......@@ -33,6 +33,12 @@ import (
"k8s.io/helm/pkg/storage/driver"
)
// Feature flags for configmaps storage driver
const UseConfigMaps = false
// Tiller's namespace
const TillerNamespace = "kube-system"
// GoTplEngine is the name of the Go template engine, as registered in the EngineYard.
const GoTplEngine = "gotpl"
......@@ -159,9 +165,24 @@ func New() *Environment {
// we can easily add some here.
GoTplEngine: e,
}
kbc := kube.New(nil)
var sd *storage.Storage
if UseConfigMaps {
c, err := kbc.Client()
if err != nil {
// panic because we cant initliaze driver with no client
panic(err)
}
sd = storage.Init(driver.NewConfigMaps(c.ConfigMaps(TillerNamespace)))
} else {
sd = storage.Init(driver.NewMemory())
}
return &Environment{
EngineYard: ey,
Releases: storage.Init(driver.NewMemory()),
KubeClient: kube.New(nil), //&PrintingKubeClient{Out: os.Stdout},
Releases: sd, //storage.Init(driver.NewMemory()),
KubeClient: kbc, //kube.New(nil), //&PrintingKubeClient{Out: os.Stdout},
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment