Skip to content

Commit

Permalink
ui/volume: rephrase the volume status from Available to Ready
Browse files Browse the repository at this point in the history
The volume status available is confusing. For example, when the PV is bound, we displayed Available

Refs: #2245
  • Loading branch information
ChengYanJin committed Feb 20, 2020
1 parent 8ba6b40 commit 8f428ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions ui/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const STATUS_FAILED = 'Failed';
export const STATUS_AVAILABLE = 'Available';
export const STATUS_RELEASED = 'Released';
export const STATUS_UNKNOWN = 'Unknown';
export const STATUS_READY = 'Ready';

export const SPARSE_LOOP_DEVICE = 'sparseLoopDevice';
export const RAW_BLOCK_DEVICE = 'rawBlockDevice';
4 changes: 2 additions & 2 deletions ui/src/containers/NodeVolumes.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import {
STATUS_TERMINATING,
STATUS_PENDING,
STATUS_FAILED,
STATUS_AVAILABLE,
STATUS_BOUND,
STATUS_READY,
} from '../constants';

const VolumeTable = styled.div`
Expand Down Expand Up @@ -172,7 +172,7 @@ const NodeVolumes = props => {
hintMessage = intl.messages.volume_status_unknown_hint;
break;
case STATUS_FAILED:
case STATUS_AVAILABLE:
case STATUS_READY:
const persistentVolume = persistentVolumes.find(
pv => pv?.metadata?.name === rowData.name,
);
Expand Down
5 changes: 3 additions & 2 deletions ui/src/services/NodeVolumesUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
STATUS_AVAILABLE,
STATUS_BOUND,
STATUS_RELEASED,
STATUS_READY,
} from '../constants';

export const isVolumeDeletable = (rowData, persistentVolumes) => {
Expand All @@ -18,7 +19,7 @@ export const isVolumeDeletable = (rowData, persistentVolumes) => {
case STATUS_TERMINATING:
return false;
case STATUS_FAILED:
case STATUS_AVAILABLE:
case STATUS_READY:
if (persistentVolumes?.length === 0) {
return true;
} else {
Expand Down Expand Up @@ -80,7 +81,7 @@ export const computeVolumeGlobalStatus = (name, status) => {

switch(condStatus) {
case 'True':
return STATUS_AVAILABLE;
return STATUS_READY;
case 'False':
return STATUS_FAILED;
case 'Unknown':
Expand Down

0 comments on commit 8f428ff

Please sign in to comment.