Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rock-ons] Share mapping is ignored if the same share is chosen #2064

Closed
FroggyFlox opened this issue Aug 21, 2019 · 3 comments · Fixed by #2481
Closed

[Rock-ons] Share mapping is ignored if the same share is chosen #2064

FroggyFlox opened this issue Aug 21, 2019 · 3 comments · Fixed by #2481
Assignees

Comments

@FroggyFlox
Copy link
Member

At rock-on install wizard, if the same share is selected for two or more volumes, only the first one is saved and sent to the rock-on API for the rock-on install.

Illustration

For instance, if the share emby-conf is selected for both volume mappings of the Emby server rock-on (see Picture 1 below), only the mapping for Media Storage is saved (see Picture 2 below).

Picture 1
image

Picture 2
image

Consequence

Although docker still runs the container, Rockstor detects the install as failed, but no error is thrown to the user.

Cause

I suspect this is simply due to the fact that the share:volume mapping is stored as a dict, with the share as key. As keys must be unique, the each new mapping value overwrites the previous one. The related code is:

var share_map = {};
var volumes = this.volumes.filter(function(volume) {
share_map[this.$('#' + volume.id).val()] = volume.get('dest_dir');
return volume;
}, this);

Resolution options

Although it may be recommended to choose a dedicated share for each mapping, this is not explicitly mentioned during the install wizard, but we may choose to enforce the choice of different shares for each volume mapping. This could be done with any combination of:

  1. use form validation to check for duplicate share selected
  2. remove the share from the list of possible choices if selected in another drop-down select field.

Some users may still prefer to use the same share for multiple mappings, however, so we might rewrite how this form information is parsed. This would require a substantial rewrite of both the front- and back-end of things, however.

@FroggyFlox FroggyFlox self-assigned this Jan 19, 2023
@FroggyFlox
Copy link
Member Author

I'm currently working on this.
I personally favor option 1 above:

use form validation to check for duplicate share selected

Indeed, although it would seem elegant to simply remove the share from the list of selectable shares, it actually seems detrimental:

  • the user may wonder why the share they're looking for is not displayed
  • if the user actually wants to select share B for volume B while it was erroneously selected for volume A, they would need to first select another share for volume A first before being able to select share B for volume B

I think a good form validation letting the user know that the current form is invalid because one share was selected multiple would be clearer and more intuitive to the user.

@phillxnet , as always, let me know if I'm missing a glaring problem with that. 😃

FroggyFlox added a commit to FroggyFlox/rockstor-core that referenced this issue Jan 19, 2023
Selecting the same share to be bound to multiple volumes of the
same container is not yet supported by Rockstor. Add a new
validation rule isDuplicate to detect such instances of a share
being selected as the option for more than one volume and return
a specific error message accordingly.
@FroggyFlox
Copy link
Member Author

Following ba87d74, we now have validation for shares selected multiple times, in addition to the currently existing "Required" rule.

The examples below are using the ecoDMS 18.09 Rock-On to illustrate various validations outputs; it has 4 volumes defined. Note that all validations occur upon clicking the "Next" button.

  • 4 empty
    image

  • 1 share used 3 times + 1 empty
    image

  • 1 share used 3 times + 0 empty
    image

  • 2 shares used 2 times each
    image

  • 1 share used 2 times + 0 empty
    image

  • 0 duplicates, 0 empty: clicking "Next" goes to the Ports selection step.

@phillxnet phillxnet added this to the First Stable Poetry build milestone Jan 20, 2023
FroggyFlox added a commit to FroggyFlox/rockstor-core that referenced this issue Jan 20, 2023
Selecting the same share to be bound to multiple volumes of the
same container is not yet supported by Rockstor. Add a new
validation rule isDuplicate to detect such instances of a share
being selected as the option for more than one volume and return
a specific error message accordingly.
FroggyFlox added a commit to FroggyFlox/rockstor-core that referenced this issue Jan 20, 2023
Selecting the same share to be bound to multiple volumes of the
same container is not yet supported by Rockstor. Add a new
validation rule isDuplicate to detect such instances of a share
being selected as the option for more than one volume and return
a specific error message accordingly.
phillxnet added a commit that referenced this issue Jan 25, 2023
…_shares_selection

Add form validation for share selected multiple times #2064
@phillxnet
Copy link
Member

Closing as:
Fixed by #2481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants