Skip to content

Commit

Permalink
[cherry-pick] fix(blockdeviceclaims): fix openebs version type in blo…
Browse files Browse the repository at this point in the history
…ckdeviceclaim (#1270)

* refact(cstor-pool,sparse): Update SPC type to blockdevice (#1264)

With latest changes, to create StoragePoolClaim we have to
use spc type blockdevice as common type instead of sparse/disk
for creating sparse or disk based cstor pools

```
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
  name: sparse-claim-auto
spec:
  name: sparse-claim-auto
  type: blockdevice
  maxPools: 1
  minPools: 1
  poolSpec:
    poolType: striped
    cacheFile: /var/openebs/sparse/sparse-claim-auto.cache
    overProvisioning: false
```

Signed-off-by: prateekpandey14 <[email protected]>

* feat(cstor-operator): add a support to create pools on unclaimed BD in manual mode (#1255)

Signed-off-by: mittachaitu <[email protected]>

* fix(blockdeviceclaims): fix openebs version type in blockdeviceclaim (#1269)

Signed-off-by: mittachaitu <[email protected]>
  • Loading branch information
sai chaithanya authored and Amit Kumar Das committed Jun 8, 2019
1 parent f8cf647 commit 15bb30a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/algorithm/nodeselect/v1alpha1/select_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (ac *Config) ClaimBlockDevice(nodeBDs *nodeBlockDevice, spc *apis.StoragePo

bdcObjList, err := bdcKubeclient.List(metav1.ListOptions{LabelSelector: lselector})
if err != nil {
return nil, errors.Wrapf(err, "failed to list block device claim for {%s}", spc.Name)
return nil, errors.Wrapf(err, "failed to list block device claims for {%s}", spc.Name)
}
customBDCObjList := bdc.ListBuilderFromAPIList(bdcObjList)

Expand Down Expand Up @@ -272,7 +272,7 @@ func (ac *Config) ClaimBlockDevice(nodeBDs *nodeBlockDevice, spc *apis.StoragePo
WithOwnerReference(spc).
Build()
if err != nil {
return nil, errors.Wrapf(err, "failed to build blockd device claim for bd {%s}", bdName)
return nil, errors.Wrapf(err, "failed to build block device claim for bd {%s}", bdName)
}

_, err = bdcKubeclient.Create(newBDCObj.Object)
Expand All @@ -289,7 +289,7 @@ func (ac *Config) ClaimBlockDevice(nodeBDs *nodeBlockDevice, spc *apis.StoragePo
nodeClaimedBDs.BlockDeviceList = append(nodeClaimedBDs.BlockDeviceList, claimedBD)
}
if pendingBDCCount != 0 {
return nil, errors.Errorf("failed to claim block devcies on node: {%s}", nodeClaimedBDs.NodeName)
return nil, errors.Errorf("failed to claim block devices on node {%s}", nodeClaimedBDs.NodeName)
}
return nodeClaimedBDs, nil
}
4 changes: 3 additions & 1 deletion pkg/blockdeviceclaim/v1alpha1/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (
const (
// StoragePoolKind holds the value of StoragePoolClaim
StoragePoolKind = "StoragePoolClaim"
// APIVersion holds the value of OpenEBS version
APIVersion = "openebs.io/v1alpha1"
)

// Builder is the builder object for BlockDeviceClaim
Expand Down Expand Up @@ -237,7 +239,7 @@ func (b *Builder) WithOwnerReference(spc *apis.StoragePoolClaim) *Builder {
}
trueVal := true
reference := metav1.OwnerReference{
APIVersion: string(apis.OpenEBSVersionKey),
APIVersion: APIVersion,
Kind: StoragePoolKind,
UID: spc.ObjectMeta.UID,
Name: spc.ObjectMeta.Name,
Expand Down

0 comments on commit 15bb30a

Please sign in to comment.