@spinnaker/cloudfoundry 0.0.0-main-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1085 -0
- package/LICENSE.txt +203 -0
- package/dist/cf.module.d.ts +24 -0
- package/dist/cf.settings.d.ts +7 -0
- package/dist/common/applicationName.validator.d.ts +1 -0
- package/dist/deploymentStrategy/CloudFoundryDeploymentStrategySelector.d.ts +21 -0
- package/dist/deploymentStrategy/strategies/redblack/redblack.strategy.d.ts +10 -0
- package/dist/deploymentStrategy/strategies/rollingredblack/AdditionalFields.d.ts +22 -0
- package/dist/domain/ICloudFoundryAccount.d.ts +7 -0
- package/dist/domain/ICloudFoundryApplication.d.ts +4 -0
- package/dist/domain/ICloudFoundryCluster.d.ts +5 -0
- package/dist/domain/ICloudFoundryDroplet.d.ts +19 -0
- package/dist/domain/ICloudFoundryInstance.d.ts +4 -0
- package/dist/domain/ICloudFoundryLoadBalancer.d.ts +25 -0
- package/dist/domain/ICloudFoundryServerGroup.d.ts +41 -0
- package/dist/domain/ICloudFoundrySpace.d.ts +9 -0
- package/dist/domain/index.d.ts +8 -0
- package/dist/help/cloudfoundry.help.d.ts +1 -0
- package/dist/image/image.reader.cf.d.ts +4 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5929 -0
- package/dist/index.js.map +1 -0
- package/dist/instance/details/CloudFoundryInstanceActions.d.ts +11 -0
- package/dist/instance/details/CloudFoundryInstanceDetails.d.ts +23 -0
- package/dist/instance/details/index.d.ts +1 -0
- package/dist/instance/details/sections/CloudFoundryInstanceDetailsSection.d.ts +9 -0
- package/dist/instance/details/sections/index.d.ts +1 -0
- package/dist/loadBalancer/configure/CloudFoundryMapLoadBalancerModal.d.ts +33 -0
- package/dist/loadBalancer/configure/loadBalancerDetails.d.ts +32 -0
- package/dist/loadBalancer/details/CloudFoundryLoadBalancerActions.d.ts +10 -0
- package/dist/loadBalancer/details/CloudFoundryLoadBalancerDetails.d.ts +26 -0
- package/dist/loadBalancer/details/index.d.ts +1 -0
- package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerDetailsSection.d.ts +9 -0
- package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerLinksSection.d.ts +9 -0
- package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerStatusSection.d.ts +9 -0
- package/dist/loadBalancer/details/sections/index.d.ts +3 -0
- package/dist/loadBalancer/index.d.ts +3 -0
- package/dist/loadBalancer/loadBalancer.transformer.d.ts +25 -0
- package/dist/pipeline/config/validation/cfTargetImpedance.validator.d.ts +9 -0
- package/dist/pipeline/config/validation/instanceSize.validator.d.ts +15 -0
- package/dist/pipeline/config/validation/requiredRoutes.validator.d.ts +4 -0
- package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfig.d.ts +7 -0
- package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfigForm.d.ts +13 -0
- package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestDetailsTab.d.ts +6 -0
- package/dist/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestStage.d.ts +1 -0
- package/dist/pipeline/stages/cloneServerGroup/CloudFoundryCloneServerGroupStageConfig.d.ts +11 -0
- package/dist/pipeline/stages/cloneServerGroup/cloudFoundryCloneServerGroupStage.module.d.ts +1 -0
- package/dist/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.d.ts +9 -0
- package/dist/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsStageConfigForm.d.ts +26 -0
- package/dist/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStage.d.ts +1 -0
- package/dist/pipeline/stages/createServiceKey/CloudFoundryCreateServiceKeyStageConfig.d.ts +19 -0
- package/dist/pipeline/stages/createServiceKey/cloudFoundryCreateServiceKeyStage.module.d.ts +1 -0
- package/dist/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsConfig.d.ts +10 -0
- package/dist/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsStageConfigForm.d.ts +20 -0
- package/dist/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStage.d.ts +1 -0
- package/dist/pipeline/stages/deleteServiceKey/CloudFoundryDeleteServiceKeyStageConfig.d.ts +19 -0
- package/dist/pipeline/stages/deleteServiceKey/cloudFoundryDeleteServiceKeyStage.module.d.ts +1 -0
- package/dist/pipeline/stages/deployService/CloudFoundryDeployServiceStageConfig.d.ts +24 -0
- package/dist/pipeline/stages/deployService/CreateServiceInstanceDirectInput.d.ts +29 -0
- package/dist/pipeline/stages/deployService/CreateUserProvidedInput.d.ts +19 -0
- package/dist/pipeline/stages/deployService/ICloudFoundryServiceManifestSource.d.ts +24 -0
- package/dist/pipeline/stages/deployService/ServiceTagsInput.d.ts +17 -0
- package/dist/pipeline/stages/deployService/cloudFoundryDeployServiceStage.module.d.ts +1 -0
- package/dist/pipeline/stages/destroyAsg/cloudFoundryDestroyAsgStage.module.d.ts +1 -0
- package/dist/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfig.d.ts +5 -0
- package/dist/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfigForm.d.ts +19 -0
- package/dist/pipeline/stages/destroyService/cloudFoundryDestroyServiceStage.module.d.ts +1 -0
- package/dist/pipeline/stages/disableAsg/cloudFoundryDisableAsgStage.module.d.ts +1 -0
- package/dist/pipeline/stages/enableAsg/cloudFoundryEnableAsgStage.module.d.ts +1 -0
- package/dist/pipeline/stages/mapLoadBalancers/cloudFoundryMapLoadBalancersStage.module.d.ts +1 -0
- package/dist/pipeline/stages/resizeAsg/CloudFoundryResizeAsgStageConfig.d.ts +17 -0
- package/dist/pipeline/stages/resizeAsg/cloudFoundryResizeAsgStage.module.d.ts +1 -0
- package/dist/pipeline/stages/rollbackCluster/CloudFoundryRollbackClusterStageConfig.d.ts +17 -0
- package/dist/pipeline/stages/rollbackCluster/cloudFoundryRollbackClusterStage.module.d.ts +1 -0
- package/dist/pipeline/stages/runJob/CloudFoundryRunJobStageConfig.d.ts +14 -0
- package/dist/pipeline/stages/runJob/RunJobExecutionDetails.d.ts +6 -0
- package/dist/pipeline/stages/runJob/cloudFoundryRunJob.module.d.ts +1 -0
- package/dist/pipeline/stages/shareService/CloudFoundryShareServiceExecutionDetails.d.ts +6 -0
- package/dist/pipeline/stages/shareService/CloudFoundryShareServiceStageConfig.d.ts +21 -0
- package/dist/pipeline/stages/shareService/cloudFoundryShareServiceStage.module.d.ts +1 -0
- package/dist/pipeline/stages/unmapLoadBalancers/cloudFoundryUnmapLoadBalancersStage.module.d.ts +1 -0
- package/dist/pipeline/stages/unshareService/CloudFoundryUnshareServiceExecutionDetails.d.ts +6 -0
- package/dist/pipeline/stages/unshareService/CloudFoundryUnshareServiceStageConfig.d.ts +18 -0
- package/dist/pipeline/stages/unshareService/cloudFoundryUnshareServiceStage.module.d.ts +1 -0
- package/dist/presentation/forms/index.d.ts +2 -0
- package/dist/presentation/forms/inputs/FormikConfigField.d.ts +10 -0
- package/dist/presentation/forms/inputs/index.d.ts +1 -0
- package/dist/presentation/forms/serverGroup/Buildpacks.d.ts +8 -0
- package/dist/presentation/forms/serverGroup/EnvironmentVariables.d.ts +8 -0
- package/dist/presentation/forms/serverGroup/HealthCheck.d.ts +12 -0
- package/dist/presentation/forms/serverGroup/InstanceParameters.d.ts +12 -0
- package/dist/presentation/forms/serverGroup/Routes.d.ts +10 -0
- package/dist/presentation/forms/serverGroup/Services.d.ts +5 -0
- package/dist/presentation/forms/serverGroup/index.d.ts +6 -0
- package/dist/presentation/index.d.ts +3 -0
- package/dist/presentation/pipeline/index.d.ts +1 -0
- package/dist/presentation/pipeline/stages/CloudFoundryAsgStageConfig.d.ts +14 -0
- package/dist/presentation/pipeline/stages/CloudFoundryLoadBalancersExecutionDetails.d.ts +6 -0
- package/dist/presentation/pipeline/stages/CloudFoundryLoadBalancersStageConfig.d.ts +25 -0
- package/dist/presentation/pipeline/stages/CloudFoundryServiceExecutionDetails.d.ts +6 -0
- package/dist/presentation/pipeline/stages/CloudFoundryServiceKeyExecutionDetails.d.ts +6 -0
- package/dist/presentation/pipeline/stages/index.d.ts +5 -0
- package/dist/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.d.ts +33 -0
- package/dist/presentation/widgets/accountRegionClusterSelector/FormikAccountRegionClusterSelector.d.ts +32 -0
- package/dist/presentation/widgets/accountRegionClusterSelector/index.d.ts +2 -0
- package/dist/presentation/widgets/index.d.ts +1 -0
- package/dist/presentation/widgets/recentLogs/CloudFoundryRecentLogs.d.ts +27 -0
- package/dist/routeDomains/index.d.ts +1 -0
- package/dist/routeDomains/routeDomainSelectField.d.ts +15 -0
- package/dist/serverGroup/configure/index.d.ts +4 -0
- package/dist/serverGroup/configure/serverGroupCommandBuilder.service.cf.d.ts +12 -0
- package/dist/serverGroup/configure/serverGroupCommandBuilderShim.service.cf.d.ts +14 -0
- package/dist/serverGroup/configure/serverGroupConfigurationModel.cf.d.ts +65 -0
- package/dist/serverGroup/configure/wizard/CreateServerGroupModal.d.ts +31 -0
- package/dist/serverGroup/configure/wizard/ServerGroupTemplateSelection.d.ts +16 -0
- package/dist/serverGroup/configure/wizard/sections/artifactSettings/ArtifactSettings.cf.d.ts +17 -0
- package/dist/serverGroup/configure/wizard/sections/artifactSettings/ConstantArtifactSettings.cf.d.ts +11 -0
- package/dist/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.d.ts +24 -0
- package/dist/serverGroup/configure/wizard/sections/cloneSettings/CloneSettings.cf.d.ts +21 -0
- package/dist/serverGroup/configure/wizard/sections/configurationSettings/ConfigurationSettings.cf.d.ts +22 -0
- package/dist/serverGroup/details/cfServerGroupDetailsGetter.d.ts +4 -0
- package/dist/serverGroup/details/cloudFoundryServerGroupActions.d.ts +24 -0
- package/dist/serverGroup/details/mapLoadBalancers/CloudFoundryMapLoadBalancersModal.d.ts +28 -0
- package/dist/serverGroup/details/mapLoadBalancers/CloudFoundryUnmapLoadBalancersModal.d.ts +28 -0
- package/dist/serverGroup/details/resize/CloudFoundryResizeServerGroupModal.d.ts +37 -0
- package/dist/serverGroup/details/rollback/CloudFoundryRollbackServerGroupModal.d.ts +36 -0
- package/dist/serverGroup/details/sections/ApplicationManagerSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/BoundServicesSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/BuildSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/EnvironmentVariablesSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/HealthCheckSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/ICloudFoundryServerGroupDetailsSectionProps.d.ts +5 -0
- package/dist/serverGroup/details/sections/MetricsSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/PackageSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/ServerGroupInformationSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/ServerGroupSizingSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/index.d.ts +9 -0
- package/dist/serverGroup/index.d.ts +5 -0
- package/dist/serverGroup/serverGroup.transformer.d.ts +10 -0
- package/package.json +52 -0
- package/src/cf.module.ts +85 -0
- package/src/cf.settings.ts +14 -0
- package/src/common/applicationName.validator.ts +43 -0
- package/src/common/cloudFoundry.less +16 -0
- package/src/deploymentStrategy/CloudFoundryDeploymentStrategySelector.tsx +175 -0
- package/src/deploymentStrategy/strategies/redblack/redblack.strategy.ts +11 -0
- package/src/deploymentStrategy/strategies/rollingredblack/AdditionalFields.tsx +161 -0
- package/src/domain/ICloudFoundryAccount.ts +9 -0
- package/src/domain/ICloudFoundryApplication.ts +5 -0
- package/src/domain/ICloudFoundryCluster.ts +6 -0
- package/src/domain/ICloudFoundryDroplet.ts +22 -0
- package/src/domain/ICloudFoundryInstance.ts +5 -0
- package/src/domain/ICloudFoundryLoadBalancer.ts +29 -0
- package/src/domain/ICloudFoundryServerGroup.ts +47 -0
- package/src/domain/ICloudFoundrySpace.ts +10 -0
- package/src/domain/index.ts +8 -0
- package/src/help/cloudfoundry.help.ts +31 -0
- package/src/image/image.reader.cf.ts +17 -0
- package/src/index.ts +7 -0
- package/src/instance/details/CloudFoundryInstanceActions.tsx +59 -0
- package/src/instance/details/CloudFoundryInstanceDetails.tsx +154 -0
- package/src/instance/details/index.ts +1 -0
- package/src/instance/details/sections/CloudFoundryInstanceDetailsSection.tsx +49 -0
- package/src/instance/details/sections/index.ts +1 -0
- package/src/loadBalancer/configure/CloudFoundryMapLoadBalancerModal.tsx +210 -0
- package/src/loadBalancer/configure/loadBalancerDetails.tsx +228 -0
- package/src/loadBalancer/details/CloudFoundryLoadBalancerActions.tsx +61 -0
- package/src/loadBalancer/details/CloudFoundryLoadBalancerDetails.tsx +148 -0
- package/src/loadBalancer/details/index.ts +1 -0
- package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerDetailsSection.tsx +63 -0
- package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerLinksSection.tsx +34 -0
- package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerStatusSection.tsx +27 -0
- package/src/loadBalancer/details/sections/index.ts +3 -0
- package/src/loadBalancer/index.ts +3 -0
- package/src/loadBalancer/loadBalancer.transformer.ts +144 -0
- package/src/logo/cf.icon.svg +12 -0
- package/src/logo/cf.logo.less +5 -0
- package/src/logo/cf.logo.svg +12 -0
- package/src/pipeline/config/validation/cfTargetImpedance.validator.ts +60 -0
- package/src/pipeline/config/validation/instanceSize.validator.ts +66 -0
- package/src/pipeline/config/validation/requiredRoutes.validator.ts +26 -0
- package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfig.tsx +62 -0
- package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfigForm.tsx +174 -0
- package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestDetailsTab.tsx +35 -0
- package/src/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestConfig.spec.tsx +80 -0
- package/src/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestStage.ts +35 -0
- package/src/pipeline/stages/cloneServerGroup/CloudFoundryCloneServerGroupStageConfig.tsx +113 -0
- package/src/pipeline/stages/cloneServerGroup/cloudFoundryCloneServerGroupStage.module.ts +14 -0
- package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.spec.tsx +35 -0
- package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.tsx +69 -0
- package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsStageConfigForm.tsx +230 -0
- package/src/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStage.ts +19 -0
- package/src/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStageForm.spec.tsx +50 -0
- package/src/pipeline/stages/createServiceKey/CloudFoundryCreateServiceKeyStageConfig.tsx +116 -0
- package/src/pipeline/stages/createServiceKey/cloudFoundryCreateServiceKeyStage.module.ts +21 -0
- package/src/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsConfig.tsx +69 -0
- package/src/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsStageConfigForm.tsx +158 -0
- package/src/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStage.ts +19 -0
- package/src/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStageForm.spec.tsx +49 -0
- package/src/pipeline/stages/deleteServiceKey/CloudFoundryDeleteServiceKeyStageConfig.tsx +116 -0
- package/src/pipeline/stages/deleteServiceKey/cloudFoundryDeleteServiceKeyStage.module.ts +22 -0
- package/src/pipeline/stages/deployService/CloudFoundryDeployServiceStageConfig.tsx +198 -0
- package/src/pipeline/stages/deployService/CreateServiceInstanceDirectInput.tsx +164 -0
- package/src/pipeline/stages/deployService/CreateUserProvidedInput.tsx +116 -0
- package/src/pipeline/stages/deployService/ICloudFoundryServiceManifestSource.ts +27 -0
- package/src/pipeline/stages/deployService/ServiceTagsInput.tsx +89 -0
- package/src/pipeline/stages/deployService/cloudFoundryDeployServiceStage.module.ts +153 -0
- package/src/pipeline/stages/deployService/cloudfoundryDeployServiceStage.less +12 -0
- package/src/pipeline/stages/destroyAsg/cloudFoundryDestroyAsgStage.module.ts +23 -0
- package/src/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfig.tsx +46 -0
- package/src/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfigForm.tsx +134 -0
- package/src/pipeline/stages/destroyService/cloudFoundryDestroyServiceStage.module.ts +20 -0
- package/src/pipeline/stages/disableAsg/cloudFoundryDisableAsgStage.module.ts +18 -0
- package/src/pipeline/stages/enableAsg/cloudFoundryEnableAsgStage.module.ts +18 -0
- package/src/pipeline/stages/mapLoadBalancers/cloudFoundryMapLoadBalancersStage.module.ts +21 -0
- package/src/pipeline/stages/resizeAsg/CloudFoundryResizeAsgStageConfig.tsx +148 -0
- package/src/pipeline/stages/resizeAsg/cloudFoundryResizeAsgStage.module.ts +52 -0
- package/src/pipeline/stages/rollbackCluster/CloudFoundryRollbackClusterStageConfig.tsx +90 -0
- package/src/pipeline/stages/rollbackCluster/cloudFoundryRollbackClusterStage.module.ts +19 -0
- package/src/pipeline/stages/runJob/CloudFoundryRunJobStageConfig.tsx +100 -0
- package/src/pipeline/stages/runJob/RunJobExecutionDetails.tsx +62 -0
- package/src/pipeline/stages/runJob/cloudFoundryRunJob.module.ts +24 -0
- package/src/pipeline/stages/shareService/CloudFoundryShareServiceExecutionDetails.tsx +52 -0
- package/src/pipeline/stages/shareService/CloudFoundryShareServiceStageConfig.tsx +141 -0
- package/src/pipeline/stages/shareService/cloudFoundryShareServiceStage.module.ts +21 -0
- package/src/pipeline/stages/unmapLoadBalancers/cloudFoundryUnmapLoadBalancersStage.module.ts +21 -0
- package/src/pipeline/stages/unshareService/CloudFoundryUnshareServiceExecutionDetails.tsx +46 -0
- package/src/pipeline/stages/unshareService/CloudFoundryUnshareServiceStageConfig.tsx +114 -0
- package/src/pipeline/stages/unshareService/cloudFoundryUnshareServiceStage.module.ts +21 -0
- package/src/presentation/forms/index.ts +2 -0
- package/src/presentation/forms/inputs/FormikConfigField.tsx +28 -0
- package/src/presentation/forms/inputs/index.ts +1 -0
- package/src/presentation/forms/serverGroup/Buildpacks.tsx +69 -0
- package/src/presentation/forms/serverGroup/EnvironmentVariables.tsx +94 -0
- package/src/presentation/forms/serverGroup/HealthCheck.tsx +57 -0
- package/src/presentation/forms/serverGroup/InstanceParameters.tsx +63 -0
- package/src/presentation/forms/serverGroup/Routes.tsx +74 -0
- package/src/presentation/forms/serverGroup/Services.tsx +62 -0
- package/src/presentation/forms/serverGroup/index.ts +6 -0
- package/src/presentation/index.ts +3 -0
- package/src/presentation/pipeline/index.ts +1 -0
- package/src/presentation/pipeline/stages/CloudFoundryAsgStageConfig.tsx +67 -0
- package/src/presentation/pipeline/stages/CloudFoundryLoadBalancersExecutionDetails.tsx +53 -0
- package/src/presentation/pipeline/stages/CloudFoundryLoadBalancersStageConfig.tsx +116 -0
- package/src/presentation/pipeline/stages/CloudFoundryServiceExecutionDetails.tsx +46 -0
- package/src/presentation/pipeline/stages/CloudFoundryServiceKeyExecutionDetails.tsx +52 -0
- package/src/presentation/pipeline/stages/index.ts +5 -0
- package/src/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.spec.tsx +385 -0
- package/src/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.tsx +231 -0
- package/src/presentation/widgets/accountRegionClusterSelector/FormikAccountRegionClusterSelector.tsx +164 -0
- package/src/presentation/widgets/accountRegionClusterSelector/index.ts +2 -0
- package/src/presentation/widgets/index.ts +1 -0
- package/src/presentation/widgets/recentLogs/CloudFoundryRecentLogs.tsx +112 -0
- package/src/routeDomains/index.ts +1 -0
- package/src/routeDomains/routeDomainSelectField.tsx +48 -0
- package/src/serverGroup/configure/index.ts +4 -0
- package/src/serverGroup/configure/serverGroupCommandBuilder.service.cf.ts +168 -0
- package/src/serverGroup/configure/serverGroupCommandBuilderShim.service.cf.ts +64 -0
- package/src/serverGroup/configure/serverGroupConfigurationModel.cf.ts +77 -0
- package/src/serverGroup/configure/wizard/CreateServerGroupModal.tsx +194 -0
- package/src/serverGroup/configure/wizard/ServerGroupTemplateSelection.tsx +55 -0
- package/src/serverGroup/configure/wizard/sections/artifactSettings/ArtifactSettings.cf.tsx +78 -0
- package/src/serverGroup/configure/wizard/sections/artifactSettings/ConstantArtifactSettings.cf.tsx +49 -0
- package/src/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.tsx +163 -0
- package/src/serverGroup/configure/wizard/sections/cloneSettings/CloneSettings.cf.tsx +101 -0
- package/src/serverGroup/configure/wizard/sections/configurationSettings/ConfigurationSettings.cf.tsx +230 -0
- package/src/serverGroup/configure/wizard/serverGroup.less +3 -0
- package/src/serverGroup/details/cfServerGroupDetailsGetter.ts +60 -0
- package/src/serverGroup/details/cloudFoundryServerGroupActions.tsx +365 -0
- package/src/serverGroup/details/mapLoadBalancers/CloudFoundryMapLoadBalancersModal.tsx +137 -0
- package/src/serverGroup/details/mapLoadBalancers/CloudFoundryUnmapLoadBalancersModal.tsx +137 -0
- package/src/serverGroup/details/resize/CloudFoundryResizeServerGroupModal.tsx +232 -0
- package/src/serverGroup/details/rollback/CloudFoundryRollbackServerGroupModal.tsx +179 -0
- package/src/serverGroup/details/sections/ApplicationManagerSection.tsx +28 -0
- package/src/serverGroup/details/sections/BoundServicesSection.tsx +39 -0
- package/src/serverGroup/details/sections/BuildSection.tsx +61 -0
- package/src/serverGroup/details/sections/EnvironmentVariablesSection.tsx +34 -0
- package/src/serverGroup/details/sections/HealthCheckSection.tsx +28 -0
- package/src/serverGroup/details/sections/ICloudFoundryServerGroupDetailsSectionProps.ts +6 -0
- package/src/serverGroup/details/sections/MetricsSection.tsx +28 -0
- package/src/serverGroup/details/sections/PackageSection.tsx +27 -0
- package/src/serverGroup/details/sections/ServerGroupInformationSection.tsx +58 -0
- package/src/serverGroup/details/sections/ServerGroupSizingSection.tsx +27 -0
- package/src/serverGroup/details/sections/index.ts +9 -0
- package/src/serverGroup/index.ts +5 -0
- package/src/serverGroup/serverGroup.transformer.ts +42 -0
package/src/serverGroup/configure/wizard/sections/configurationSettings/ConfigurationSettings.cf.tsx
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import type { FormikProps } from 'formik';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import type { IArtifact, IExpectedArtifact, IPipeline, IStage, IWizardPageComponent } from '@spinnaker/core';
|
|
5
|
+
import { ArtifactTypePatterns, RadioButtonInput, StageArtifactSelector } from '@spinnaker/core';
|
|
6
|
+
import type { ICloudFoundryEnvVar } from '../../../../../domain';
|
|
7
|
+
import {
|
|
8
|
+
Buildpacks,
|
|
9
|
+
EnvironmentVariables,
|
|
10
|
+
FormikConfigField,
|
|
11
|
+
HealthCheck,
|
|
12
|
+
InstanceParameters,
|
|
13
|
+
Routes,
|
|
14
|
+
Services,
|
|
15
|
+
} from '../../../../../presentation';
|
|
16
|
+
|
|
17
|
+
import type {
|
|
18
|
+
ICloudFoundryCreateServerGroupCommand,
|
|
19
|
+
ICloudFoundryManifest,
|
|
20
|
+
} from '../../../serverGroupConfigurationModel.cf';
|
|
21
|
+
|
|
22
|
+
export interface ICloudFoundryServerGroupConfigurationSettingsProps {
|
|
23
|
+
formik: FormikProps<ICloudFoundryCreateServerGroupCommand>;
|
|
24
|
+
stage: IStage;
|
|
25
|
+
pipeline: IPipeline;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class CloudFoundryServerGroupConfigurationSettings
|
|
29
|
+
extends React.Component<ICloudFoundryServerGroupConfigurationSettingsProps>
|
|
30
|
+
implements IWizardPageComponent<ICloudFoundryServerGroupConfigurationSettingsProps> {
|
|
31
|
+
public static LABEL = 'Configuration';
|
|
32
|
+
|
|
33
|
+
private defaultDirectManifest: ICloudFoundryManifest = {
|
|
34
|
+
direct: {
|
|
35
|
+
memory: '1024M',
|
|
36
|
+
diskQuota: '1024M',
|
|
37
|
+
instances: 1,
|
|
38
|
+
buildpacks: [],
|
|
39
|
+
healthCheckType: 'port',
|
|
40
|
+
routes: [],
|
|
41
|
+
environment: [],
|
|
42
|
+
services: [],
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
private excludedArtifactTypePatterns = [
|
|
47
|
+
ArtifactTypePatterns.KUBERNETES,
|
|
48
|
+
ArtifactTypePatterns.DOCKER_IMAGE,
|
|
49
|
+
ArtifactTypePatterns.FRONT50_PIPELINE_TEMPLATE,
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
private manifestSourceUpdated = (source: string): void => {
|
|
53
|
+
switch (source) {
|
|
54
|
+
case 'artifact':
|
|
55
|
+
this.props.formik.setFieldValue('manifest', {});
|
|
56
|
+
this.capacityUpdated('1');
|
|
57
|
+
break;
|
|
58
|
+
case 'direct':
|
|
59
|
+
this.props.formik.setFieldValue('manifest', this.defaultDirectManifest);
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
private capacityUpdated = (capacity: string): void => {
|
|
65
|
+
this.props.formik.setFieldValue('capacity.min', capacity);
|
|
66
|
+
this.props.formik.setFieldValue('capacity.max', capacity);
|
|
67
|
+
this.props.formik.setFieldValue('capacity.desired', capacity);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
private getArtifactInput = (): JSX.Element => {
|
|
71
|
+
const { formik, stage, pipeline } = this.props;
|
|
72
|
+
const manifest = formik.values.manifest;
|
|
73
|
+
return (
|
|
74
|
+
<div className="form-group">
|
|
75
|
+
<div className="col-md-11">
|
|
76
|
+
<div className="StandardFieldLayout flex-container-h margin-between-lg">
|
|
77
|
+
<div className="flex-grow">
|
|
78
|
+
<StageArtifactSelector
|
|
79
|
+
pipeline={pipeline}
|
|
80
|
+
stage={stage}
|
|
81
|
+
expectedArtifactId={manifest && manifest.artifactId}
|
|
82
|
+
artifact={manifest && manifest.artifact}
|
|
83
|
+
onExpectedArtifactSelected={this.onExpectedArtifactSelected}
|
|
84
|
+
onArtifactEdited={this.onArtifactChanged}
|
|
85
|
+
excludedArtifactTypePatterns={this.excludedArtifactTypePatterns}
|
|
86
|
+
renderLabel={(field: React.ReactNode) => {
|
|
87
|
+
return <FormikConfigField label={'Artifact'}>{field}</FormikConfigField>;
|
|
88
|
+
}}
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
private onExpectedArtifactSelected = (expectedArtifact: IExpectedArtifact): void => {
|
|
98
|
+
this.props.formik.setFieldValue('manifest', { artifactId: expectedArtifact.id });
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
private onArtifactChanged = (artifact: IArtifact): void => {
|
|
102
|
+
this.props.formik.setFieldValue('manifest', { artifact: artifact });
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
private getDirectInput = (): JSX.Element => {
|
|
106
|
+
const m = this.props.formik.values.manifest.direct;
|
|
107
|
+
return (
|
|
108
|
+
<div>
|
|
109
|
+
{
|
|
110
|
+
<InstanceParameters
|
|
111
|
+
diskQuotaFieldName={'manifest.direct.diskQuota'}
|
|
112
|
+
instancesFieldName={'manifest.direct.instances'}
|
|
113
|
+
memoryFieldName={'manifest.direct.memory'}
|
|
114
|
+
/>
|
|
115
|
+
}
|
|
116
|
+
{<Buildpacks fieldName="manifest.direct.buildpacks" />}
|
|
117
|
+
{
|
|
118
|
+
<HealthCheck
|
|
119
|
+
healthCheckHttpEndpointFieldName={'manifest.direct.healthCheckHttpEndpoint'}
|
|
120
|
+
healthCheckType={m.healthCheckType}
|
|
121
|
+
healthCheckTypeFieldName={'manifest.direct.healthCheckType'}
|
|
122
|
+
/>
|
|
123
|
+
}
|
|
124
|
+
{<Routes fieldName="manifest.direct.routes" />}
|
|
125
|
+
{<EnvironmentVariables fieldName="manifest.direct.environment" />}
|
|
126
|
+
{<Services fieldName="manifest.direct.services" />}
|
|
127
|
+
</div>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
public render(): JSX.Element {
|
|
132
|
+
const manifest = this.props.formik.values.manifest;
|
|
133
|
+
const direct = manifest && !!manifest.direct;
|
|
134
|
+
return (
|
|
135
|
+
<>
|
|
136
|
+
<div className="form-group">
|
|
137
|
+
<div className="col-md-11">
|
|
138
|
+
<div className="StandardFieldLayout flex-container-h baseline margin-between-lg">
|
|
139
|
+
<div className="sm-label-right">Source Type</div>
|
|
140
|
+
<div className="flex-grow">
|
|
141
|
+
<RadioButtonInput
|
|
142
|
+
inline={true}
|
|
143
|
+
value={direct ? 'direct' : 'artifact'}
|
|
144
|
+
options={[
|
|
145
|
+
{ label: 'Artifact', value: 'artifact' },
|
|
146
|
+
{ label: 'Form', value: 'direct' },
|
|
147
|
+
]}
|
|
148
|
+
onChange={(e: any) => this.manifestSourceUpdated(e.target.value)}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
{direct ? this.getDirectInput() : this.getArtifactInput()}
|
|
155
|
+
</>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
public validate(_props: ICloudFoundryServerGroupConfigurationSettingsProps) {
|
|
160
|
+
const errors = {} as any;
|
|
161
|
+
const isStorageSize = (value: string) => /\d+[MG]/.test(value);
|
|
162
|
+
|
|
163
|
+
if (!this.props.formik.values.manifest) {
|
|
164
|
+
errors.manifest = 'No manifest information provided';
|
|
165
|
+
return errors;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const direct = this.props.formik.values.manifest.direct;
|
|
169
|
+
if (direct) {
|
|
170
|
+
if (!isStorageSize(direct.memory)) {
|
|
171
|
+
errors.manifest = errors.manifest || {};
|
|
172
|
+
errors.manifest.memory = `Provide a size (e.g.: 256M, 1G)`;
|
|
173
|
+
}
|
|
174
|
+
if (!isStorageSize(direct.diskQuota)) {
|
|
175
|
+
errors.manifest = errors.manifest || {};
|
|
176
|
+
errors.manifest.diskQuota = `Provide a size (e.g.: 256M, 1G)`;
|
|
177
|
+
}
|
|
178
|
+
if (direct.routes) {
|
|
179
|
+
const routeErrors = direct.routes.map((route: string) => {
|
|
180
|
+
const regex = /^([-\w]+)\.([-.\w]+)(:\d+)?([-/\w]+)?$/gm;
|
|
181
|
+
if (route && regex.exec(route) === null) {
|
|
182
|
+
return `A route did not match the expected format "host.some.domain[:9999][/some/path]"`;
|
|
183
|
+
}
|
|
184
|
+
return null;
|
|
185
|
+
});
|
|
186
|
+
if (routeErrors.some((val: string) => !!val)) {
|
|
187
|
+
errors.manifest = errors.manifest || {};
|
|
188
|
+
errors.manifest.routes = routeErrors;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (direct.environment) {
|
|
192
|
+
const existingKeys: string[] = [];
|
|
193
|
+
const envErrors = direct.environment.map((e: ICloudFoundryEnvVar) => {
|
|
194
|
+
let myErrors: any;
|
|
195
|
+
if (e.key) {
|
|
196
|
+
const validKeyRegex = /^\w+$/g;
|
|
197
|
+
if (!validKeyRegex.exec(e.key)) {
|
|
198
|
+
myErrors = {
|
|
199
|
+
key: `This field must be alphanumeric`,
|
|
200
|
+
};
|
|
201
|
+
} else {
|
|
202
|
+
if (existingKeys.filter((key) => key === e.key).length > 0) {
|
|
203
|
+
myErrors = {
|
|
204
|
+
key: `Duplicate variable name`,
|
|
205
|
+
};
|
|
206
|
+
} else {
|
|
207
|
+
existingKeys.push(e.key);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return myErrors;
|
|
212
|
+
});
|
|
213
|
+
if (envErrors.some((val: string) => !!val)) {
|
|
214
|
+
errors.manifest = errors.manifest || {};
|
|
215
|
+
errors.manifest.environment = envErrors;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
} else {
|
|
219
|
+
const { manifest } = this.props.formik.values;
|
|
220
|
+
if (
|
|
221
|
+
!manifest ||
|
|
222
|
+
!((manifest.artifact && manifest.artifact.type && manifest.artifact.reference) || manifest.artifactId)
|
|
223
|
+
) {
|
|
224
|
+
errors.manifest = 'Manifest artifact information is required';
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return errors;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { isEmpty } from 'lodash';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
import type { IServerGroupDetailsProps } from '@spinnaker/core';
|
|
5
|
+
import { ServerGroupReader } from '@spinnaker/core';
|
|
6
|
+
import type { ICloudFoundryLoadBalancer, ICloudFoundryServerGroup } from '../../domain';
|
|
7
|
+
|
|
8
|
+
function extractServerGroupSummary(props: IServerGroupDetailsProps): PromiseLike<ICloudFoundryServerGroup> {
|
|
9
|
+
const { app, serverGroup } = props;
|
|
10
|
+
return app.ready().then(() => {
|
|
11
|
+
let summary: ICloudFoundryServerGroup = app.serverGroups.data.find((toCheck: ICloudFoundryServerGroup) => {
|
|
12
|
+
return (
|
|
13
|
+
toCheck.name === serverGroup.name &&
|
|
14
|
+
toCheck.account === serverGroup.accountId &&
|
|
15
|
+
toCheck.region === serverGroup.region
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
if (!summary) {
|
|
19
|
+
app.loadBalancers.data.some((loadBalancer: ICloudFoundryLoadBalancer) => {
|
|
20
|
+
if (loadBalancer.account === serverGroup.accountId && loadBalancer.region === serverGroup.region) {
|
|
21
|
+
return loadBalancer.serverGroups.some((possibleServerGroup) => {
|
|
22
|
+
if (possibleServerGroup.name === serverGroup.name) {
|
|
23
|
+
summary = possibleServerGroup;
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return summary;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function cfServerGroupDetailsGetter(
|
|
37
|
+
props: IServerGroupDetailsProps,
|
|
38
|
+
autoClose: () => void,
|
|
39
|
+
): Observable<ICloudFoundryServerGroup> {
|
|
40
|
+
const { app, serverGroup: serverGroupInfo } = props;
|
|
41
|
+
return new Observable<ICloudFoundryServerGroup>((observer) => {
|
|
42
|
+
extractServerGroupSummary(props).then((summary) => {
|
|
43
|
+
ServerGroupReader.getServerGroup(
|
|
44
|
+
app.name,
|
|
45
|
+
serverGroupInfo.accountId,
|
|
46
|
+
serverGroupInfo.region,
|
|
47
|
+
serverGroupInfo.name,
|
|
48
|
+
).then((serverGroup: ICloudFoundryServerGroup) => {
|
|
49
|
+
// it's possible the summary was not found because the clusters are still loading
|
|
50
|
+
Object.assign(serverGroup, summary, { account: serverGroupInfo.accountId });
|
|
51
|
+
|
|
52
|
+
if (!isEmpty(serverGroup)) {
|
|
53
|
+
observer.next(serverGroup);
|
|
54
|
+
} else {
|
|
55
|
+
autoClose();
|
|
56
|
+
}
|
|
57
|
+
}, autoClose);
|
|
58
|
+
}, autoClose);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { filter, find, get, orderBy } from 'lodash';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Dropdown, Tooltip } from 'react-bootstrap';
|
|
4
|
+
|
|
5
|
+
import type { IOwnerOption, IServerGroupActionsProps, IServerGroupJob } from '@spinnaker/core';
|
|
6
|
+
import {
|
|
7
|
+
AddEntityTagLinks,
|
|
8
|
+
ClusterTargetBuilder,
|
|
9
|
+
ConfirmationModalService,
|
|
10
|
+
ReactInjector,
|
|
11
|
+
ServerGroupWarningMessageService,
|
|
12
|
+
SETTINGS,
|
|
13
|
+
} from '@spinnaker/core';
|
|
14
|
+
|
|
15
|
+
import { CloudFoundryServerGroupCommandBuilder } from '../configure';
|
|
16
|
+
import { CloudFoundryCreateServerGroupModal } from '../configure/wizard/CreateServerGroupModal';
|
|
17
|
+
import type { ICloudFoundryServerGroup } from '../../domain';
|
|
18
|
+
import { CloudFoundryMapLoadBalancersModal } from './mapLoadBalancers/CloudFoundryMapLoadBalancersModal';
|
|
19
|
+
import { CloudFoundryUnmapLoadBalancersModal } from './mapLoadBalancers/CloudFoundryUnmapLoadBalancersModal';
|
|
20
|
+
import { CloudFoundryResizeServerGroupModal } from './resize/CloudFoundryResizeServerGroupModal';
|
|
21
|
+
import { CloudFoundryRollbackServerGroupModal } from './rollback/CloudFoundryRollbackServerGroupModal';
|
|
22
|
+
|
|
23
|
+
export interface ICloudFoundryServerGroupActionsProps extends IServerGroupActionsProps {
|
|
24
|
+
serverGroup: ICloudFoundryServerGroup;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ICloudFoundryServerGroupJob extends IServerGroupJob {
|
|
28
|
+
serverGroupId: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class CloudFoundryServerGroupActions extends React.Component<ICloudFoundryServerGroupActionsProps> {
|
|
32
|
+
private isEnableLocked(): boolean {
|
|
33
|
+
if (this.props.serverGroup.isDisabled) {
|
|
34
|
+
const resizeTasks = (this.props.serverGroup.runningTasks || []).filter((task) =>
|
|
35
|
+
get(task, 'execution.stages', []).some((stage) => stage.type === 'resizeServerGroup'),
|
|
36
|
+
);
|
|
37
|
+
if (resizeTasks.length) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private isRollbackEnabled(): boolean {
|
|
45
|
+
const { app, serverGroup } = this.props;
|
|
46
|
+
|
|
47
|
+
if (!serverGroup.isDisabled) {
|
|
48
|
+
// enabled server groups are always a candidate for rollback
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// if the server group selected for rollback is disabled, ensure that at least one enabled server group exists
|
|
53
|
+
return app
|
|
54
|
+
.getDataSource('serverGroups')
|
|
55
|
+
.data.some(
|
|
56
|
+
(g: ICloudFoundryServerGroup) =>
|
|
57
|
+
g.cluster === serverGroup.cluster &&
|
|
58
|
+
g.region === serverGroup.region &&
|
|
59
|
+
g.account === serverGroup.account &&
|
|
60
|
+
!g.isDisabled,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private hasDisabledInstances(): boolean {
|
|
65
|
+
// server group may have disabled instances (out of service) but NOT itself be disabled
|
|
66
|
+
return this.props.serverGroup.isDisabled || get(this.props.serverGroup, 'instanceCounts.outOfService', 0) > 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private destroyServerGroup = (): void => {
|
|
70
|
+
const { app, serverGroup } = this.props;
|
|
71
|
+
|
|
72
|
+
const stateParams = {
|
|
73
|
+
name: serverGroup.name,
|
|
74
|
+
accountId: serverGroup.account,
|
|
75
|
+
region: serverGroup.region,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const taskMonitor = {
|
|
79
|
+
application: app,
|
|
80
|
+
title: 'Destroying ' + serverGroup.name,
|
|
81
|
+
onTaskComplete: () => {
|
|
82
|
+
if (ReactInjector.$state.includes('**.serverGroup', stateParams)) {
|
|
83
|
+
ReactInjector.$state.go('^');
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const submitMethod = (params: ICloudFoundryServerGroupJob) => {
|
|
89
|
+
params.serverGroupName = serverGroup.name;
|
|
90
|
+
return ReactInjector.serverGroupWriter.destroyServerGroup(serverGroup, app, params);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const confirmationModalParams = {
|
|
94
|
+
header: 'Really destroy ' + serverGroup.name + '?',
|
|
95
|
+
buttonText: 'Destroy ' + serverGroup.name,
|
|
96
|
+
account: serverGroup.account,
|
|
97
|
+
taskMonitorConfig: taskMonitor,
|
|
98
|
+
interestingHealthProviderNames: undefined as string[],
|
|
99
|
+
submitMethod,
|
|
100
|
+
askForReason: true,
|
|
101
|
+
platformHealthOnlyShowOverride: app.attributes.platformHealthOnlyShowOverride,
|
|
102
|
+
platformHealthType: 'Cloud Foundry',
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
ServerGroupWarningMessageService.addDestroyWarningMessage(app, serverGroup, confirmationModalParams);
|
|
106
|
+
|
|
107
|
+
if (app.attributes.platformHealthOnlyShowOverride && app.attributes.platformHealthOnly) {
|
|
108
|
+
confirmationModalParams.interestingHealthProviderNames = ['Cloud Foundry'];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
ConfirmationModalService.confirm(confirmationModalParams);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
private disableServerGroup = (): void => {
|
|
115
|
+
const { app, serverGroup } = this.props;
|
|
116
|
+
const taskMonitor = {
|
|
117
|
+
application: app,
|
|
118
|
+
title: 'Disabling ' + serverGroup.name,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const submitMethod = (params: ICloudFoundryServerGroupJob) => {
|
|
122
|
+
params.serverGroupName = serverGroup.name;
|
|
123
|
+
return ReactInjector.serverGroupWriter.disableServerGroup(serverGroup, app.name, params);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const confirmationModalParams = {
|
|
127
|
+
header: 'Really disable ' + serverGroup.name + '?',
|
|
128
|
+
buttonText: 'Disable ' + serverGroup.name,
|
|
129
|
+
account: serverGroup.account,
|
|
130
|
+
interestingHealthProviderNames: undefined as string[],
|
|
131
|
+
taskMonitorConfig: taskMonitor,
|
|
132
|
+
platformHealthOnlyShowOverride: app.attributes.platformHealthOnlyShowOverride,
|
|
133
|
+
platformHealthType: 'Cloud Foundry',
|
|
134
|
+
submitMethod,
|
|
135
|
+
askForReason: true,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
ServerGroupWarningMessageService.addDisableWarningMessage(app, serverGroup, confirmationModalParams);
|
|
139
|
+
|
|
140
|
+
if (app.attributes.platformHealthOnlyShowOverride && app.attributes.platformHealthOnly) {
|
|
141
|
+
confirmationModalParams.interestingHealthProviderNames = ['Cloud Foundry'];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
ConfirmationModalService.confirm(confirmationModalParams);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
private enableServerGroup = (): void => {
|
|
148
|
+
if (!this.isRollbackEnabled()) {
|
|
149
|
+
this.showEnableServerGroupModal();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const confirmationModalParams = {
|
|
154
|
+
header: 'Rolling back?',
|
|
155
|
+
body: `Spinnaker provides an orchestrated rollback feature to carefully restore a different version of this
|
|
156
|
+
server group. Do you want to use the orchestrated rollback?`,
|
|
157
|
+
buttonText: `Yes, let's start the orchestrated rollback`,
|
|
158
|
+
cancelButtonText: 'No, I just want to enable the server group',
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
ConfirmationModalService.confirm(confirmationModalParams)
|
|
162
|
+
.then(() => this.rollbackServerGroup())
|
|
163
|
+
.catch(({ source }) => {
|
|
164
|
+
// don't show the enable modal if the user cancels with the header button
|
|
165
|
+
if (source === 'footer') {
|
|
166
|
+
this.showEnableServerGroupModal();
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
private showEnableServerGroupModal(): void {
|
|
172
|
+
const { app, serverGroup } = this.props;
|
|
173
|
+
|
|
174
|
+
const taskMonitor = {
|
|
175
|
+
application: app,
|
|
176
|
+
title: 'Enabling ' + serverGroup.name,
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const submitMethod = (params: ICloudFoundryServerGroupJob) => {
|
|
180
|
+
params.serverGroupName = serverGroup.name;
|
|
181
|
+
return ReactInjector.serverGroupWriter.enableServerGroup(serverGroup, app, params);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const confirmationModalParams = {
|
|
185
|
+
header: 'Really enable ' + serverGroup.name + '?',
|
|
186
|
+
buttonText: 'Enable ' + serverGroup.name,
|
|
187
|
+
account: serverGroup.account,
|
|
188
|
+
interestingHealthProviderNames: undefined as string[],
|
|
189
|
+
taskMonitorConfig: taskMonitor,
|
|
190
|
+
platformHealthOnlyShowOverride: app.attributes.platformHealthOnlyShowOverride,
|
|
191
|
+
platformHealthType: 'Cloud Foundry',
|
|
192
|
+
submitMethod,
|
|
193
|
+
askForReason: true,
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
if (app.attributes.platformHealthOnlyShowOverride && app.attributes.platformHealthOnly) {
|
|
197
|
+
confirmationModalParams.interestingHealthProviderNames = ['Cloud Foundry'];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
ConfirmationModalService.confirm(confirmationModalParams);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
private rollbackServerGroup = (): void => {
|
|
204
|
+
const { app } = this.props;
|
|
205
|
+
|
|
206
|
+
let serverGroup: ICloudFoundryServerGroup = this.props.serverGroup;
|
|
207
|
+
let previousServerGroup: ICloudFoundryServerGroup;
|
|
208
|
+
let allServerGroups = (app.serverGroups.data as ICloudFoundryServerGroup[]).filter(
|
|
209
|
+
(g) => g.cluster === serverGroup.cluster && g.region === serverGroup.region && g.account === serverGroup.account,
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
if (serverGroup.isDisabled) {
|
|
213
|
+
// if the selected server group is disabled, it represents the server group that should be _rolled back to_
|
|
214
|
+
previousServerGroup = serverGroup;
|
|
215
|
+
|
|
216
|
+
/*
|
|
217
|
+
* Find an existing server group to rollback, prefer the largest enabled server group.
|
|
218
|
+
*
|
|
219
|
+
* isRollbackEnabled() ensures that at least one enabled server group exists.
|
|
220
|
+
*/
|
|
221
|
+
serverGroup = orderBy(
|
|
222
|
+
allServerGroups.filter((g: ICloudFoundryServerGroup) => g.name !== previousServerGroup.name && !g.isDisabled),
|
|
223
|
+
['instanceCounts.total', 'createdTime'],
|
|
224
|
+
['desc', 'desc'],
|
|
225
|
+
)[0] as ICloudFoundryServerGroup;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// the set of all server groups should not include the server group selected for rollback
|
|
229
|
+
allServerGroups = allServerGroups.filter((g) => g.name !== serverGroup.name);
|
|
230
|
+
|
|
231
|
+
if (allServerGroups.length === 1 && !previousServerGroup) {
|
|
232
|
+
// if there is only one other server group, default to it being the rollback target
|
|
233
|
+
previousServerGroup = allServerGroups[0];
|
|
234
|
+
}
|
|
235
|
+
const cluster = find(app.clusters, {
|
|
236
|
+
name: serverGroup.cluster,
|
|
237
|
+
account: serverGroup.account,
|
|
238
|
+
serverGroups: [],
|
|
239
|
+
});
|
|
240
|
+
const disabledServerGroups: ICloudFoundryServerGroup[] = filter(cluster.serverGroups, {
|
|
241
|
+
isDisabled: true,
|
|
242
|
+
region: serverGroup.region,
|
|
243
|
+
}) as ICloudFoundryServerGroup[];
|
|
244
|
+
|
|
245
|
+
CloudFoundryRollbackServerGroupModal.show({
|
|
246
|
+
serverGroup,
|
|
247
|
+
previousServerGroup,
|
|
248
|
+
disabledServerGroups: disabledServerGroups.sort((a, b) => b.name.localeCompare(a.name)),
|
|
249
|
+
allServerGroups: allServerGroups.sort((a, b) => b.name.localeCompare(a.name)),
|
|
250
|
+
application: app,
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
private resizeServerGroup = (): void => {
|
|
255
|
+
const { app, serverGroup } = this.props;
|
|
256
|
+
CloudFoundryResizeServerGroupModal.show({ application: app, serverGroup });
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
private mapServerGroupToLoadBalancers = (): void => {
|
|
260
|
+
const { app, serverGroup } = this.props;
|
|
261
|
+
CloudFoundryMapLoadBalancersModal.show({ application: app, serverGroup });
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
private unmapServerGroupFromLoadBalancers = (): void => {
|
|
265
|
+
const { app, serverGroup } = this.props;
|
|
266
|
+
CloudFoundryUnmapLoadBalancersModal.show({ application: app, serverGroup });
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
private cloneServerGroup = (): void => {
|
|
270
|
+
const { app, serverGroup } = this.props;
|
|
271
|
+
const command = CloudFoundryServerGroupCommandBuilder.buildServerGroupCommandFromExisting(app, serverGroup);
|
|
272
|
+
const title = `Clone ${serverGroup.name}`;
|
|
273
|
+
CloudFoundryCreateServerGroupModal.show({
|
|
274
|
+
application: app,
|
|
275
|
+
command,
|
|
276
|
+
isSourceConstant: true,
|
|
277
|
+
serverGroup,
|
|
278
|
+
title,
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
public render(): JSX.Element {
|
|
283
|
+
const { app, serverGroup } = this.props;
|
|
284
|
+
const { loadBalancers } = serverGroup;
|
|
285
|
+
const showEntityTags = SETTINGS.feature && SETTINGS.feature.entityTags;
|
|
286
|
+
const entityTagTargets: IOwnerOption[] = ClusterTargetBuilder.buildClusterTargets(serverGroup);
|
|
287
|
+
|
|
288
|
+
return (
|
|
289
|
+
<Dropdown className="dropdown" id="server-group-actions-dropdown">
|
|
290
|
+
<Dropdown.Toggle className="btn btn-sm btn-primary dropdown-toggle">Server Group Actions</Dropdown.Toggle>
|
|
291
|
+
<Dropdown.Menu className="dropdown-menu">
|
|
292
|
+
{this.isRollbackEnabled() && (
|
|
293
|
+
<li>
|
|
294
|
+
<a className="clickable" onClick={this.rollbackServerGroup}>
|
|
295
|
+
Rollback
|
|
296
|
+
</a>
|
|
297
|
+
</li>
|
|
298
|
+
)}
|
|
299
|
+
{this.isRollbackEnabled() && <li role="presentation" className="divider" />}
|
|
300
|
+
<li>
|
|
301
|
+
<a className="clickable" onClick={this.resizeServerGroup}>
|
|
302
|
+
Resize
|
|
303
|
+
</a>
|
|
304
|
+
</li>
|
|
305
|
+
{!serverGroup.isDisabled && (
|
|
306
|
+
<li>
|
|
307
|
+
<a className="clickable" onClick={this.disableServerGroup}>
|
|
308
|
+
Disable
|
|
309
|
+
</a>
|
|
310
|
+
</li>
|
|
311
|
+
)}
|
|
312
|
+
{this.hasDisabledInstances() && !this.isEnableLocked() && (
|
|
313
|
+
<li>
|
|
314
|
+
<a className="clickable" onClick={this.enableServerGroup}>
|
|
315
|
+
Enable
|
|
316
|
+
</a>
|
|
317
|
+
</li>
|
|
318
|
+
)}
|
|
319
|
+
{this.isEnableLocked() && (
|
|
320
|
+
<li className="disabled">
|
|
321
|
+
<Tooltip value="Cannot enable this server group until resize operation completes" placement="left">
|
|
322
|
+
<a>
|
|
323
|
+
<span className="small glyphicon glyphicon-lock" /> Enable
|
|
324
|
+
</a>
|
|
325
|
+
</Tooltip>
|
|
326
|
+
</li>
|
|
327
|
+
)}
|
|
328
|
+
<li>
|
|
329
|
+
<a className="clickable" onClick={this.destroyServerGroup}>
|
|
330
|
+
Destroy
|
|
331
|
+
</a>
|
|
332
|
+
</li>
|
|
333
|
+
<li>
|
|
334
|
+
<a className="clickable" onClick={this.cloneServerGroup}>
|
|
335
|
+
Clone
|
|
336
|
+
</a>
|
|
337
|
+
</li>
|
|
338
|
+
{!serverGroup.isDisabled && (
|
|
339
|
+
<li>
|
|
340
|
+
<a className="clickable" onClick={this.mapServerGroupToLoadBalancers}>
|
|
341
|
+
Map Load Balancer
|
|
342
|
+
</a>
|
|
343
|
+
</li>
|
|
344
|
+
)}
|
|
345
|
+
{!serverGroup.isDisabled && loadBalancers && !!loadBalancers.length && (
|
|
346
|
+
<li>
|
|
347
|
+
<a className="clickable" onClick={this.unmapServerGroupFromLoadBalancers}>
|
|
348
|
+
Unmap Load Balancer
|
|
349
|
+
</a>
|
|
350
|
+
</li>
|
|
351
|
+
)}
|
|
352
|
+
{showEntityTags && (
|
|
353
|
+
<AddEntityTagLinks
|
|
354
|
+
component={serverGroup}
|
|
355
|
+
application={app}
|
|
356
|
+
entityType="serverGroup"
|
|
357
|
+
ownerOptions={entityTagTargets}
|
|
358
|
+
onUpdate={() => app.serverGroups.refresh()}
|
|
359
|
+
/>
|
|
360
|
+
)}
|
|
361
|
+
</Dropdown.Menu>
|
|
362
|
+
</Dropdown>
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
}
|