Merge pull request #3367 from loganhz/gcp

Add missing gce-pd fields
This commit is contained in:
Vincent Fiduccia 2019-09-19 01:44:24 -07:00 committed by GitHub
commit ecf852e21e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 66 additions and 10 deletions

View File

@ -12,14 +12,17 @@ export default Component.extend(StorageClassProvisioner, {
layout,
volumeTypes: VOLUME_TYPES,
volumeType: null,
zones: null,
zoneAutomatic: null,
volumeType: null,
fsType: null,
replicationType: null,
zones: null,
zoneAutomatic: null,
didReceiveAttrs() {
const changes = {};
changes['volumeType'] = get(this, 'parameters.type') || 'pd-standard';
changes['fsType'] = get(this, 'parameters.fsType');
const zone = get(this, 'parameters.zone');
const zones = get(this, 'parameters.zones');
@ -35,13 +38,24 @@ export default Component.extend(StorageClassProvisioner, {
changes['zones'] = '';
}
changes['replicationType'] = get(this, 'parameters.replication-type') || 'none';
setProperties(this, changes);
},
updateParams() {
const type = get(this, 'volumeType');
const fsType = get(this, 'fsType');
const replicationType = get(this, 'replicationType');
const out = { type, };
if ( fsType ) {
out['fsType'] = fsType;
}
if ( replicationType && replicationType !== 'none') {
out['replication-type'] = replicationType;
}
const zoneAutomatic = get(this, 'zoneAutomatic');
if ( !zoneAutomatic ) {

View File

@ -1,34 +1,34 @@
<div class="row">
<div class="col span-4">
<label class="acc-label">{{t 'cruStorageClass.gce-pd.type.label'}}</label>
<label class="acc-label">{{t "cruStorageClass.gce-pd.type.label"}}</label>
{{#if editing}}
{{#each volumeTypes as |name|}}
<div class="radio">
<label>
{{radio-button selection=volumeType value=name}}
{{t (concat 'cruStorageClass.gce-pd.type.' name)}}
{{t (concat "cruStorageClass.gce-pd.type." name)}}
</label>
</div>
{{/each}}
{{else}}
<div>
{{t (concat 'cruStorageClass.gce-pd.type.' volumeType)}}
{{t (concat "cruStorageClass.gce-pd.type." volumeType)}}
</div>
{{/if}}
</div>
<div class="col span-4">
<label class="acc-label">{{t 'cruStorageClass.gce-pd.zone.label'}}</label>
<label class="acc-label">{{t "cruStorageClass.gce-pd.zone.label"}}</label>
{{#if editing}}
<div class="radio">
<label>
{{radio-button selection=zoneAutomatic value=true}}
{{t 'cruStorageClass.gce-pd.zone.automatic'}}
{{t "cruStorageClass.gce-pd.zone.automatic"}}
</label>
</div>
<div class="radio">
<label>
{{radio-button selection=zoneAutomatic value=false}}
{{t 'cruStorageClass.gce-pd.zone.manual'}}
{{t "cruStorageClass.gce-pd.zone.manual"}}
</label>
</div>
{{#unless zoneAutomatic}}
@ -37,7 +37,7 @@
{{else}}
<div>
{{#if zoneAutomatic}}
{{t 'cruStorageClass.gce-pd.zone.automatic'}}
{{t "cruStorageClass.gce-pd.zone.automatic"}}
{{else}}
{{zones}}
{{/if}}
@ -45,3 +45,38 @@
{{/if}}
</div>
</div>
<div class="row">
<div class="col span-4">
<label class="acc-label">
{{t "cruStorageClass.gce-pd.fsType.label"}}
</label>
{{#input-or-display editable=editing value=fsType}}
{{input
type="text"
value=fsType
classNames="form-control"
placeholder=(t "cruStorageClass.gce-pd.fsType.placeholder")
}}
{{/input-or-display}}
</div>
<div class="col span-4">
<label class="acc-label">
{{t "cruStorageClass.gce-pd.replicationType.label"}}
</label>
{{#input-or-display editable=editing value=replicationType}}
<div class="radio">
<label>
{{radio-button selection=replicationType value="none"}}
{{t "cruStorageClass.gce-pd.replicationType.none"}}
</label>
</div>
<div class="radio">
<label>
{{radio-button selection=replicationType value="regional-pd"}}
{{t "cruStorageClass.gce-pd.replicationType.regionalPd"}}
</label>
</div>
{{/input-or-display}}
</div>
</div>

View File

@ -4066,6 +4066,13 @@ cruStorageClass:
label: Volume Type
pd-standard: 'Standard'
pd-ssd: 'SSD'
fsType:
label: Filesystem Type
placeholder: "e.g. ext4"
replicationType:
label: Replication Type
none: Zonal
regionalPd: Regional
zone:
label: Availability Zone
automatic: "Automatic: Zones the cluster has a node in"