Skip to content

Commit

Permalink
fix(provider/cf): Clone model so Orca monitors the correct foundation…
Browse files Browse the repository at this point in the history
… for up instances (#6817)
  • Loading branch information
jkschneider committed Apr 5, 2019
1 parent 33ad914 commit aad46c2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -99,7 +100,7 @@ export class CloudfoundryCloneServerGroupStageConfig extends React.Component<
</thead>
<tbody>
<tr>
<td>{stage.destination ? stage.destination.account : ''}</td>
<td>{stage.account || ''}</td>
<td>{stage.destination ? stage.destination.region : ''}</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -38,7 +39,6 @@ export interface ICloudFoundrySource {

export interface ICloudFoundryDestination {
region: string;
account: string;
}

export interface ICloudFoundryManifestDirectSource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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 (
<div className="form-group">
Expand Down

0 comments on commit aad46c2

Please sign in to comment.