Skip to content

Commit f477114

Browse files
author
Daman Arora
committed
Refactor S3 provider handling and add zone ID to parameters in zone launch
1 parent 6becb33 commit f477114

3 files changed

Lines changed: 8 additions & 14 deletions

File tree

ui/src/views/infra/AddSecondaryStorage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export default {
347347
data.url = url
348348
}
349349
data.provider = provider
350-
if (values.zone && !['Swift', 'S3'].includes(provider)) {
350+
if (values.zone && !['Swift'].includes(provider)) {
351351
data.zoneid = values.zone
352352
}
353353

ui/src/views/infra/zone/ZoneWizardAddResources.vue

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,19 +1094,12 @@ export default {
10941094
})
10951095
},
10961096
fetchProvider () {
1097-
const storageProviders = []
1098-
api('listImageStores', { provider: 'S3' }).then(json => {
1099-
const s3stores = json.listimagestoresresponse.imagestore
1100-
if (s3stores != null && s3stores.length > 0) {
1101-
storageProviders.push({ id: 'S3', description: 'S3' })
1102-
} else {
1103-
storageProviders.push({ id: 'NFS', description: 'NFS' })
1104-
storageProviders.push({ id: 'SMB', description: 'SMB/CIFS' })
1105-
storageProviders.push({ id: 'S3', description: 'S3' })
1106-
storageProviders.push({ id: 'Swift', description: 'Swift' })
1107-
}
1108-
this.storageProviders = storageProviders
1109-
})
1097+
this.storageProviders = [
1098+
{ id: 'NFS', description: 'NFS' },
1099+
{ id: 'SMB', description: 'SMB/CIFS' },
1100+
{ id: 'S3', description: 'S3' },
1101+
{ id: 'Swift', description: 'Swift' }
1102+
]
11101103
},
11111104
fetchPrimaryStorageProvider () {
11121105
this.primaryStorageProviders = []

ui/src/views/infra/zone/ZoneWizardLaunchZone.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,7 @@ export default {
15961596
params['details[2].value'] = this.prefillContent.secondaryStorageSMBDomain
15971597
} else if (this.prefillContent.secondaryStorageProvider === 'S3') {
15981598
params.provider = this.prefillContent.secondaryStorageProvider
1599+
params.zoneid = this.stepData.zoneReturned.id
15991600
params['details[0].key'] = 'accesskey'
16001601
params['details[0].value'] = this.prefillContent.secondaryStorageAccessKey
16011602
params['details[1].key'] = 'secretkey'

0 commit comments

Comments
 (0)