Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[*] Make operator compatible with Kubernetes 1.22 #325

Merged
merged 4 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ test-ci-unit: install-tools test-base verify-gen
install-tools:
@echo "--- $@"
GOBIN=$(tools_bin_path) go install github.com/axw/gocov/gocov
GOBIN=$(tools_bin_path) go install github.com/garethr/kubeval
GOBIN=$(tools_bin_path) go install github.com/golang/mock/mockgen
GOBIN=$(tools_bin_path) go install github.com/m3db/build-tools/linters/badtime
GOBIN=$(tools_bin_path) go install github.com/m3db/build-tools/linters/importorder
Expand All @@ -147,7 +146,7 @@ install-tools:
GOBIN=$(tools_bin_path) go install github.com/golangci/golangci-lint/cmd/golangci-lint
GOBIN=$(tools_bin_path) go install github.com/rakyll/statik
GOBIN=$(tools_bin_path) go install golang.org/x/lint/golint
GOBIN=$(tools_bin_path) go install k8s.io/kube-openapi/cmd/openapi-gen
GOBIN=$(tools_bin_path) go install sigs.k8s.io/controller-tools/cmd/controller-gen

.PHONY: mock-gen
mock-gen: install-tools mock-gen-no-deps
Expand Down Expand Up @@ -220,7 +219,6 @@ build-docker: ## Build m3db-operator docker image with go binary
helm-bundle-no-deps:
@echo "--- $@"
@helm template --namespace default helm/m3db-operator > bundle.yaml
@PATH=$(tools_bin_path):$(PATH) kubeval -v=1.12.0 bundle.yaml

.PHONY: helm-bundle
helm-bundle: install-tools helm-bundle-no-deps
Expand Down
6,648 changes: 6,645 additions & 3 deletions bundle.yaml

Large diffs are not rendered by default.

31 changes: 10 additions & 21 deletions cmd/m3db-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,16 @@ const (
)

var (
_kubeCfgFile string
_masterURL string
_operatorName = "m3db_operator"
_metricsPath = "/metrics"
_metricsPort = ":8080"
_useProxy bool
_debugLog bool
_develLog bool
_humanTime bool
_manageCRD bool
_enableCRDValidation bool
_namespace string
_kubeCfgFile string
_masterURL string
_operatorName = "m3db_operator"
_metricsPath = "/metrics"
_metricsPort = ":8080"
_useProxy bool
_debugLog bool
_develLog bool
_humanTime bool
_namespace string
)

func init() {
Expand All @@ -82,9 +80,6 @@ func init() {
flag.BoolVar(&_develLog, "devel", false, "enable development logging mode")
flag.BoolVar(&_humanTime, "human-time", false, "print human-friendly timestamps")
flag.BoolVar(&_useProxy, "proxy", false, "use kubectl proxy for cluster communication")
flag.BoolVar(&_manageCRD, "manage-crd", true, "create and update the operator's CRD specs")
// Disabled by default until openAPI validation is more tested.
flag.BoolVar(&_enableCRDValidation, "enable-crd-validation", false, "enable openAPI validation of the CR")
flag.StringVar(&_namespace, "namespace", "all", "specify a specific namespace to watch. Or specify all to watch all namespaces")
flag.Parse()
}
Expand Down Expand Up @@ -218,13 +213,7 @@ func main() {
logger.Fatal("failed to create ID provider", zap.Error(err))
}

config := controller.Configuration{
ManageCRD: _manageCRD,
EnableValidation: _enableCRDValidation,
}

opts := []controller.Option{
controller.WithConfig(config),
controller.WithKubeInformerFactory(kubeInformerFactory),
controller.WithFilteredInformerFactory(filteredInformerFactory),
controller.WithM3DBClusterInformerFactory(m3dbClusterInformerFactory),
Expand Down
6,644 changes: 6,644 additions & 0 deletions config/crd/operator.m3db.io_m3dbclusters.yaml

Large diffs are not rendered by default.

48 changes: 23 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ module github.com/m3db/m3db-operator
go 1.18

require (
github.com/ant31/crd-validation v0.0.0-20180801212718-38f6a293f140
github.com/apex/log v1.3.0 // indirect
github.com/axw/gocov v1.0.0
github.com/cirocosta/grafana-sync v0.0.0-20181123215626-6cbb4a9501c1
github.com/d4l3k/messagediff v1.2.1
github.com/evanphx/json-patch v4.11.0+incompatible
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/fossas/fossa-cli v1.0.30
github.com/garethr/kubeval v0.0.0-20180821130434-c44f5193dc94
github.com/gnewton/jargo v0.0.0-20150417131352-41f5f186a805 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-swagger/go-swagger v0.19.0
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.6.0
Expand All @@ -25,13 +27,14 @@ require (
go.uber.org/atomic v1.9.0
go.uber.org/zap v1.19.0
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
k8s.io/api v0.22.2
k8s.io/apiextensions-apiserver v0.22.2
k8s.io/apimachinery v0.22.2
k8s.io/client-go v0.22.2
k8s.io/code-generator v0.22.2
k8s.io/kube-openapi v0.0.0-20211020163157-7327e2aaee2b
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a
k8s.io/api v0.24.0
k8s.io/apiextensions-apiserver v0.24.0
k8s.io/apimachinery v0.24.0
k8s.io/client-go v0.24.0
k8s.io/code-generator v0.24.0
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
sigs.k8s.io/controller-tools v0.9.0
)

require (
Expand All @@ -47,7 +50,6 @@ require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/alexkohler/prealloc v1.0.0 // indirect
github.com/apex/log v1.3.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/ashanbrown/forbidigo v1.3.0 // indirect
github.com/ashanbrown/makezero v1.1.1 // indirect
Expand Down Expand Up @@ -79,15 +81,11 @@ require (
github.com/firefart/nonamedreturns v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/fzipp/gocyclo v0.5.1 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gnewton/jargo v0.0.0-20150417131352-41f5f186a805 // indirect
github.com/go-critic/go-critic v0.6.3 // indirect
github.com/go-logr/logr v0.4.0 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-openapi/analysis v0.20.1 // indirect
github.com/go-openapi/errors v0.20.0 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/loads v0.20.2 // indirect
github.com/go-openapi/runtime v0.19.28 // indirect
github.com/go-openapi/spec v0.20.3 // indirect
Expand All @@ -104,6 +102,7 @@ require (
github.com/go-toolsmith/strparse v1.0.0 // indirect
github.com/go-toolsmith/typep v1.0.2 // indirect
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b // indirect
github.com/gobuffalo/flect v0.2.5 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand All @@ -117,11 +116,11 @@ require (
github.com/golangci/misspell v0.3.5 // indirect
github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2 // indirect
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/go-github/v30 v30.1.0 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
Expand Down Expand Up @@ -180,6 +179,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/moricho/tparallel v0.2.1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nakabonne/nestif v0.3.1 // indirect
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect
github.com/nishanths/exhaustive v0.7.11 // indirect
Expand Down Expand Up @@ -242,9 +242,6 @@ require (
github.com/urfave/cli v1.22.2 // indirect
github.com/uudashr/gocognit v1.0.5 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/yagipy/maintidx v1.0.0 // indirect
github.com/yeya24/promlinter v0.2.0 // indirect
gitlab.com/bosi/decorder v0.2.1 // indirect
Expand All @@ -259,7 +256,7 @@ require (
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a // indirect
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand All @@ -273,14 +270,15 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
honnef.co/go/tools v0.3.1 // indirect
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c // indirect
k8s.io/klog/v2 v2.9.0 // indirect
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
mvdan.cc/gofumpt v0.3.1 // indirect
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
mvdan.cc/unparam v0.0.0-20211214103731-d0ef000c54e5 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/apache/thrift => github.com/m3db/thrift v0.0.0-20151001171628-53dd39833a08
Expand Down
Loading