Signed-off-by: Forest-L <lilin@yunify.com>
This commit is contained in:
Forest-L 2021-01-22 14:08:35 +08:00
parent 2702ba37fc
commit 854735e08f
3 changed files with 9 additions and 4 deletions

View File

@ -10,10 +10,9 @@ test: fmt
install-packr2:
GO111MODULE=on GOPROXY=https://proxy.golang.org CGO_ENABLED=0 go get -u github.com/gobuffalo/packr/v2/packr2
$(GOBIN)/packr2
$(GOBIN)/packr2 build -a -o ${BINARY} *.go
ke: install-packr2
GO111MODULE=on CGO_ENABLED=0 go build -o ${BINARY}
# install kubeye
install: ke

View File

@ -17,6 +17,7 @@ package validator
import (
"bytes"
"context"
"fmt"
packr "github.com/gobuffalo/packr/v2"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@ -283,8 +284,13 @@ func createDaemonSet(ctx context.Context, conf *ds.DaemonSet) (*ds.DaemonSet, er
getOpts := metav1.GetOptions{}
_, err2 := api.AppsV1().DaemonSets(conf.ObjectMeta.Namespace).Get(ctx, conf.ObjectMeta.Name, getOpts)
if err2 != nil {
_, _ = api.AppsV1().DaemonSets(conf.ObjectMeta.Namespace).Create(ctx, conf, listOpts)
return nil, err2
fmt.Println("Installing NPD ...")
_, err3 := api.AppsV1().DaemonSets(conf.ObjectMeta.Namespace).Create(ctx, conf, listOpts)
if err3 != nil {
return nil, err3
}
fmt.Println("Installation is successful. ")
return nil, err3
}
return nil, nil
}