Skip to content

Commit

Permalink
use golinstor caching implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Wanzenböck <[email protected]>
  • Loading branch information
WanzenBug committed Apr 29, 2024
1 parent 4b0e5f5 commit 71d265c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 64 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.0
toolchain go1.22.2

require (
github.com/LINBIT/golinstor v0.51.0
github.com/LINBIT/golinstor v0.52.0
github.com/container-storage-interface/spec v1.9.0
github.com/piraeusdatastore/linstor-csi v1.5.0
github.com/spf13/cobra v1.8.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/LINBIT/golinstor v0.51.0 h1:XvfcQN3jg7b/s79wrpTe/jzfFDGSNZy2pjGG8SDtFRM=
github.com/LINBIT/golinstor v0.51.0/go.mod h1:MCkHNdHxoGw4mnt8DGsSqWNF5ZGhYFy6Lr4tQLyVBs0=
github.com/LINBIT/golinstor v0.52.0 h1:b+l26DJvLxGIYuvopLFJUoE7aywa6oCmCeL3jav3kKM=
github.com/LINBIT/golinstor v0.52.0/go.mod h1:D811Eyjhoy6t1Tl36HTW4by0s6O5g0cVgV/t58oN+0g=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

linstor "github.com/LINBIT/golinstor"
clientcache "github.com/LINBIT/golinstor/cache"
"github.com/LINBIT/golinstor/client"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/piraeusdatastore/linstor-csi/pkg/driver"
Expand All @@ -30,7 +31,6 @@ import (
"k8s.io/client-go/tools/leaderelection"
"k8s.io/klog/v2"

"github.com/piraeusdatastore/linstor-affinity-controller/pkg/util"
"github.com/piraeusdatastore/linstor-affinity-controller/pkg/version"
)

Expand Down Expand Up @@ -62,12 +62,12 @@ func NewReconciler(cfg *Config) (*AffinityReconciler, error) {
lclient, err := hlclient.NewHighLevelClient(
client.Log(KLogV(3)),
client.UserAgent("linstor-affinity-controller/"+version.Version),
clientcache.WithCaches(&clientcache.NodeCache{Timeout: cfg.Timeout}),
)
if err != nil {
return nil, fmt.Errorf("failed to initialize linstor client: %w", err)
}

lclient.Resources = util.NewResourceCache(lclient.Resources, cfg.Timeout)
lclient.PropertyNamespace = cfg.PropertyNamespace

kclient, err := kubernetes.NewForConfig(cfg.RestCfg)
Expand Down
59 changes: 0 additions & 59 deletions pkg/util/linstorresourcecache.go

This file was deleted.

0 comments on commit 71d265c

Please sign in to comment.