Skip to content

Commit

Permalink
update golinstor for LINSTOR 1.26.0
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Wanzenböck <[email protected]>
  • Loading branch information
WanzenBug committed Jan 31, 2024
1 parent 12dc414 commit 223628f
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Breaking

- Update golinstor to support LINSTOR 1.26.0, removing support for Openflex layers.

## [1.3.1] - 2024-01-30

### Changed
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
toolchain go1.21.5

require (
github.com/LINBIT/golinstor v0.49.0
github.com/LINBIT/golinstor v0.50.0
github.com/container-storage-interface/spec v1.9.0
github.com/haySwim/data v0.2.0
github.com/kubernetes-csi/csi-test/v5 v5.2.0
Expand All @@ -22,7 +22,7 @@ require (
k8s.io/apimachinery v0.29.1
k8s.io/client-go v0.29.1
k8s.io/mount-utils v0.29.1
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
)

require (
Expand Down Expand Up @@ -66,11 +66,11 @@ require (
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.17.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/kube-openapi v0.0.0-20240126223410-2919ad4fcfec // indirect
moul.io/http2curl/v2 v2.3.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/LINBIT/golinstor v0.49.0 h1:2Q5u0mjB+vMA8xkFfB04eT09qg1wFRxnmS1SkfK4Jr0=
github.com/LINBIT/golinstor v0.49.0/go.mod h1:wwtsHgmgK/+Kz0g3uJoEljqBEsEfmnCXvM64JcyuiwU=
github.com/LINBIT/golinstor v0.50.0 h1:WLdk+Jca/6BSOgmGaFqYrGEZlh0D7kjps4ak20Ntj80=
github.com/LINBIT/golinstor v0.50.0/go.mod h1:MCkHNdHxoGw4mnt8DGsSqWNF5ZGhYFy6Lr4tQLyVBs0=
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 Expand Up @@ -179,8 +179,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
Expand All @@ -207,12 +207,12 @@ k8s.io/client-go v0.29.1 h1:19B/+2NGEwnFLzt0uB5kNJnfTsbV8w6TgQRz9l7ti7A=
k8s.io/client-go v0.29.1/go.mod h1:TDG/psL9hdet0TI9mGyHJSgRkW3H9JZk2dNEUS7bRks=
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-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
k8s.io/kube-openapi v0.0.0-20240126223410-2919ad4fcfec h1:iGTel2aR8vCZdxJDgmbeY0zrlXy9Qcvyw4R2sB4HLrA=
k8s.io/kube-openapi v0.0.0-20240126223410-2919ad4fcfec/go.mod h1:Pa1PvrP7ACSkuX6I7KYomY6cmMA0Tx86waBhDUgoKPw=
k8s.io/mount-utils v0.29.1 h1:veXlIm52Y4tm3H0pG03cOdkw0KOJxYDa0fQqhJCoqvQ=
k8s.io/mount-utils v0.29.1/go.mod h1:9IWJTMe8tG0MYMLEp60xK9GYVeCdA3g4LowmnVi+t9Y=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
moul.io/http2curl/v2 v2.3.0 h1:9r3JfDzWPcbIklMOs2TnIFzDYvfAZvjeavG6EzP7jYs=
moul.io/http2curl/v2 v2.3.0/go.mod h1:RW4hyBjTWSYDOxapodpNEtX0g5Eb16sxklBqmd2RHcE=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/linstor.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ func (s *Linstor) Attach(ctx context.Context, volId, node string, rwxBlock bool)

// getDisklessFlag inspects a resource to determine the right diskless flag to use.
func getDisklessFlag(resource *lapi.Resource) string {
layer := &resource.LayerObject
layer := resource.LayerObject

for layer != nil {
switch layer.Type {
Expand Down Expand Up @@ -1770,7 +1770,7 @@ func NodesAndConditionFromResources(ress []lapi.Resource) ([]string, *csi.Volume
continue
}

drbd := util.GetDrbdLayer(&res.LayerObject)
drbd := util.GetDrbdLayer(res.LayerObject)
if drbd != nil && drbd.PromotionScore == 0 {
abnormalNodes = append(abnormalNodes, res.NodeName)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/linstor/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ nextCandidate:

func GetDrbdLayer(layer *lapi.ResourceLayer) *lapi.DrbdResource {
if layer.Type == devicelayerkind.Drbd {
return &layer.Drbd
return layer.Drbd
}

for i := range layer.Children {
Expand Down
3 changes: 1 addition & 2 deletions pkg/volume/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func (params *Parameters) DisklessFlag() (string, error) {
switch l {
case devicelayerkind.Drbd:
return lc.FlagDrbdDiskless, nil
case devicelayerkind.Nvme, devicelayerkind.Openflex:
case devicelayerkind.Nvme:
return lc.FlagNvmeInitiator, nil
default:
continue
Expand All @@ -382,7 +382,6 @@ func ParseLayerList(s string) ([]devicelayerkind.DeviceLayerKind, error) {
devicelayerkind.Nvme,
devicelayerkind.Cache,
devicelayerkind.Writecache,
devicelayerkind.Openflex,
devicelayerkind.Exos,
}

Expand Down
6 changes: 0 additions & 6 deletions pkg/volume/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ func TestDisklessFlag(t *testing.T) {
expected: lc.FlagNvmeInitiator,
isError: false,
},
{
name: "openflex-like-nvme",
params: volume.Parameters{LayerList: []devicelayerkind.DeviceLayerKind{devicelayerkind.Openflex, devicelayerkind.Storage}},
expected: lc.FlagNvmeInitiator,
isError: false,
},
{
name: "no-diskless-layer",
params: volume.Parameters{LayerList: []devicelayerkind.DeviceLayerKind{devicelayerkind.Cache, devicelayerkind.Storage}},
Expand Down

0 comments on commit 223628f

Please sign in to comment.