Skip to content

Commit

Permalink
Check if Kubernetes version is supported before running operator (#422)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Oct 2, 2018
1 parent bd1fc60 commit 66389c9
Show file tree
Hide file tree
Showing 14 changed files with 407 additions and 868 deletions.
10 changes: 5 additions & 5 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ import:
version: 1c05540f6879653db88113bc4a2b70aec4bd491f
- package: golang.org/x/sys
version: 95c6576299259db960f6c5b9b69ea52422860fce
- package: github.com/golang/protobuf
version: v1.1.0
testImport:
- package: github.com/onsi/ginkgo
version: v1.4.0
Expand Down
5 changes: 5 additions & 0 deletions pkg/operator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

hooks "github.com/appscode/kubernetes-webhook-util/admission/v1beta1"
reg_util "github.com/appscode/kutil/admissionregistration/v1beta1"
"github.com/appscode/kutil/discovery"
cs "github.com/appscode/searchlight/client/clientset/versioned"
mon_informers "github.com/appscode/searchlight/client/informers/externalversions"
"github.com/appscode/searchlight/pkg/eventer"
Expand Down Expand Up @@ -48,6 +49,10 @@ func NewOperatorConfig(clientConfig *rest.Config) *OperatorConfig {
}

func (c *OperatorConfig) New() (*Operator, error) {
if err := discovery.IsDefaultSupportedVersion(c.KubeClient); err != nil {
return nil, err
}

op := &Operator{
Config: c.Config,
clientConfig: c.ClientConfig,
Expand Down
30 changes: 26 additions & 4 deletions vendor/github.com/appscode/go-version/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 95 additions & 0 deletions vendor/github.com/appscode/kutil/discovery/lib.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 66389c9

Please sign in to comment.