From aad46c27de651ae72759d22ee6b64e4dbccae7ab Mon Sep 17 00:00:00 2001 From: Jon Schneider Date: Fri, 5 Apr 2019 14:19:33 -0500 Subject: [PATCH] fix(provider/cf): Clone model so Orca monitors the correct foundation for up instances (#6817) --- .../CloudfoundryCloneServerGroupStageConfig.tsx | 3 ++- .../configure/serverGroupCommandBuilder.service.cf.ts | 1 + .../serverGroup/configure/serverGroupConfigurationModel.cf.ts | 2 +- .../wizard/sections/basicSettings/BasicSettings.cf.tsx | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/scripts/modules/cloudfoundry/src/pipeline/stages/cloneServerGroup/CloudfoundryCloneServerGroupStageConfig.tsx b/app/scripts/modules/cloudfoundry/src/pipeline/stages/cloneServerGroup/CloudfoundryCloneServerGroupStageConfig.tsx index 34a3a82ddfd..efc219e0870 100644 --- a/app/scripts/modules/cloudfoundry/src/pipeline/stages/cloneServerGroup/CloudfoundryCloneServerGroupStageConfig.tsx +++ b/app/scripts/modules/cloudfoundry/src/pipeline/stages/cloneServerGroup/CloudfoundryCloneServerGroupStageConfig.tsx @@ -29,6 +29,7 @@ export class CloudfoundryCloneServerGroupStageConfig extends React.Component< private handleResult = (command: any) => { this.props.stage.credentials = command.credentials; this.props.stage.capacity = command.capacity; + this.props.stage.account = command.account; this.props.stage.destination = command.destination; this.props.stage.delayBeforeDisableSec = command.delayBeforeDisableSec; this.props.stage.freeFormDetails = command.freeFormDetails; @@ -99,7 +100,7 @@ export class CloudfoundryCloneServerGroupStageConfig extends React.Component< - {stage.destination ? stage.destination.account : ''} + {stage.account || ''} {stage.destination ? stage.destination.region : ''} diff --git a/app/scripts/modules/cloudfoundry/src/serverGroup/configure/serverGroupCommandBuilder.service.cf.ts b/app/scripts/modules/cloudfoundry/src/serverGroup/configure/serverGroupCommandBuilder.service.cf.ts index 726000b7a56..24e5ad73b84 100644 --- a/app/scripts/modules/cloudfoundry/src/serverGroup/configure/serverGroupCommandBuilder.service.cf.ts +++ b/app/scripts/modules/cloudfoundry/src/serverGroup/configure/serverGroupCommandBuilder.service.cf.ts @@ -148,6 +148,7 @@ export class CloudFoundryServerGroupCommandBuilder { }).then(command => { command.credentials = stage.credentials; command.capacity = stage.capacity; + command.account = stage.account; command.destination = stage.destination; command.delayBeforeDisableSec = stage.delayBeforeDisableSec; command.freeFormDetails = stage.freeFormDetails || command.freeFormDetails; diff --git a/app/scripts/modules/cloudfoundry/src/serverGroup/configure/serverGroupConfigurationModel.cf.ts b/app/scripts/modules/cloudfoundry/src/serverGroup/configure/serverGroupConfigurationModel.cf.ts index bbc5ad24007..caddff4e91b 100644 --- a/app/scripts/modules/cloudfoundry/src/serverGroup/configure/serverGroupConfigurationModel.cf.ts +++ b/app/scripts/modules/cloudfoundry/src/serverGroup/configure/serverGroupConfigurationModel.cf.ts @@ -3,6 +3,7 @@ import { ICloudFoundryEnvVar } from 'cloudfoundry/domain'; export interface ICloudFoundryCreateServerGroupCommand extends IServerGroupCommand { // clone server group model + account?: string; destination?: ICloudFoundryDestination; source?: ICloudFoundrySource; rollback?: boolean; @@ -38,7 +39,6 @@ export interface ICloudFoundrySource { export interface ICloudFoundryDestination { region: string; - account: string; } export interface ICloudFoundryManifestDirectSource { diff --git a/app/scripts/modules/cloudfoundry/src/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.tsx b/app/scripts/modules/cloudfoundry/src/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.tsx index 28fcb7b10d9..b565a38a8c9 100644 --- a/app/scripts/modules/cloudfoundry/src/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.tsx +++ b/app/scripts/modules/cloudfoundry/src/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.tsx @@ -53,7 +53,7 @@ export class CloudFoundryServerGroupBasicSettings }; private updateRegionList = (): void => { - const accountField = this.props.isPipelineClone ? 'destination.account' : 'credentials'; + const accountField = this.props.isPipelineClone ? 'account' : 'credentials'; const credentials = get(this.props.formik.values, accountField, undefined); if (credentials) { AccountService.getRegionsForAccount(credentials).then(regions => { @@ -74,7 +74,7 @@ export class CloudFoundryServerGroupBasicSettings const { formik, isPipelineClone } = this.props; const { accounts, regions } = this.state; const { values } = formik; - const accountField = isPipelineClone ? 'destination.account' : 'credentials'; + const accountField = isPipelineClone ? 'account' : 'credentials'; const regionField = isPipelineClone ? 'destination.region' : 'region'; return (