Skip to content

Commit

Permalink
feat(provider/cf): option to define timeouts for service creation/des…
Browse files Browse the repository at this point in the history
…troy
  • Loading branch information
Jammy Louie authored and jkschneider committed Dec 1, 2018
1 parent caee35d commit 5165973
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { HelpContentsRegistry } from '@spinnaker/core';

const helpContents: { [key: string]: string } = {
'cf.service.deploy.timeout':
'(Optional) <b>Override Deploy Timeout</b> is the maximum amount of time allowed for service deployment before Spinnaker reports a timeout error (default: 450 seconds). If a timeout error is reported by Spinnaker, the request may still be processed and a service may still be created.',
'cf.service.destroy.timeout':
'(Optional) <b>Override Destroy Timeout</b> is the maximum amount of time allowed for service destruction before Spinnaker reports a timeout error (default: 450 seconds). If a timeout error is reported by Spinnaker, the request may still be processed and the service may be deleted.',
'cf.serverGroup.stack':
'(Optional) <b>Stack</b> is one of the core naming components of a cluster, used to create vertical stacks of dependent services for integration testing.',
'cf.serverGroup.detail':
'(Optional) <b>Detail</b> is a string of free-form alphanumeric characters and hyphens to describe any other variables.',
'cf.serverGroup.startApplication':
'<b>Start on creation</b> is a boolean value that determines if the server group is started upon creation. Default value is <code>true</code>',
'<b>Start on creation</b> is a boolean value that determines if the server group is started upon creation. Default value is <code>true</code>.',
'cf.serverGroup.routes':
'(Optional) <b>Route</b> is a URI in the form of <code>some.host.some.domain[:9999][/some/path]</code> (port and path are optional). The domain has to be a valid domain in the CloudFoundry Org (Region) that this server group runs in.',
'cf.artifact.package': `<p>This option allows you to create a new server group from an existing Droplet. You can use this to relocate an existing Cloud Foundry application from one space to another or to launch a clone of an application with different root filesystem or resource settings.</p>`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';

import {
AccountSelectField,
AccountService,
Expand Down Expand Up @@ -185,9 +186,14 @@ export class CloudfoundryDeployServiceStageConfig extends React.Component<
this.props.stageFieldUpdated();
};

private timeoutUpdated = (event: React.ChangeEvent<HTMLInputElement>): void => {
this.props.stage.timeout = event.target.value;
this.props.stageFieldUpdated();
};

public render() {
const { stage } = this.props;
const { credentials, parameters, service, serviceName, servicePlan, tags } = stage;
const { credentials, parameters, service, serviceName, servicePlan, tags, timeout } = stage;
const { accounts, newTag, regions, servicePlans, services } = this.state;
return (
<div className="form-horizontal cloudfoundry-deploy-service-stage">
Expand Down Expand Up @@ -288,6 +294,9 @@ export class CloudfoundryDeployServiceStageConfig extends React.Component<
<StageConfigField label="Parameters">
<textarea className="form-control" onChange={this.parametersUpdated} value={parameters} />
</StageConfigField>
<StageConfigField label="Override Deploy Timeout (Seconds)" helpKey="cf.service.deploy.timeout">
<input type="number" className="form-control" onChange={this.timeoutUpdated} value={timeout} />
</StageConfigField>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,14 @@ export class CloudfoundryDestroyServiceStageConfig extends React.Component<
this.props.stageFieldUpdated();
};

private timeoutUpdated = (event: React.ChangeEvent<HTMLInputElement>): void => {
this.props.stage.timeout = event.target.value;
this.props.stageFieldUpdated();
};

public render() {
const { stage } = this.props;
const { credentials, serviceName } = stage;
const { credentials, serviceName, timeout } = stage;
const { accounts, regions } = this.state;
return (
<div className="form-horizontal">
Expand Down Expand Up @@ -108,6 +113,9 @@ export class CloudfoundryDestroyServiceStageConfig extends React.Component<
value={serviceName}
/>
</StageConfigField>
<StageConfigField label="Override Destroy Timeout (Seconds)" helpKey="cf.service.destroy.timeout">
<input type="number" className="form-control" onChange={this.timeoutUpdated} value={timeout} />
</StageConfigField>
</div>
);
}
Expand Down

0 comments on commit 5165973

Please sign in to comment.