Compare commits

..

2 Commits

Author SHA1 Message Date
Minghe
b6fd3c7e98 add contributor badge (#418) 2019-12-18 17:29:16 +08:00
Minghe
1c05534071 fix KUBECONFIG no effect issue (#416)
Signed-off-by: Minghe Huang <h.minghe@gmail.com>
2019-12-18 16:59:10 +08:00
3 changed files with 10 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ fx
Poor man's function as a service.
<br/>
![CI](https://github.com/metrue/fx/workflows/ci/badge.svg)
![GitHub contributors](https://img.shields.io/github/contributors/metrue/fx)
[![CodeCov](https://codecov.io/gh/metrue/fx/branch/master/graph/badge.svg)](https://codecov.io/gh/metrue/fx)
[![Go Report Card](https://goreportcard.com/badge/github.com/metrue/fx?style=flat-square)](https://goreportcard.com/report/github.com/metrue/fx)
[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/metrue/fx)

2
fx.go
View File

@@ -16,7 +16,7 @@ import (
"github.com/urfave/cli"
)
const version = "0.8.75"
const version = "0.8.76"
func init() {
go checkForUpdate()

View File

@@ -56,7 +56,13 @@ func Provision(ctx context.Contexter) (err error) {
return err
}
var deployer infra.Deployer
if cloud.GetType() == types.CloudTypeDocker {
if os.Getenv("KUBECONFIG") != "" {
cloudType = types.CloudTypeK8S
conf = os.Getenv("KUBECONFIG")
}
ctx.Set("cloud_type", types.CloudTypeK8S)
if cloudType == types.CloudTypeDocker {
var meta map[string]string
if err := json.Unmarshal([]byte(conf), &meta); err != nil {
return err
@@ -72,12 +78,7 @@ func Provision(ctx context.Contexter) (err error) {
if err != nil {
return err
}
} else if cloud.GetType() == types.CloudTypeK8S {
ctx.Set("cloud_type", types.CloudTypeK8S)
if os.Getenv("KUBECONFIG") != "" {
conf = os.Getenv("KUBECONFIG")
}
} else if cloudType == types.CloudTypeK8S {
deployer, err = k8sInfra.CreateDeployer(conf)
if err != nil {
return err