Skip to content

Commit

Permalink
feat(provider/cf): Allow health check config on deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
claymccoy authored and jkschneider committed Nov 23, 2018
1 parent 25a9aa8 commit fd22aa0
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export interface ICloudFoundryManifestDirectSource {
diskQuota: string;
instances: number;
buildpack: string;
healthCheckType: string;
healthCheckEndpoint: string;
routes: string[];
environment: ICloudFoundryEnvVar[];
services: string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class ConfigurationSettingsImpl extends React.Component<ICloudFoundryServerGroup
diskQuota: '1024M',
instances: 1,
buildpack: undefined,
healthCheckType: 'port',
healthCheckEndpoint: undefined,
routes: [],
environment: [],
services: [],
Expand All @@ -81,6 +83,10 @@ class ConfigurationSettingsImpl extends React.Component<ICloudFoundryServerGroup
this.props.formik.setFieldValue('capacity.desired', capacity);
};

private healthCheckTypeUpdated = (healthCheckType: string): void => {
this.props.formik.setFieldValue('manifest.healthCheckType', healthCheckType);
};

private directConfiguration = (manifest: ICloudFoundryManifestSource): JSX.Element => {
const { errors } = this.props.formik as any;
if (isManifestDirectSource(manifest)) {
Expand Down Expand Up @@ -111,6 +117,55 @@ class ConfigurationSettingsImpl extends React.Component<ICloudFoundryServerGroup
</div>
</div>

<div>
<div className="form-group row">
<label className="col-md-3 sm-label-right">Health Check Type</label>
<div className="col-md-7">
<div className="radio radio-inline">
<label>
<input
type="radio"
value="port"
checked={manifest.healthCheckType === 'port'}
onChange={() => this.healthCheckTypeUpdated('port')}
/>{' '}
port
</label>
</div>
<div className="radio radio-inline">
<label>
<input
type="radio"
value="http"
checked={manifest.healthCheckType === 'http'}
onChange={() => this.healthCheckTypeUpdated('http')}
/>{' '}
HTTP
</label>
</div>
<div className="radio radio-inline">
<label>
<input
type="radio"
value="process"
checked={manifest.healthCheckType === 'process'}
onChange={() => this.healthCheckTypeUpdated('process')}
/>{' '}
process
</label>
</div>
</div>
</div>
</div>
{manifest.healthCheckType === 'http' && (
<div className="form-group">
<div className="col-md-3 sm-label-right">Health Check Endpoint</div>
<div className="col-md-7">
<Field type="text" name="manifest.healthCheckEndpoint" />
</div>
</div>
)}

<div className="form-group">
<div className="col-md-12">
<b>Routes</b>
Expand Down

0 comments on commit fd22aa0

Please sign in to comment.