diff --git a/.github/workflows/docker-publish.yaml b/.github/workflows/docker-publish.yaml index 49615d4a..fa6ef1ce 100644 --- a/.github/workflows/docker-publish.yaml +++ b/.github/workflows/docker-publish.yaml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.5 # Install the cosign tool except on PR # https://github.com/sigstore/cosign-installer diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index 59bbe155..cdc1c369 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -23,7 +23,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.5 - name: Install Helm uses: azure/setup-helm@v4.2.0 diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml index 2b2d78be..828e932a 100644 --- a/.github/workflows/hugo.yaml +++ b/.github/workflows/hugo.yaml @@ -41,7 +41,7 @@ jobs: - name: Install Dart Sass run: sudo snap install dart-sass - name: Checkout - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.5 with: submodules: recursive fetch-depth: 0 diff --git a/.github/workflows/make-test-e2e.yaml b/.github/workflows/make-test-e2e.yaml index eee25317..faa38d13 100644 --- a/.github/workflows/make-test-e2e.yaml +++ b/.github/workflows/make-test-e2e.yaml @@ -23,10 +23,10 @@ jobs: attribute: latest runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4.1.3 - - uses: actions/setup-go@v5.0.0 + - uses: actions/checkout@v4.1.5 + - uses: actions/setup-go@v5.0.1 with: - go-version: 1.22.2 + go-version: 1.22.3 - uses: docker/setup-buildx-action@v3.3.0 - uses: tale/kubectl-action@v1.4.0 with: diff --git a/.github/workflows/make-test.yaml b/.github/workflows/make-test.yaml index 510a7d5c..3d4d5286 100644 --- a/.github/workflows/make-test.yaml +++ b/.github/workflows/make-test.yaml @@ -23,8 +23,8 @@ jobs: attribute: latest runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4.1.3 - - uses: actions/setup-go@v5.0.0 + - uses: actions/checkout@v4.1.5 + - uses: actions/setup-go@v5.0.1 with: - go-version: 1.22.2 + go-version: 1.22.3 - run: ENVTEST_K8S_VERSION=${{ matrix.k8s.version }} make test diff --git a/.github/workflows/nilaway-lint.yaml b/.github/workflows/nilaway-lint.yaml index 41b171f0..8a2ca054 100644 --- a/.github/workflows/nilaway-lint.yaml +++ b/.github/workflows/nilaway-lint.yaml @@ -7,8 +7,8 @@ jobs: nilaway-lint: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4.1.3 - - uses: actions/setup-go@v5.0.0 + - uses: actions/checkout@v4.1.5 + - uses: actions/setup-go@v5.0.1 with: - go-version: 1.22.2 + go-version: 1.22.3 - run: make nilaway-lint diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index e9ec858c..b3173f78 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -7,8 +7,8 @@ jobs: pre-commit: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4.1.3 - - uses: actions/setup-go@v5.0.0 + - uses: actions/checkout@v4.1.5 + - uses: actions/setup-go@v5.0.1 with: - go-version: 1.22.2 + go-version: 1.22.3 - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/release-assets.yaml b/.github/workflows/release-assets.yaml index 70ab6847..aab04f71 100644 --- a/.github/workflows/release-assets.yaml +++ b/.github/workflows/release-assets.yaml @@ -11,11 +11,13 @@ env: jobs: release-assets: runs-on: ubuntu-22.04 + permissions: + contents: write steps: - - uses: actions/checkout@v4.1.3 - - uses: actions/setup-go@v5.0.0 + - uses: actions/checkout@v4.1.5 + - uses: actions/setup-go@v5.0.1 with: - go-version: 1.22.2 + go-version: 1.22.3 - name: Get tag from current run run: | TAG=${{ github.ref_name }} diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml index e536a801..57555621 100644 --- a/.github/workflows/release-drafter.yaml +++ b/.github/workflows/release-drafter.yaml @@ -10,6 +10,9 @@ on: jobs: release-drafter: runs-on: ubuntu-22.04 + permissions: + contents: write + pull-requests: write steps: - uses: release-drafter/release-drafter@v6.0.0 with: diff --git a/Dockerfile b/Dockerfile index ce6e3f30..86893cc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.22.2 AS builder +FROM golang:1.22.3 AS builder ARG TARGETOS TARGETARCH WORKDIR /workspace diff --git a/Makefile b/Makefile index a8497afb..6bff31ac 100644 --- a/Makefile +++ b/Makefile @@ -157,7 +157,7 @@ NAMESPACE ?= etcd-operator-system # renovate: datasource=github-tags depName=prometheus-operator/prometheus-operator PROMETHEUS_OPERATOR_VERSION ?= v0.73.2 # renovate: datasource=github-tags depName=jetstack/cert-manager -CERT_MANAGER_VERSION ?= v1.14.4 +CERT_MANAGER_VERSION ?= v1.14.5 ifndef ignore-not-found ignore-not-found = false @@ -239,16 +239,16 @@ YQ = $(LOCALBIN)/yq # renovate: datasource=github-tags depName=kubernetes-sigs/kustomize KUSTOMIZE_VERSION ?= v5.3.0 # renovate: datasource=github-tags depName=kubernetes-sigs/controller-tools -CONTROLLER_TOOLS_VERSION ?= v0.14.0 +CONTROLLER_TOOLS_VERSION ?= v0.15.0 ENVTEST_VERSION ?= latest # renovate: datasource=github-tags depName=golangci/golangci-lint -GOLANGCI_LINT_VERSION ?= v1.57.2 +GOLANGCI_LINT_VERSION ?= v1.58.1 # renovate: datasource=github-tags depName=kubernetes-sigs/kind KIND_VERSION ?= v0.22.0 # renovate: datasource=github-tags depName=helm/helm HELM_VERSION ?= v3.14.4 # renovate: datasource=github-tags depName=losisin/helm-values-schema-json -HELM_SCHEMA_VERSION ?= v1.2.4 +HELM_SCHEMA_VERSION ?= v1.3.0 # renovate: datasource=github-tags depName=norwoodj/helm-docs HELM_DOCS_VERSION ?= v1.13.1 # renovate: datasource=github-tags depName=mikefarah/yq diff --git a/OWNERS b/OWNERS index 4f70e2a4..0b2bb5d1 100644 --- a/OWNERS +++ b/OWNERS @@ -11,3 +11,4 @@ reviewers: - AlexGluck # Alex Gluck - Uburro # Grigorii Rochev - gecube # George Gaal + - aobort # Artem Bortnikov diff --git a/charts/etcd-operator/values.schema.json b/charts/etcd-operator/values.schema.json index 97400378..6fd0f134 100644 --- a/charts/etcd-operator/values.schema.json +++ b/charts/etcd-operator/values.schema.json @@ -281,4 +281,4 @@ } }, "type": "object" -} \ No newline at end of file +} diff --git a/go.mod b/go.mod index b38e9508..2515e923 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,17 @@ module github.com/aenix-io/etcd-operator -go 1.22.2 +go 1.22.3 require ( github.com/google/uuid v1.6.0 - github.com/onsi/ginkgo/v2 v2.17.1 - github.com/onsi/gomega v1.33.0 + github.com/onsi/ginkgo/v2 v2.17.3 + github.com/onsi/gomega v1.33.1 go.etcd.io/etcd/client/v3 v3.5.13 k8s.io/api v0.30.0 k8s.io/apimachinery v0.30.0 - k8s.io/client-go v0.29.3 - k8s.io/utils v0.0.0-20240310230437-4693a0247e57 - sigs.k8s.io/controller-runtime v0.17.3 + k8s.io/client-go v0.30.0 + k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 + sigs.k8s.io/controller-runtime v0.18.2 ) require ( @@ -21,21 +21,21 @@ require ( github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/evanphx/json-patch/v5 v5.8.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/zapr v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect + github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect github.com/imdario/mergo v0.3.6 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -55,13 +55,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.23.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.20.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect @@ -72,8 +72,7 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.29.2 // indirect - k8s.io/component-base v0.29.2 // indirect + k8s.io/apiextensions-apiserver v0.30.0 // indirect k8s.io/klog/v2 v2.120.1 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index 31c50a34..5e71523d 100644 --- a/go.sum +++ b/go.sum @@ -2,9 +2,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -17,8 +14,8 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1u0KQro= -github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= +github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= @@ -31,8 +28,8 @@ github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2Kv github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -49,11 +46,10 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -80,10 +76,10 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= -github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= -github.com/onsi/gomega v1.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE= -github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY= +github.com/onsi/ginkgo/v2 v2.17.3 h1:oJcvKpIb7/8uLpDDtnQuf18xVnwKp8DTD7DQ6gTd/MU= +github.com/onsi/ginkgo/v2 v2.17.3/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -104,7 +100,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= @@ -136,8 +131,8 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -145,12 +140,11 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -162,8 +156,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -195,22 +189,20 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= k8s.io/api v0.30.0 h1:siWhRq7cNjy2iHssOB9SCGNCl2spiF1dO3dABqZ8niA= k8s.io/api v0.30.0/go.mod h1:OPlaYhoHs8EQ1ql0R/TsUgaRPhpKNxIMrKQfWUp8QSE= -k8s.io/apiextensions-apiserver v0.29.2 h1:UK3xB5lOWSnhaCk0RFZ0LUacPZz9RY4wi/yt2Iu+btg= -k8s.io/apiextensions-apiserver v0.29.2/go.mod h1:aLfYjpA5p3OwtqNXQFkhJ56TB+spV8Gc4wfMhUA3/b8= +k8s.io/apiextensions-apiserver v0.30.0 h1:jcZFKMqnICJfRxTgnC4E+Hpcq8UEhT8B2lhBcQ+6uAs= +k8s.io/apiextensions-apiserver v0.30.0/go.mod h1:N9ogQFGcrbWqAY9p2mUAL5mGxsLqwgtUce127VtRX5Y= k8s.io/apimachinery v0.30.0 h1:qxVPsyDM5XS96NIh9Oj6LavoVFYff/Pon9cZeDIkHHA= k8s.io/apimachinery v0.30.0/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= -k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= -k8s.io/component-base v0.29.2 h1:lpiLyuvPA9yV1aQwGLENYyK7n/8t6l3nn3zAtFTJYe8= -k8s.io/component-base v0.29.2/go.mod h1:BfB3SLrefbZXiBfbM+2H1dlat21Uewg/5qtKOl8degM= +k8s.io/client-go v0.30.0 h1:sB1AGGlhY/o7KCyCEQ0bPWzYDL0pwOZO4vAtTSh/gJQ= +k8s.io/client-go v0.30.0/go.mod h1:g7li5O5256qe6TYdAMyX/otJqMhIiGgTapdLchhmOaY= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY= -k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.17.3 h1:65QmN7r3FWgTxDMz9fvGnO1kbf2nu+acg9p2R9oYYYk= -sigs.k8s.io/controller-runtime v0.17.3/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY= +k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak= +k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/controller-runtime v0.18.2 h1:RqVW6Kpeaji67CY5nPEfRz6ZfFMk0lWQlNrLqlNpx+Q= +sigs.k8s.io/controller-runtime v0.18.2/go.mod h1:tuAt1+wbVsXIT8lPtk5RURxqAnq7xkpv2Mhttslg7Hw= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/internal/controller/etcdcluster_controller.go b/internal/controller/etcdcluster_controller.go index f9860315..d3834494 100644 --- a/internal/controller/etcdcluster_controller.go +++ b/internal/controller/etcdcluster_controller.go @@ -22,6 +22,7 @@ import ( "fmt" policyv1 "k8s.io/api/policy/v1" + "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/predicate" @@ -32,7 +33,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" etcdaenixiov1alpha1 "github.com/aenix-io/etcd-operator/api/v1alpha1" @@ -127,45 +127,49 @@ func (r *EtcdClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) // ensureClusterObjects creates or updates all objects owned by cluster CR func (r *EtcdClusterReconciler) ensureClusterObjects( ctx context.Context, cluster *etcdaenixiov1alpha1.EtcdCluster) error { - if err := factory.CreateOrUpdateClusterStateConfigMap(ctx, cluster, r.Client, r.Scheme); err != nil { + if err := factory.CreateOrUpdateClusterStateConfigMap(ctx, cluster, r.Client); err != nil { return err } - if err := factory.CreateOrUpdateHeadlessService(ctx, cluster, r.Client, r.Scheme); err != nil { + if err := factory.CreateOrUpdateHeadlessService(ctx, cluster, r.Client); err != nil { return err } - if err := factory.CreateOrUpdateStatefulSet(ctx, cluster, r.Client, r.Scheme); err != nil { + if err := factory.CreateOrUpdateStatefulSet(ctx, cluster, r.Client); err != nil { return err } - if err := factory.CreateOrUpdateClientService(ctx, cluster, r.Client, r.Scheme); err != nil { + if err := factory.CreateOrUpdateClientService(ctx, cluster, r.Client); err != nil { return err } - if err := factory.CreateOrUpdatePdb(ctx, cluster, r.Client, r.Scheme); err != nil { + if err := factory.CreateOrUpdatePdb(ctx, cluster, r.Client); err != nil { return err } - return nil } // updateStatusOnErr wraps error and updates EtcdCluster status func (r *EtcdClusterReconciler) updateStatusOnErr(ctx context.Context, cluster *etcdaenixiov1alpha1.EtcdCluster, err error) (ctrl.Result, error) { - res, statusErr := r.updateStatus(ctx, cluster) + // The function 'updateStatusOnErr' will always return non-nil error. Hence, the ctrl.Result will always be ignored. + // Therefore, the ctrl.Result returned by 'updateStatus' function can be discarded. + // REF: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/reconcile@v0.17.3#Reconciler + _, statusErr := r.updateStatus(ctx, cluster) if statusErr != nil { - return res, goerrors.Join(statusErr, err) + return ctrl.Result{}, goerrors.Join(statusErr, err) } - return res, err + return ctrl.Result{}, err } // updateStatus updates EtcdCluster status and returns error and requeue in case status could not be updated due to conflict func (r *EtcdClusterReconciler) updateStatus(ctx context.Context, cluster *etcdaenixiov1alpha1.EtcdCluster) (ctrl.Result, error) { logger := log.FromContext(ctx) - if err := r.Status().Update(ctx, cluster); err != nil { - logger.Error(err, "unable to update cluster status") - if errors.IsConflict(err) { - return ctrl.Result{Requeue: true}, nil - } - return ctrl.Result{}, err + err := r.Status().Update(ctx, cluster) + if err == nil { + return ctrl.Result{}, nil + } + if errors.IsConflict(err) { + logger.V(2).Info("conflict during cluster status update") + return ctrl.Result{Requeue: true}, nil } - return ctrl.Result{}, nil + logger.Error(err, "cannot update cluster status") + return ctrl.Result{}, err } // isStatefulSetReady gets managed StatefulSet and checks its readiness. diff --git a/internal/controller/factory/builders.go b/internal/controller/factory/builders.go index af18e07d..da1cc719 100644 --- a/internal/controller/factory/builders.go +++ b/internal/controller/factory/builders.go @@ -20,123 +20,46 @@ import ( "context" "fmt" - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/api/policy/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/apiutil" "sigs.k8s.io/controller-runtime/pkg/log" ) -func reconcileStatefulSet(ctx context.Context, rclient client.Client, crdName string, sts *appsv1.StatefulSet) error { - logger := log.FromContext(ctx) - logger.V(2).Info("statefulset reconciliation started") - - currentSts := &appsv1.StatefulSet{} - logger.V(2).Info("statefulset found", "sts_name", currentSts.Name) - - err := rclient.Get(ctx, types.NamespacedName{Namespace: sts.Namespace, Name: sts.Name}, currentSts) - if err != nil { - if errors.IsNotFound(err) { - logger.V(2).Info("creating new statefulset", "sts_name", sts.Name, "crd_object", crdName) - return rclient.Create(ctx, sts) - } - return fmt.Errorf("cannot get existing statefulset: %s, for crd_object: %s, err: %w", sts.Name, crdName, err) - } - sts.Annotations = labels.Merge(currentSts.Annotations, sts.Annotations) - logger.V(2).Info("statefulset annotations merged", "sts_annotations", sts.Annotations) - sts.Status = currentSts.Status - return rclient.Update(ctx, sts) -} - -func reconcileConfigMap(ctx context.Context, rclient client.Client, crdName string, configMap *corev1.ConfigMap) error { - logger := log.FromContext(ctx) - logger.V(2).Info("configmap reconciliation started") - - currentConfigMap := &corev1.ConfigMap{} - logger.V(2).Info("configmap found", "cm_name", currentConfigMap.Name) - - err := rclient.Get(ctx, types.NamespacedName{Namespace: configMap.Namespace, Name: configMap.Name}, currentConfigMap) - if err != nil { - if errors.IsNotFound(err) { - logger.V(2).Info("creating new configMap", "cm_name", configMap.Name, "crd_object", crdName) - return rclient.Create(ctx, configMap) - } - return fmt.Errorf("cannot get existing configMap: %s, for crd_object: %s, err: %w", configMap.Name, crdName, err) - } - configMap.Annotations = labels.Merge(currentConfigMap.Annotations, configMap.Annotations) - logger.V(2).Info("configmap annotations merged", "cm_annotations", configMap.Annotations) - return rclient.Update(ctx, configMap) -} - -func reconcileService(ctx context.Context, rclient client.Client, crdName string, svc *corev1.Service) error { - logger := log.FromContext(ctx) - logger.V(2).Info("service reconciliation started") - - if svc == nil { - return fmt.Errorf("service is nil for crd_object: %s", crdName) +func reconcileOwnedResource(ctx context.Context, c client.Client, resource client.Object) error { + if resource == nil { + return fmt.Errorf("resource cannot be nil") } - - currentSvc := &corev1.Service{} - logger.V(2).Info("service found", "svc_name", currentSvc.Name) - - err := rclient.Get(ctx, types.NamespacedName{Namespace: svc.Namespace, Name: svc.Name}, currentSvc) + gvk, err := apiutil.GVKForObject(resource, c.Scheme()) if err != nil { - if errors.IsNotFound(err) { - logger.V(2).Info("creating new service", "svc_name", svc.Name, "crd_object", crdName) - return rclient.Create(ctx, svc) - } - return fmt.Errorf("cannot get existing service: %s, for crd_object: %s, err: %w", svc.Name, crdName, err) + return fmt.Errorf("failed to get GVK: %w", err) } - svc.Annotations = labels.Merge(currentSvc.Annotations, svc.Annotations) - logger.V(2).Info("service annotations merged", "svc_annotations", svc.Annotations) - svc.Status = currentSvc.Status - return rclient.Update(ctx, svc) -} - -// deleteManagedPdb deletes cluster PDB if it exists. -// pdb parameter should have at least metadata.name and metadata.namespace fields filled. -func deleteManagedPdb(ctx context.Context, rclient client.Client, pdb *v1.PodDisruptionBudget) error { - logger := log.FromContext(ctx) - - currentPdb := &v1.PodDisruptionBudget{} - logger.V(2).Info("pdb found", "pdb_name", currentPdb.Name) - - err := rclient.Get(ctx, types.NamespacedName{Namespace: pdb.Namespace, Name: pdb.Name}, currentPdb) - if err != nil { - logger.V(2).Info("error getting cluster PDB", "error", err) - return client.IgnoreNotFound(err) + logger := log.FromContext(ctx).WithValues("group", gvk.GroupVersion().String(), "kind", gvk.Kind, "name", resource.GetName()) + logger.V(2).Info("reconciling owned resource") + + base := resource.DeepCopyObject().(client.Object) + err = c.Get(ctx, client.ObjectKeyFromObject(resource), base) + if err == nil { + logger.V(2).Info("updating owned resource") + resource.SetAnnotations(labels.Merge(base.GetAnnotations(), resource.GetAnnotations())) + resource.SetResourceVersion(base.GetResourceVersion()) + logger.V(2).Info("owned resource annotations merged", "annotations", resource.GetAnnotations()) + return c.Update(ctx, resource) } - err = rclient.Delete(ctx, currentPdb) - if err != nil { - logger.Error(err, "error deleting cluster PDB", "name", pdb.Name) - return client.IgnoreNotFound(err) + if errors.IsNotFound(err) { + logger.V(2).Info("creating new owned resource") + return c.Create(ctx, resource) } - - return nil + return fmt.Errorf("error getting owned resource: %w", err) } -func reconcilePdb(ctx context.Context, rclient client.Client, crdName string, pdb *v1.PodDisruptionBudget) error { - logger := log.FromContext(ctx) - logger.V(2).Info("pdb reconciliation started") - - currentPdb := &v1.PodDisruptionBudget{} - logger.V(2).Info("pdb found", "pdb_name", currentPdb.Name) - - err := rclient.Get(ctx, types.NamespacedName{Namespace: pdb.Namespace, Name: pdb.Name}, currentPdb) +func deleteOwnedResource(ctx context.Context, c client.Client, resource client.Object) error { + gvk, err := apiutil.GVKForObject(resource, c.Scheme()) if err != nil { - if errors.IsNotFound(err) { - logger.V(2).Info("creating new PDB", "pdb_name", pdb.Name, "crd_object", crdName) - return rclient.Create(ctx, pdb) - } - logger.V(2).Info("error getting cluster PDB", "error", err) - return fmt.Errorf("cannot get existing pdb resource: %s for crd_object: %s, err: %w", pdb.Name, crdName, err) + return err } - pdb.Annotations = labels.Merge(currentPdb.Annotations, pdb.Annotations) - logger.V(2).Info("pdb annotations merged", "pdb_annotations", pdb.Annotations) - pdb.ResourceVersion = currentPdb.ResourceVersion - pdb.Status = currentPdb.Status - return rclient.Update(ctx, pdb) + logger := log.FromContext(ctx).WithValues("group", gvk.GroupVersion().String(), "kind", gvk.Kind, "name", resource.GetName()) + logger.V(2).Info("deleting owned resource") + return client.IgnoreNotFound(c.Delete(ctx, resource)) } diff --git a/internal/controller/factory/configMap.go b/internal/controller/factory/configMap.go index 2271f79d..5c7bbc38 100644 --- a/internal/controller/factory/configMap.go +++ b/internal/controller/factory/configMap.go @@ -20,15 +20,12 @@ import ( "context" "fmt" + etcdaenixiov1alpha1 "github.com/aenix-io/etcd-operator/api/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" - - etcdaenixiov1alpha1 "github.com/aenix-io/etcd-operator/api/v1alpha1" ) func GetClusterStateConfigMapName(cluster *etcdaenixiov1alpha1.EtcdCluster) string { @@ -39,7 +36,6 @@ func CreateOrUpdateClusterStateConfigMap( ctx context.Context, cluster *etcdaenixiov1alpha1.EtcdCluster, rclient client.Client, - rscheme *runtime.Scheme, ) error { initialCluster := "" clusterService := fmt.Sprintf("%s.%s.svc:2380", GetHeadlessServiceName(cluster), cluster.Namespace) @@ -73,11 +69,11 @@ func CreateOrUpdateClusterStateConfigMap( } logger.V(2).Info("configmap spec generated", "cm_name", configMap.Name, "cm_spec", configMap.Data) - if err := ctrl.SetControllerReference(cluster, configMap, rscheme); err != nil { + if err := ctrl.SetControllerReference(cluster, configMap, rclient.Scheme()); err != nil { return fmt.Errorf("cannot set controller reference: %w", err) } - return reconcileConfigMap(ctx, rclient, cluster.Name, configMap) + return reconcileOwnedResource(ctx, rclient, configMap) } // isEtcdClusterReady returns true if condition "Ready" has progressed diff --git a/internal/controller/factory/configmap_test.go b/internal/controller/factory/configmap_test.go index 06d3dcde..2b83f994 100644 --- a/internal/controller/factory/configmap_test.go +++ b/internal/controller/factory/configmap_test.go @@ -19,7 +19,6 @@ package factory import ( "github.com/google/uuid" apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/ptr" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" @@ -88,7 +87,7 @@ var _ = Describe("CreateOrUpdateClusterStateConfigMap handlers", func() { It("should successfully ensure the configmap", func(ctx SpecContext) { var configMapUID types.UID By("processing new etcd cluster", func() { - Expect(CreateOrUpdateClusterStateConfigMap(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateClusterStateConfigMap(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Get(&configMap)).Should(Succeed()) Expect(configMap.Data["ETCD_INITIAL_CLUSTER_STATE"]).To(Equal("new")) configMapUID = configMap.GetUID() @@ -99,7 +98,7 @@ var _ = Describe("CreateOrUpdateClusterStateConfigMap handlers", func() { WithReason(string(etcdaenixiov1alpha1.EtcdCondTypeStatefulSetReady)). WithStatus(true). Complete()) - Expect(CreateOrUpdateClusterStateConfigMap(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateClusterStateConfigMap(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Object(&configMap)).Should(HaveField("ObjectMeta.UID", Equal(configMapUID))) Expect(configMap.Data["ETCD_INITIAL_CLUSTER_STATE"]).To(Equal("existing")) }) @@ -109,15 +108,14 @@ var _ = Describe("CreateOrUpdateClusterStateConfigMap handlers", func() { WithReason(string(etcdaenixiov1alpha1.EtcdCondTypeWaitingForFirstQuorum)). WithStatus(true). Complete()) - Expect(CreateOrUpdateClusterStateConfigMap(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateClusterStateConfigMap(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Object(&configMap)).Should(HaveField("ObjectMeta.UID", Equal(configMapUID))) Expect(configMap.Data["ETCD_INITIAL_CLUSTER_STATE"]).To(Equal("new")) }) }) It("should fail to create the configmap with invalid owner reference", func(ctx SpecContext) { - emptyScheme := runtime.NewScheme() - Expect(CreateOrUpdateClusterStateConfigMap(ctx, &etcdcluster, k8sClient, emptyScheme)).NotTo(Succeed()) + Expect(CreateOrUpdateClusterStateConfigMap(ctx, &etcdcluster, clientWithEmptyScheme)).NotTo(Succeed()) }) }) }) diff --git a/internal/controller/factory/pdb.go b/internal/controller/factory/pdb.go index b7d449f8..efadbb93 100644 --- a/internal/controller/factory/pdb.go +++ b/internal/controller/factory/pdb.go @@ -23,7 +23,6 @@ import ( etcdaenixiov1alpha1 "github.com/aenix-io/etcd-operator/api/v1alpha1" v1 "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" @@ -35,10 +34,9 @@ func CreateOrUpdatePdb( ctx context.Context, cluster *etcdaenixiov1alpha1.EtcdCluster, rclient client.Client, - rscheme *runtime.Scheme, ) error { if cluster.Spec.PodDisruptionBudgetTemplate == nil { - return deleteManagedPdb(ctx, rclient, &v1.PodDisruptionBudget{ + return deleteOwnedResource(ctx, rclient, &v1.PodDisruptionBudget{ ObjectMeta: metav1.ObjectMeta{ Namespace: cluster.Namespace, Name: cluster.Name, @@ -67,9 +65,9 @@ func CreateOrUpdatePdb( logger.V(2).Info("pdb spec generated", "pdb_name", pdb.Name, "pdb_spec", pdb.Spec) - if err := ctrl.SetControllerReference(cluster, pdb, rscheme); err != nil { + if err := ctrl.SetControllerReference(cluster, pdb, rclient.Scheme()); err != nil { return fmt.Errorf("cannot set controller reference: %w", err) } - return reconcilePdb(ctx, rclient, cluster.Name, pdb) + return reconcileOwnedResource(ctx, rclient, pdb) } diff --git a/internal/controller/factory/pdb_test.go b/internal/controller/factory/pdb_test.go index 32405d28..436a11cf 100644 --- a/internal/controller/factory/pdb_test.go +++ b/internal/controller/factory/pdb_test.go @@ -87,7 +87,7 @@ var _ = Describe("CreateOrUpdatePdb handlers", func() { It("should create PDB with pre-filled data", func(ctx SpecContext) { etcdcluster.Spec.PodDisruptionBudgetTemplate.Spec.MinAvailable = ptr.To(intstr.FromInt32(int32(3))) - Expect(CreateOrUpdatePdb(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdatePdb(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Get(&podDisruptionBudget)).Should(Succeed()) Expect(podDisruptionBudget.Spec.MinAvailable).NotTo(BeNil()) Expect(podDisruptionBudget.Spec.MinAvailable.IntValue()).To(Equal(3)) @@ -95,7 +95,7 @@ var _ = Describe("CreateOrUpdatePdb handlers", func() { }) It("should create PDB with empty data", func(ctx SpecContext) { - Expect(CreateOrUpdatePdb(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdatePdb(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Get(&podDisruptionBudget)).Should(Succeed()) Expect(etcdcluster.Spec.PodDisruptionBudgetTemplate.Spec.MinAvailable).To(BeNil()) Expect(podDisruptionBudget.Spec.MinAvailable.IntValue()).To(Equal(2)) @@ -104,14 +104,14 @@ var _ = Describe("CreateOrUpdatePdb handlers", func() { It("should skip deletion of PDB if not filled and not exist", func(ctx SpecContext) { etcdcluster.Spec.PodDisruptionBudgetTemplate = nil - Expect(CreateOrUpdatePdb(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).NotTo(HaveOccurred()) + Expect(CreateOrUpdatePdb(ctx, &etcdcluster, k8sClient)).NotTo(HaveOccurred()) }) It("should delete created PDB after updating CR", func(ctx SpecContext) { - Expect(CreateOrUpdatePdb(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdatePdb(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Get(&podDisruptionBudget)).Should(Succeed()) etcdcluster.Spec.PodDisruptionBudgetTemplate = nil - Expect(CreateOrUpdatePdb(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).NotTo(HaveOccurred()) + Expect(CreateOrUpdatePdb(ctx, &etcdcluster, k8sClient)).NotTo(HaveOccurred()) err = Get(&podDisruptionBudget)() Expect(apierrors.IsNotFound(err)).To(BeTrue()) }) diff --git a/internal/controller/factory/statefulset.go b/internal/controller/factory/statefulset.go index 2660f5a4..c29bf5c9 100644 --- a/internal/controller/factory/statefulset.go +++ b/internal/controller/factory/statefulset.go @@ -23,11 +23,9 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" etcdaenixiov1alpha1 "github.com/aenix-io/etcd-operator/api/v1alpha1" @@ -42,7 +40,6 @@ func CreateOrUpdateStatefulSet( ctx context.Context, cluster *etcdaenixiov1alpha1.EtcdCluster, rclient client.Client, - rscheme *runtime.Scheme, ) error { podMetadata := metav1.ObjectMeta{ Labels: NewLabelsBuilder().WithName().WithInstance(cluster.Name).WithManagedBy(), @@ -107,11 +104,11 @@ func CreateOrUpdateStatefulSet( logger := log.FromContext(ctx) logger.V(2).Info("statefulset spec generated", "sts_name", statefulSet.Name, "sts_spec", statefulSet.Spec) - if err := ctrl.SetControllerReference(cluster, statefulSet, rscheme); err != nil { + if err = ctrl.SetControllerReference(cluster, statefulSet, rclient.Scheme()); err != nil { return fmt.Errorf("cannot set controller reference: %w", err) } - return reconcileStatefulSet(ctx, rclient, cluster.Name, statefulSet) + return reconcileOwnedResource(ctx, rclient, statefulSet) } func generateVolumes(cluster *etcdaenixiov1alpha1.EtcdCluster) []corev1.Volume { diff --git a/internal/controller/factory/statefulset_test.go b/internal/controller/factory/statefulset_test.go index fe0008de..a3aaf3e3 100644 --- a/internal/controller/factory/statefulset_test.go +++ b/internal/controller/factory/statefulset_test.go @@ -20,7 +20,6 @@ import ( "github.com/google/uuid" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/utils/ptr" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" @@ -89,7 +88,7 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() { }) It("should successfully ensure the statefulSet with empty spec", func(ctx SpecContext) { - Expect(CreateOrUpdateStatefulSet(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateStatefulSet(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Object(&statefulSet)).Should( HaveField("Spec.Replicas", Equal(etcdcluster.Spec.Replicas)), ) @@ -153,7 +152,7 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() { ClientSecret: "client-secret", }, } - Expect(CreateOrUpdateStatefulSet(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateStatefulSet(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Get(&statefulSet)).Should(Succeed()) By("Checking the resources", func() { @@ -301,7 +300,7 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() { }, }, } - Expect(CreateOrUpdateStatefulSet(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateStatefulSet(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Get(&statefulSet)).Should(Succeed()) By("Checking the updated startup probe", func() { @@ -361,7 +360,7 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() { SizeLimit: ptr.To(size), }, } - Expect(CreateOrUpdateStatefulSet(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateStatefulSet(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Get(&statefulSet)).Should(Succeed()) By("Checking the emptyDir", func() { @@ -370,8 +369,7 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() { }) It("should fail on creating the statefulset with invalid owner reference", func(ctx SpecContext) { - emptyScheme := runtime.NewScheme() - Expect(CreateOrUpdateStatefulSet(ctx, &etcdcluster, k8sClient, emptyScheme)).NotTo(Succeed()) + Expect(CreateOrUpdateStatefulSet(ctx, &etcdcluster, clientWithEmptyScheme)).NotTo(Succeed()) }) }) diff --git a/internal/controller/factory/suite_test.go b/internal/controller/factory/suite_test.go index 0f472a3d..7260b791 100644 --- a/internal/controller/factory/suite_test.go +++ b/internal/controller/factory/suite_test.go @@ -24,12 +24,12 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" - + kruntime "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" + . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" @@ -42,7 +42,7 @@ import ( // http://onsi.github.io/ginkgo/ to learn more about Ginkgo. var cfg *rest.Config -var k8sClient client.Client +var k8sClient, clientWithEmptyScheme client.Client var testEnv *envtest.Environment func TestFactories(t *testing.T) { @@ -80,6 +80,9 @@ var _ = BeforeSuite(func() { // +kubebuilder:scaffold:scheme + clientWithEmptyScheme, err = client.New(cfg, client.Options{Scheme: kruntime.NewScheme()}) + Expect(err).NotTo(HaveOccurred()) + k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) Expect(err).NotTo(HaveOccurred()) Expect(k8sClient).NotTo(BeNil()) diff --git a/internal/controller/factory/svc.go b/internal/controller/factory/svc.go index 499c0780..9d857dd6 100644 --- a/internal/controller/factory/svc.go +++ b/internal/controller/factory/svc.go @@ -22,11 +22,9 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" etcdaenixiov1alpha1 "github.com/aenix-io/etcd-operator/api/v1alpha1" @@ -53,7 +51,6 @@ func CreateOrUpdateHeadlessService( ctx context.Context, cluster *etcdaenixiov1alpha1.EtcdCluster, rclient client.Client, - rscheme *runtime.Scheme, ) error { logger := log.FromContext(ctx) var err error @@ -87,18 +84,17 @@ func CreateOrUpdateHeadlessService( logger.V(2).Info("cluster service spec generated", "svc_name", svc.Name, "svc_spec", svc.Spec) - if err := ctrl.SetControllerReference(cluster, svc, rscheme); err != nil { + if err := ctrl.SetControllerReference(cluster, svc, rclient.Scheme()); err != nil { return fmt.Errorf("cannot set controller reference: %w", err) } - return reconcileService(ctx, rclient, cluster.Name, svc) + return reconcileOwnedResource(ctx, rclient, svc) } func CreateOrUpdateClientService( ctx context.Context, cluster *etcdaenixiov1alpha1.EtcdCluster, rclient client.Client, - rscheme *runtime.Scheme, ) error { logger := log.FromContext(ctx) var err error @@ -130,9 +126,9 @@ func CreateOrUpdateClientService( logger.V(2).Info("client service spec generated", "svc_name", svc.Name, "svc_spec", svc.Spec) - if err := ctrl.SetControllerReference(cluster, &svc, rscheme); err != nil { + if err := ctrl.SetControllerReference(cluster, &svc, rclient.Scheme()); err != nil { return fmt.Errorf("cannot set controller reference: %w", err) } - return reconcileService(ctx, rclient, cluster.Name, &svc) + return reconcileOwnedResource(ctx, rclient, &svc) } diff --git a/internal/controller/factory/svc_test.go b/internal/controller/factory/svc_test.go index 3f8bd498..0e27752c 100644 --- a/internal/controller/factory/svc_test.go +++ b/internal/controller/factory/svc_test.go @@ -19,7 +19,6 @@ package factory import ( "github.com/google/uuid" apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/ptr" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" @@ -99,7 +98,7 @@ var _ = Describe("CreateOrUpdateService handlers", func() { }) It("should successfully ensure headless service", func(ctx SpecContext) { - Expect(CreateOrUpdateHeadlessService(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateHeadlessService(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Object(&headlessService)).Should(SatisfyAll( HaveField("Spec.Type", Equal(corev1.ServiceTypeClusterIP)), HaveField("Spec.ClusterIP", Equal(corev1.ClusterIPNone)), @@ -107,8 +106,7 @@ var _ = Describe("CreateOrUpdateService handlers", func() { }) It("should successfully ensure headless service with custom metadata", func(ctx SpecContext) { - cluster := etcdcluster.DeepCopy() - cluster.Spec.HeadlessServiceTemplate = &etcdaenixiov1alpha1.EmbeddedMetadataResource{ + etcdcluster.Spec.HeadlessServiceTemplate = &etcdaenixiov1alpha1.EmbeddedMetadataResource{ EmbeddedObjectMetadata: etcdaenixiov1alpha1.EmbeddedObjectMetadata{ Name: "headless-name", Labels: map[string]string{"label": "value"}, @@ -116,23 +114,23 @@ var _ = Describe("CreateOrUpdateService handlers", func() { }, } svc := headlessService.DeepCopy() - svc.Name = cluster.Spec.HeadlessServiceTemplate.Name + svc.Name = etcdcluster.Spec.HeadlessServiceTemplate.Name - Expect(CreateOrUpdateHeadlessService(ctx, cluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateHeadlessService(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Object(svc)).Should(SatisfyAll( - HaveField("ObjectMeta.Name", Equal(cluster.Spec.HeadlessServiceTemplate.Name)), + HaveField("ObjectMeta.Name", Equal(etcdcluster.Spec.HeadlessServiceTemplate.Name)), HaveField("ObjectMeta.Labels", SatisfyAll( HaveKeyWithValue("label", "value"), HaveKeyWithValue("app.kubernetes.io/name", "etcd"), )), - HaveField("ObjectMeta.Annotations", Equal(cluster.Spec.HeadlessServiceTemplate.Annotations)), + HaveField("ObjectMeta.Annotations", Equal(etcdcluster.Spec.HeadlessServiceTemplate.Annotations)), )) // We need to manually cleanup here because we changed the name of the service Expect(k8sClient.Delete(ctx, svc)).Should(Succeed()) }) It("should successfully ensure client service", func(ctx SpecContext) { - Expect(CreateOrUpdateClientService(ctx, &etcdcluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateClientService(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Object(&clientService)).Should(SatisfyAll( HaveField("Spec.Type", Equal(corev1.ServiceTypeClusterIP)), HaveField("Spec.ClusterIP", Not(Equal(corev1.ClusterIPNone))), @@ -140,8 +138,7 @@ var _ = Describe("CreateOrUpdateService handlers", func() { }) It("should successfully ensure client service with custom metadata", func(ctx SpecContext) { - cluster := etcdcluster.DeepCopy() - cluster.Spec.ServiceTemplate = &etcdaenixiov1alpha1.EmbeddedService{ + etcdcluster.Spec.ServiceTemplate = &etcdaenixiov1alpha1.EmbeddedService{ EmbeddedObjectMetadata: etcdaenixiov1alpha1.EmbeddedObjectMetadata{ Name: "client-name", Labels: map[string]string{"label": "value"}, @@ -149,24 +146,23 @@ var _ = Describe("CreateOrUpdateService handlers", func() { }, } svc := clientService.DeepCopy() - svc.Name = cluster.Spec.ServiceTemplate.Name + svc.Name = etcdcluster.Spec.ServiceTemplate.Name - Expect(CreateOrUpdateClientService(ctx, cluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateClientService(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Object(svc)).Should(SatisfyAll( - HaveField("ObjectMeta.Name", Equal(cluster.Spec.ServiceTemplate.Name)), + HaveField("ObjectMeta.Name", Equal(etcdcluster.Spec.ServiceTemplate.Name)), HaveField("ObjectMeta.Labels", SatisfyAll( HaveKeyWithValue("label", "value"), HaveKeyWithValue("app.kubernetes.io/name", "etcd"), )), - HaveField("ObjectMeta.Annotations", Equal(cluster.Spec.ServiceTemplate.Annotations)), + HaveField("ObjectMeta.Annotations", Equal(etcdcluster.Spec.ServiceTemplate.Annotations)), )) // We need to manually cleanup here because we changed the name of the service Expect(k8sClient.Delete(ctx, svc)).Should(Succeed()) }) It("should successfully ensure client service with custom spec", func(ctx SpecContext) { - cluster := etcdcluster.DeepCopy() - cluster.Spec.ServiceTemplate = &etcdaenixiov1alpha1.EmbeddedService{ + etcdcluster.Spec.ServiceTemplate = &etcdaenixiov1alpha1.EmbeddedService{ Spec: corev1.ServiceSpec{ Type: corev1.ServiceTypeLoadBalancer, Ports: []corev1.ServicePort{ @@ -180,7 +176,7 @@ var _ = Describe("CreateOrUpdateService handlers", func() { }, } - Expect(CreateOrUpdateClientService(ctx, cluster, k8sClient, k8sClient.Scheme())).To(Succeed()) + Expect(CreateOrUpdateClientService(ctx, &etcdcluster, k8sClient)).To(Succeed()) Eventually(Object(&clientService)).Should(SatisfyAll( HaveField("Spec.Type", Equal(corev1.ServiceTypeLoadBalancer)), HaveField("Spec.LoadBalancerClass", Equal(ptr.To("someClass"))), @@ -196,9 +192,8 @@ var _ = Describe("CreateOrUpdateService handlers", func() { }) It("should fail on creating the client service with invalid owner reference", func(ctx SpecContext) { - emptyScheme := runtime.NewScheme() - Expect(CreateOrUpdateHeadlessService(ctx, &etcdcluster, k8sClient, emptyScheme)).NotTo(Succeed()) - Expect(CreateOrUpdateClientService(ctx, &etcdcluster, k8sClient, emptyScheme)).NotTo(Succeed()) + Expect(CreateOrUpdateHeadlessService(ctx, &etcdcluster, clientWithEmptyScheme)).NotTo(Succeed()) + Expect(CreateOrUpdateClientService(ctx, &etcdcluster, clientWithEmptyScheme)).NotTo(Succeed()) }) }) }) diff --git a/site/content/en/docs/v0.2/getting-started/_index.md b/site/content/en/docs/v0.2/getting-started/_index.md index fc7f19e4..5a80aa07 100644 --- a/site/content/en/docs/v0.2/getting-started/_index.md +++ b/site/content/en/docs/v0.2/getting-started/_index.md @@ -14,7 +14,7 @@ Pre-requisites: 1. Install etcd-operator: ```bash - kubectl apply -f https://github.com/aenix-io/etcd-operator/releases/download/latest/etcd-operator.yaml + kubectl apply -f https://github.com/aenix-io/etcd-operator/releases/latest/download/etcd-operator.yaml ``` 2. Check the operator is running: ```bash diff --git a/site/package-lock.json b/site/package-lock.json index 62bd5c22..65c991bd 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "autoprefixer": "^10.4.14", "cross-env": "^7.0.3", - "hugo-extended": "0.125.2", + "hugo-extended": "0.125.7", "postcss-cli": "^11.0.0" } }, @@ -1150,9 +1150,9 @@ } }, "node_modules/hugo-extended": { - "version": "0.125.2", - "resolved": "https://registry.npmjs.org/hugo-extended/-/hugo-extended-0.125.2.tgz", - "integrity": "sha512-2QSCMSRRsAKdKPGqrfNBdnxW55kttstjF/Qk7NPOAqZltklcyWBH+mnQt7EJfRfixPRCO5K6EikTwuXDh8y+pg==", + "version": "0.125.7", + "resolved": "https://registry.npmjs.org/hugo-extended/-/hugo-extended-0.125.7.tgz", + "integrity": "sha512-zK4rsDWDJ5RDm+lfD3v4ypREIufOvSQKn/waB5PKTaAP9Ky5olei/M9uPLvWZ8h1OkiQ4Gg/+6QXJjndNCPxrQ==", "dev": true, "hasInstallScript": true, "dependencies": { diff --git a/site/package.json b/site/package.json index d09b7e78..aca1a9d2 100644 --- a/site/package.json +++ b/site/package.json @@ -36,7 +36,7 @@ "devDependencies": { "autoprefixer": "^10.4.14", "cross-env": "^7.0.3", - "hugo-extended": "0.125.2", + "hugo-extended": "0.125.7", "postcss-cli": "^11.0.0" } }