Skip to content

Commit

Permalink
refact(cvc): update provision capacity field at provisioning (#80)
Browse files Browse the repository at this point in the history
- update cvc.Spec.Provision.capacity while buiding, as
  a readonly property requires in case of volume related
  day2 operations
- Bump version to 1.10.0
- sync with latest openebs/api

Signed-off-by: prateekpandey14 <[email protected]>
  • Loading branch information
prateekpandey14 authored May 5, 2020
1 parent dceb0a6 commit f9560e5
Show file tree
Hide file tree
Showing 21 changed files with 297 additions and 417 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.0
1.10.0
4 changes: 2 additions & 2 deletions deploy/csi-operator-ubuntu-18.04.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: cstor-csi-driver
- name: cstor-csi-plugin
image: quay.io/openebs/cstor-csi-driver:ci
imagePullPolicy: IfNotPresent
env:
Expand Down Expand Up @@ -899,7 +899,7 @@ spec:
mountPath: /plugin
- name: registration-dir
mountPath: /registration
- name: cstor-csi-driver
- name: cstor-csi-plugin
securityContext:
privileged: true
capabilities:
Expand Down
4 changes: 2 additions & 2 deletions deploy/csi-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: cstor-csi-driver
- name: cstor-csi-plugin
image: quay.io/openebs/cstor-csi-driver:ci
imagePullPolicy: IfNotPresent
env:
Expand Down Expand Up @@ -897,7 +897,7 @@ spec:
mountPath: /plugin
- name: registration-dir
mountPath: /registration
- name: cstor-csi-driver
- name: cstor-csi-plugin
securityContext:
privileged: true
capabilities:
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ require (
github.com/imdario/mergo v0.3.8 // indirect
github.com/kubernetes-csi/csi-lib-iscsi v0.0.0-20200118015005-959f12c91ca8
github.com/kubernetes-csi/csi-lib-utils v0.7.0
github.com/openebs/api v0.0.0-20200331103231-b4be54796806
github.com/openebs/api v0.0.0-20200429072019-650209fba28b
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.4.1 // indirect
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.5
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,8 @@ github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zM
github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runtime-spec v1.0.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v1.3.1-0.20190929122143-5215b1806f52/go.mod h1:+BLncwf63G4dgOzykXAxcmnFlUaOlkDdmw/CqsW6pjs=
github.com/openebs/api v0.0.0-20200331103231-b4be54796806 h1:vfpQYikhVkFMUocB6wmut42EC4/ecLHJCNfj/6bgMPw=
github.com/openebs/api v0.0.0-20200331103231-b4be54796806/go.mod h1:Mj6izkLZT0jNKLs9u1CnbgNoP9BEgY/mgVI7Mc3/Hwc=
github.com/openebs/maya v0.0.0-20200226142318-6daf5f0486e8 h1:ud86nr1TRU9fB3IeBzymBqYjaha/GjgjHCTeFTKeT8A=
github.com/openebs/maya v0.0.0-20200226142318-6daf5f0486e8/go.mod h1:QQY9cOHKQwZ73qbv6O//UYUBLNV2S0MRDIfG7t5KOCk=
github.com/openebs/api v0.0.0-20200429072019-650209fba28b h1:XC6wCUascCjnEEstKkSFuEZB2YjTtm10Mx7SoRSHfhk=
github.com/openebs/api v0.0.0-20200429072019-650209fba28b/go.mod h1:TASujm6H1LGdx43MN7Dab1xdAqR7MVU8bsS74Ywop5w=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
Expand Down
10 changes: 10 additions & 0 deletions pkg/cstor/volumeconfig/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,16 @@ func (b *Builder) WithCapacityQty(resCapacity resource.Quantity) *Builder {
return b
}

// WithProvisionCapacityQty sets initial provided Capacity of CStorVOlumeClaim
// as a readonly capacity requires in case of volume day2 operations
func (b *Builder) WithProvisionCapacityQty(resCapacity resource.Quantity) *Builder {
resourceList := metav1.ResourceList{
metav1.ResourceName(metav1.ResourceStorage): resCapacity,
}
b.cvc.object.Spec.Provision.Capacity = resourceList
return b
}

// WithReplicaCount sets replica count of CStorVolumeConfig
func (b *Builder) WithReplicaCount(count string) *Builder {

Expand Down
1 change: 1 addition & 0 deletions pkg/utils/maya.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func ProvisionVolume(
WithSource(snapshotID).
WithNodeID(nodeID).
WithReplicaCount(replicaCount).
WithProvisionCapacityQty(sSize).
WithNewVersion(version.Current()).
WithDependentsUpgraded().
WithStatusPhase(apisv1.CStorVolumeConfigPhasePending).Build()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f9560e5

Please sign in to comment.