Skip to content

Commit

Permalink
fix lint-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
j-griffith committed Mar 1, 2019
1 parent 36939a2 commit 69d19cd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
3 changes: 3 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ parameters:
multiNodeWritable: "enabled"
reclaimPolicy: Delete
```

Now, you can request Claims from the configured storage class that include the `ReadWriteMany` access mode:

```
Expand Down Expand Up @@ -187,6 +188,7 @@ spec:
claimName: pvc-1
readOnly: false
```

Wait for the POD to enter Running state, write some data to `/var/lib/www/html`

Now, we can create a second POD (ensure the POD is scheduled on a different node; multiwriter single node works without this feature) that also uses this PVC at the same time
Expand All @@ -209,4 +211,5 @@ spec:
claimName: pvc-1
readOnly: false
```

If you access the pod you can check that your data is avaialable at `/var/lib/www/html`
7 changes: 2 additions & 5 deletions pkg/cephfs/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,8 @@ func execCommand(program string, args ...string) (stdout, stderr []byte, err err
}

func execCommandErr(program string, args ...string) error {
if _, _, err := execCommand(program, args...); err != nil {
return err
}

return nil
_, _, err := execCommand(program, args...)
return err
}

func execCommandJSON(v interface{}, program string, args ...string) error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/rbd/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func parseVolCreateRequest(req *csi.CreateVolumeRequest) (*rbdVolume, error) {
// TODO (sbezverk) Last check for not exceeding total storage capacity

// MultiNodeWriters are accepted but they're only for special cases, and we skip the watcher checks for them which isn't the greatest
// let's make sure we ONLY skip that if the user is requesting a MULTI Node accessbile mode
// let's make sure we ONLY skip that if the user is requesting a MULTI Node accessible mode
disableMultiWriter := true
for _, am := range req.VolumeCapabilities {
if am.GetAccessMode().GetMode() != csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER {
Expand Down Expand Up @@ -292,7 +292,7 @@ func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol
// are supported.
func (cs *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error) {
params := req.GetParameters()
multiWriter, _ := params["multiNodeWritable"]
multiWriter := params["multiNodeWritable"]
if strings.ToLower(multiWriter) == "enabled" {
klog.V(3).Info("detected multiNodeWritable parameter in Storage Class, allowing multi-node access modes")

Expand Down
2 changes: 1 addition & 1 deletion pkg/rbd/rbd_attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func attachRBDImage(volOptions *rbdVolume, userID string, credentials map[string
Factor: rbdImageWatcherFactor,
Steps: rbdImageWatcherSteps,
}
err := waitForrbdImage(backoff, volOptions, userID, credentials)
err = waitForrbdImage(backoff, volOptions, userID, credentials)

if err != nil {
return "", err
Expand Down
2 changes: 1 addition & 1 deletion pkg/rbd/rbd_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func getRBDVolumeOptions(volOptions map[string]string, ignoreMultiNodeWritable b
klog.V(3).Infof("ignoreMultiNodeWritable flag in parse getRBDVolumeOptions is: %v", ignoreMultiNodeWritable)
// If the volume we're working with is NOT requesting multi-node attach then don't treat it special, ignore the setting in the SC and just keep our watcher checks
if !ignoreMultiNodeWritable {
rbdVol.MultiNodeWritable, ok = volOptions["multiNodeWritable"]
rbdVol.MultiNodeWritable = volOptions["multiNodeWritable"]
}
return rbdVol, nil
}
Expand Down

0 comments on commit 69d19cd

Please sign in to comment.