Skip to content

Commit

Permalink
Refactor internals. Make the operator more lib-oriented (#536)
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
yalosev authored Oct 17, 2023
1 parent aa38dfc commit 2af3363
Show file tree
Hide file tree
Showing 59 changed files with 798 additions and 1,286 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Run golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b . v1.52.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b . v1.54.2
./golangci-lint run --sort-results --build-tags integration,test
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/tests-labeled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ jobs:
fail-fast: true
matrix:
include:
- k8s_version: "1.19"
kind_node_image: "kindest/node:v1.19.16"
cluster_name: "kube-1-19"
- k8s_version: "1.20"
kind_node_image: "kindest/node:v1.20.15"
cluster_name: "kube-1-20"
- k8s_version: "1.23"
kind_node_image: "kindest/node:v1.23.13"
kind_node_image: "kindest/node:v1.23.17"
cluster_name: "kube-1-23"
- k8s_version: "1.24"
kind_node_image: "kindest/node:v1.24.7"
kind_node_image: "kindest/node:v1.24.15"
cluster_name: "kube-1-24"
- k8s_version: "1.25"
kind_node_image: "kindest/node:v1.25.2"
kind_node_image: "kindest/node:v1.25.11"
cluster_name: "kube-1-25"
- k8s_version: "1.26"
kind_node_image: "kindest/node:v1.26.6"
cluster_name: "kube-1-26"
- k8s_version: "1.27"
kind_node_image: "kindest/node:v1.27.3"
cluster_name: "kube-1-27"
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Start kind cluster
uses: engineerd/[email protected]
with:
version: "v0.17.0"
version: "v0.20.0"
image: ${{ matrix.kind_node_image }}
name: ${{ matrix.cluster_name }}

Expand Down
10 changes: 10 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ linters-settings:
- prefix(github.com/flant/)
goimports:
local-prefixes: github.com/flant/
nolintlint:
allow-unused: true
depguard:
rules:
Main:
files:
- $all
deny:
- pkg: "gopkg.in/satori/go.uuid.v1"
desc: "Use https://github.com/gofrs/uuid instead. Satori/go.uuid is no longer maintained and has critical vulnerabilities."
issues:
exclude:
# Using underscores is a common practice, refactor in the future
Expand Down
41 changes: 20 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ module github.com/flant/shell-operator
go 1.19

require (
github.com/flant/kube-client v0.26.1
github.com/flant/kube-client v1.0.0
github.com/flant/libjq-go v1.6.3-0.20201126171326-c46a40ff22ee // branch: master
github.com/go-chi/chi/v5 v5.0.10
github.com/go-openapi/spec v0.19.8
github.com/go-openapi/strfmt v0.19.5
github.com/go-openapi/swag v0.19.14
github.com/go-openapi/swag v0.21.1
github.com/go-openapi/validate v0.19.12
github.com/gofrs/uuid/v5 v5.0.0
github.com/hashicorp/go-multierror v1.1.1
github.com/kennygrant/sanitize v1.2.4
github.com/onsi/ginkgo v1.16.5
Expand All @@ -21,36 +22,32 @@ require (
golang.org/x/time v0.3.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/robfig/cron.v2 v2.0.0-20150107220207-be2e0b0deed5
gopkg.in/satori/go.uuid.v1 v1.2.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.25.4
k8s.io/apiextensions-apiserver v0.25.4
k8s.io/apimachinery v0.25.4
k8s.io/client-go v0.25.4
k8s.io/api v0.26.9
k8s.io/apiextensions-apiserver v0.26.9
k8s.io/apimachinery v0.26.9
k8s.io/client-go v0.26.9
sigs.k8s.io/yaml v1.3.0
)

// Remove 'in body' from errors, fix for Go 1.16 (https://github.com/go-openapi/validate/pull/138).
replace github.com/go-openapi/validate => github.com/flant/go-openapi-validate v0.19.12-flant.0

require (
cloud.google.com/go v0.97.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/analysis v0.19.10 // indirect
github.com/go-openapi/errors v0.19.7 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/loads v0.19.5 // indirect
github.com/go-openapi/runtime v0.19.16 // indirect
github.com/go-stack/stack v1.8.0 // indirect
Expand All @@ -60,13 +57,14 @@ require (
github.com/google/btree v1.0.1 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand All @@ -80,6 +78,7 @@ require (
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
go.mongodb.org/mongo-driver v1.5.4 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
Expand All @@ -92,9 +91,9 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221107191617-1a15be271d1d // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect

Expand Down
Loading

0 comments on commit 2af3363

Please sign in to comment.