Skip to content

Commit

Permalink
[controller] Add parallel reconciliation to lvm_logical_volume_watche…
Browse files Browse the repository at this point in the history
…r. Add VG size validation to lvm_volume_group_watcher (#40)

Signed-off-by: Aleksandr Zimin <[email protected]>
Signed-off-by: Viktor Kramarenko <[email protected]>
Co-authored-by: Viktor Kramarenko <[email protected]>
  • Loading branch information
AleksZimin and ViktorKram authored Apr 25, 2024
1 parent db46212 commit 5e3944c
Show file tree
Hide file tree
Showing 11 changed files with 291 additions and 205 deletions.
2 changes: 2 additions & 0 deletions crds/lvmlogicalvolume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ spec:
x-kubernetes-validations:
- rule: self == oldSelf
message: Value is immutable.
minLength: 1
pattern: '^[a-z0-9]([a-z0-9-.]{0,251}[a-z0-9])?$'
type:
type: string
x-kubernetes-validations:
Expand Down
4 changes: 2 additions & 2 deletions images/agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_20_ALPINE_BUILDER=registry.deckhouse.io/base_images/golang:1.20.5-alpine3.18@sha256:51a47fb0851397db2f506c15c426735bc23de31177cbdd962880c0879d1906a4
ARG GOLANG_ALPINE_BUILDER=registry.deckhouse.io/base_images/golang:1.22.1-alpine@sha256:0de6cf7cceab6ecbf0718bdfb675b08b78113c3709c5e4b99456cdb2ae8c2495
ARG UBUNTU_UTILS_BUILDER=registry.deckhouse.io/base_images/ubuntu:jammy-20221130@sha256:c14c3b1242536729ce5227ff833144977b4e378723858fb73a4cf40ea6daaf6a
ARG BASE_IMAGE=registry.deckhouse.io/base_images/scratch@sha256:b054705fcc9f2205777d80a558d920c0b4209efdc3163c22b5bfcb5dda1db5fc

Expand Down Expand Up @@ -38,7 +38,7 @@ RUN ./configure --prefix /opt/deckhouse/sds --with-udev && \


#################################
FROM $GOLANG_20_ALPINE_BUILDER as agent-builder
FROM $GOLANG_ALPINE_BUILDER as agent-builder
WORKDIR /go/src

ADD go.mod .
Expand Down
3 changes: 1 addition & 2 deletions images/agent/api/v1alpha1/block_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1alpha1

import (
"k8s.io/api/policy/v1beta1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand All @@ -39,7 +38,7 @@ type BlockDeviceList struct {

type BlockDeviceStatus struct {
Type string `json:"type"`
FsType v1beta1.FSType `json:"fsType"`
FsType string `json:"fsType"`
NodeName string `json:"nodeName"`
Consumable bool `json:"consumable"`
PVUuid string `json:"pvUUID"`
Expand Down
2 changes: 2 additions & 0 deletions images/agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type Options struct {
MetricsPort string
BlockDeviceScanInterval time.Duration
VolumeGroupScanInterval time.Duration
LLVRequeInterval time.Duration
}

func NewConfig() (*Options, error) {
Expand Down Expand Up @@ -71,6 +72,7 @@ func NewConfig() (*Options, error) {

opts.BlockDeviceScanInterval = 5
opts.VolumeGroupScanInterval = 5
opts.LLVRequeInterval = 5

return &opts, nil
}
Expand Down
36 changes: 18 additions & 18 deletions images/agent/go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
module sds-node-configurator

go 1.20
go 1.22.1

require (
github.com/go-logr/logr v1.3.0
github.com/go-logr/logr v1.4.1
github.com/google/go-cmp v0.6.0
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
github.com/prometheus/client_golang v1.17.0
github.com/onsi/ginkgo/v2 v2.14.0
github.com/onsi/gomega v1.30.0
github.com/prometheus/client_golang v1.18.0
github.com/stretchr/testify v1.8.4
k8s.io/api v0.28.4
k8s.io/apiextensions-apiserver v0.28.4
k8s.io/apimachinery v0.28.4
k8s.io/client-go v0.28.4
k8s.io/api v0.29.4
k8s.io/apiextensions-apiserver v0.29.4
k8s.io/apimachinery v0.29.4
k8s.io/client-go v0.29.4
k8s.io/klog/v2 v2.110.1
k8s.io/utils v0.0.0-20231127182322-b307cd553661
sigs.k8s.io/controller-runtime v0.16.3
sigs.k8s.io/controller-runtime v0.17.3
)

require (
Expand All @@ -24,15 +24,15 @@ require (
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.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.7.0 // indirect
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // 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.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
Expand All @@ -52,20 +52,20 @@ require (
github.com/prometheus/procfs v0.12.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/exp v0.0.0-20231127185646-65229373498e // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.16.0 // indirect
golang.org/x/tools v0.16.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
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/component-base v0.28.4 // indirect
k8s.io/component-base v0.29.4 // indirect
k8s.io/kube-openapi v0.0.0-20231129212854-f0671cc7e66a // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
Loading

0 comments on commit 5e3944c

Please sign in to comment.