fix: don't require ssl config

This commit is contained in:
Mikaël Cluseau 2018-06-25 20:36:34 +11:00
parent 7bb71d6da3
commit ecb3e9c868

View File

@ -66,13 +66,7 @@ func (ctx *renderContext) Config() (ba []byte, cfg *config.Config, err error) {
ctxMap := ctx.asMap() ctxMap := ctx.asMap()
// FIXME duplicate secretData, err := ctx.secretData()
sslCfg, err := cfsslconfig.LoadConfig([]byte(ctx.clusterConfig.SSLConfig))
if err != nil {
return
}
secretData, err := loadSecretData(sslCfg)
if err != nil { if err != nil {
return return
} }
@ -118,14 +112,24 @@ func (ctx *renderContext) Config() (ba []byte, cfg *config.Config, err error) {
return return
} }
func (ctx *renderContext) StaticPods() (ba []byte, err error) { func (ctx *renderContext) secretData() (data *SecretData, err error) {
// FIXME duplicate var sslCfg *cfsslconfig.Config
sslCfg, err := cfsslconfig.LoadConfig([]byte(ctx.clusterConfig.SSLConfig))
if err != nil { if ctx.clusterConfig.SSLConfig == "" {
return sslCfg = &cfsslconfig.Config{}
} else {
sslCfg, err = cfsslconfig.LoadConfig([]byte(ctx.clusterConfig.SSLConfig))
if err != nil {
return
}
} }
secretData, err := loadSecretData(sslCfg) data, err = loadSecretData(sslCfg)
return
}
func (ctx *renderContext) StaticPods() (ba []byte, err error) {
secretData, err := ctx.secretData()
if err != nil { if err != nil {
return return
} }