Skip to content

Commit

Permalink
Merge pull request #720 from Support-pl/dev
Browse files Browse the repository at this point in the history
fixed adding ssh key when creating ovh cloud instance
  • Loading branch information
639852 authored Jul 22, 2024
2 parents 763761e + c541317 commit 396db13
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/stores/cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ export const useCloudStore = defineStore('cloud', () => {

newInstance.config.auto_renew = true
newInstance.resources = { ...resources, ips_private: 0, ips_public: 1 }
newGroup.config = { ssh: newInstance.config.ssh }
delete newInstance.config.ssh
}
} else if (newGroup.type === 'keyweb') {
newInstance.config = {
Expand All @@ -120,7 +118,7 @@ export const useCloudStore = defineStore('cloud', () => {

instancesGroups = response.instancesGroups
} else {
const response = await createService(newInstance, options)
const response = await createService(newInstance)

instancesGroups = response.instancesGroups
}
Expand Down Expand Up @@ -196,7 +194,7 @@ export const useCloudStore = defineStore('cloud', () => {
return [instance, group]
}

function createService (newInstance, options) {
function createService (newInstance) {
const orderData = {
namespace: namespaceId.value,
service: {
Expand All @@ -218,16 +216,12 @@ export const useCloudStore = defineStore('cloud', () => {
}
}

if (newInstance.config.type === 'cloud') {
orderData.service.instancesGroups[0].config = { ssh: options.config.ssh }
}

return createInstance(
'create', orderData, namespaceId.value, null, deployMessage
)
}

function updateService (newGroup, newInstance, options) {
function updateService (newGroup, newInstance) {
const orderData = Object.assign({}, service.value)
let group = orderData.instancesGroups.find(
(el) => el.sp === provider.value.uuid
Expand All @@ -237,9 +231,6 @@ export const useCloudStore = defineStore('cloud', () => {
orderData.instancesGroups.push(newGroup)
group = orderData.instancesGroups.at(-1)
}
if (newInstance.config.type === 'cloud') {
group.config = { ssh: options.config.ssh }
}
group.instances.push(newInstance)

const res = group.instances.reduce((prev, curr) => ({
Expand Down

0 comments on commit 396db13

Please sign in to comment.