@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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { get } from 'lodash';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import type { IExecutionDetailsSectionProps } from '@spinnaker/core';
|
|
5
|
+
import { AccountTag, ExecutionDetailsSection, StageExecutionLogs, StageFailureMessage } from '@spinnaker/core';
|
|
6
|
+
|
|
7
|
+
export function CloudFoundryServiceKeyExecutionDetails(props: IExecutionDetailsSectionProps) {
|
|
8
|
+
const { stage } = props;
|
|
9
|
+
const { context } = stage;
|
|
10
|
+
const account = get(context, 'service.account', undefined);
|
|
11
|
+
const region = get(context, 'service.region', undefined);
|
|
12
|
+
const serviceInstanceName = get(context, 'serviceInstanceName', undefined);
|
|
13
|
+
const serviceKeyName = get(context, 'serviceKeyName', undefined);
|
|
14
|
+
return (
|
|
15
|
+
<ExecutionDetailsSection name={props.name} current={props.current}>
|
|
16
|
+
<div className="step-section-details">
|
|
17
|
+
<div className="row">
|
|
18
|
+
<div className="col-md-12">
|
|
19
|
+
<dl className="dl-horizontal">
|
|
20
|
+
<dt>Account</dt>
|
|
21
|
+
<dd>
|
|
22
|
+
<AccountTag account={account} />
|
|
23
|
+
</dd>
|
|
24
|
+
<dt>Region</dt>
|
|
25
|
+
<dd>
|
|
26
|
+
{region}
|
|
27
|
+
<br />
|
|
28
|
+
</dd>
|
|
29
|
+
<dt>Service Instance Name</dt>
|
|
30
|
+
<dd>
|
|
31
|
+
{serviceInstanceName}
|
|
32
|
+
<br />
|
|
33
|
+
</dd>
|
|
34
|
+
<dt>Service Key Name</dt>
|
|
35
|
+
<dd>
|
|
36
|
+
{serviceKeyName}
|
|
37
|
+
<br />
|
|
38
|
+
</dd>
|
|
39
|
+
</dl>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<StageFailureMessage stage={props.stage} message={props.stage.failureMessage} />
|
|
44
|
+
<StageExecutionLogs stage={props.stage} />
|
|
45
|
+
</ExecutionDetailsSection>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// eslint-disable-next-line
|
|
50
|
+
export namespace CloudFoundryServiceKeyExecutionDetails {
|
|
51
|
+
export const title = 'cloudfoundryServiceKeyConfig';
|
|
52
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './CloudFoundryAsgStageConfig';
|
|
2
|
+
export * from './CloudFoundryLoadBalancersExecutionDetails';
|
|
3
|
+
export * from './CloudFoundryLoadBalancersStageConfig';
|
|
4
|
+
export * from './CloudFoundryServiceExecutionDetails';
|
|
5
|
+
export * from './CloudFoundryServiceKeyExecutionDetails';
|
package/src/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.spec.tsx
ADDED
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import type { IScope } from 'angular';
|
|
2
|
+
import { mock, noop } from 'angular';
|
|
3
|
+
import { mount, shallow } from 'enzyme';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import type { Application, ApplicationDataSource, IMoniker, IServerGroup } from '@spinnaker/core';
|
|
7
|
+
import { ApplicationModelBuilder, REACT_MODULE } from '@spinnaker/core';
|
|
8
|
+
|
|
9
|
+
import type { IAccountRegionClusterSelectorProps } from './AccountRegionClusterSelector';
|
|
10
|
+
import { AccountRegionClusterSelector } from './AccountRegionClusterSelector';
|
|
11
|
+
|
|
12
|
+
describe('<AccountRegionClusterSelector />', () => {
|
|
13
|
+
let $scope: IScope;
|
|
14
|
+
let application: Application;
|
|
15
|
+
|
|
16
|
+
function createServerGroup(account: string, cluster: string, name: string, region: string): IServerGroup {
|
|
17
|
+
return {
|
|
18
|
+
account,
|
|
19
|
+
cloudProvider: 'cloud-provider',
|
|
20
|
+
cluster,
|
|
21
|
+
name,
|
|
22
|
+
region,
|
|
23
|
+
instances: [{ health: null, id: 'instance-id', launchTime: 0, name: 'instance-name', zone: 'GMT' }],
|
|
24
|
+
instanceCounts: { up: 1, down: 0, starting: 0, succeeded: 1, failed: 0, unknown: 0, outOfService: 0 },
|
|
25
|
+
moniker: { app: 'my-app', cluster, detail: 'my-detail', stack: 'my-stack', sequence: 1 },
|
|
26
|
+
} as IServerGroup;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
beforeEach(mock.module(REACT_MODULE));
|
|
30
|
+
beforeEach(
|
|
31
|
+
mock.inject(($rootScope: IScope) => {
|
|
32
|
+
$scope = $rootScope.$new();
|
|
33
|
+
application = ApplicationModelBuilder.createApplicationForTests('app', {
|
|
34
|
+
key: 'serverGroups',
|
|
35
|
+
loaded: true,
|
|
36
|
+
data: [
|
|
37
|
+
createServerGroup('account-name-one', 'app-stack-detailOne', 'app', 'region-one'),
|
|
38
|
+
createServerGroup('account-name-two', 'app-stack-detailTwo', 'app', 'region-two'),
|
|
39
|
+
createServerGroup('account-name-one', 'app-stack-detailOne', 'app', 'region-three'),
|
|
40
|
+
createServerGroup('account-name-one', 'app-stack-detailThree', 'app', 'region-one'),
|
|
41
|
+
createServerGroup('account-name-one', 'app-stack-detailFour', 'app', 'region-three'),
|
|
42
|
+
createServerGroup('account-name-one', 'app-stack-detailFive', 'app', 'region-two'),
|
|
43
|
+
],
|
|
44
|
+
defaultData: [] as IServerGroup[],
|
|
45
|
+
} as ApplicationDataSource<IServerGroup[]>);
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
it('initializes properly with provided component', () => {
|
|
50
|
+
const accountRegionClusterProps: IAccountRegionClusterSelectorProps = {
|
|
51
|
+
accounts: [
|
|
52
|
+
{
|
|
53
|
+
accountId: 'account-id-one',
|
|
54
|
+
name: 'account-name-one',
|
|
55
|
+
requiredGroupMembership: [],
|
|
56
|
+
type: 'account-type',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
application,
|
|
60
|
+
cloudProvider: 'cloud-provider',
|
|
61
|
+
onComponentUpdate: noop,
|
|
62
|
+
component: {
|
|
63
|
+
credentials: 'account-name-one',
|
|
64
|
+
regions: ['region-one'],
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const component = shallow<AccountRegionClusterSelector>(
|
|
69
|
+
<AccountRegionClusterSelector {...accountRegionClusterProps} />,
|
|
70
|
+
);
|
|
71
|
+
$scope.$digest();
|
|
72
|
+
|
|
73
|
+
expect(component.state().availableRegions.length).toBe(3, 'number of available regions does not match');
|
|
74
|
+
expect(component.state().availableRegions).toContain('region-one');
|
|
75
|
+
expect(component.state().availableRegions).toContain('region-two');
|
|
76
|
+
expect(component.state().availableRegions).toContain('region-three');
|
|
77
|
+
expect(component.state().clusters.length).toBe(2, 'number of clusters does not match');
|
|
78
|
+
expect(component.state().clusters).toContain('app-stack-detailOne');
|
|
79
|
+
expect(component.state().clusters).toContain('app-stack-detailThree');
|
|
80
|
+
expect(component.state().clusterField).toBe('cluster');
|
|
81
|
+
expect(component.state().componentName).toBe('');
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('retrieves the correct list of regions when account is changed', () => {
|
|
85
|
+
let credentials = '';
|
|
86
|
+
let region = 'SHOULD-CHANGE';
|
|
87
|
+
let regions = ['SHOULD-CHANGE'];
|
|
88
|
+
let cluster = 'SHOULD-CHANGE';
|
|
89
|
+
const accountRegionClusterProps: IAccountRegionClusterSelectorProps = {
|
|
90
|
+
accounts: [
|
|
91
|
+
{
|
|
92
|
+
accountId: 'account-id-two',
|
|
93
|
+
name: 'account-name-two',
|
|
94
|
+
requiredGroupMembership: [],
|
|
95
|
+
type: 'account-type',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
accountId: 'account-id-one',
|
|
99
|
+
name: 'account-name-one',
|
|
100
|
+
requiredGroupMembership: [],
|
|
101
|
+
type: 'account-type',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
application,
|
|
105
|
+
cloudProvider: 'cloud-provider',
|
|
106
|
+
onComponentUpdate: (value: any) => {
|
|
107
|
+
credentials = value.credentials;
|
|
108
|
+
region = value.region;
|
|
109
|
+
regions = value.regions;
|
|
110
|
+
cluster = value.cluster;
|
|
111
|
+
},
|
|
112
|
+
component: {
|
|
113
|
+
credentials: 'account-name-one',
|
|
114
|
+
regions: ['region-one'],
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const component = mount<AccountRegionClusterSelector>(
|
|
119
|
+
<AccountRegionClusterSelector {...accountRegionClusterProps} />,
|
|
120
|
+
);
|
|
121
|
+
$scope.$digest();
|
|
122
|
+
|
|
123
|
+
expect(component.state().availableRegions.length).toBe(3, 'number of available regions does not match');
|
|
124
|
+
expect(component.state().availableRegions).toContain('region-one');
|
|
125
|
+
expect(component.state().availableRegions).toContain('region-two');
|
|
126
|
+
expect(component.state().availableRegions).toContain('region-three');
|
|
127
|
+
expect(component.state().clusters.length).toBe(2, 'number of clusters does not match');
|
|
128
|
+
expect(component.state().clusters).toContain('app-stack-detailOne');
|
|
129
|
+
expect(component.state().clusters).toContain('app-stack-detailThree');
|
|
130
|
+
|
|
131
|
+
const accountSelectComponent = component.find('Select[name="credentials"] .Select-control input');
|
|
132
|
+
accountSelectComponent.simulate('mouseDown');
|
|
133
|
+
accountSelectComponent.simulate('change', { target: { value: 'account-name-two' } });
|
|
134
|
+
accountSelectComponent.simulate('keyDown', { keyCode: 9, key: 'Tab' });
|
|
135
|
+
$scope.$digest();
|
|
136
|
+
|
|
137
|
+
expect(component.state().availableRegions.length).toBe(1, 'number of available regions does not match');
|
|
138
|
+
expect(component.state().availableRegions).toContain('region-two');
|
|
139
|
+
expect(component.state().clusters.length).toBe(0, 'number of clusters does not match');
|
|
140
|
+
expect(region).toEqual('', 'selected region is not cleared');
|
|
141
|
+
expect(regions.length).toBe(0, 'selected regions list is not cleared');
|
|
142
|
+
expect(credentials).toContain('account-name-two');
|
|
143
|
+
expect(cluster).toBeUndefined('selected cluster is not cleared');
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('retrieves the correct list of clusters when the selector is multi-region and the region is changed', () => {
|
|
147
|
+
let regions: string[] = [];
|
|
148
|
+
let cluster = 'SHOULD-CHANGE';
|
|
149
|
+
const accountRegionClusterProps: IAccountRegionClusterSelectorProps = {
|
|
150
|
+
accounts: [
|
|
151
|
+
{
|
|
152
|
+
accountId: 'account-id-two',
|
|
153
|
+
name: 'account-name-two',
|
|
154
|
+
requiredGroupMembership: [],
|
|
155
|
+
type: 'account-type',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
accountId: 'account-id-one',
|
|
159
|
+
name: 'account-name-one',
|
|
160
|
+
requiredGroupMembership: [],
|
|
161
|
+
type: 'account-type',
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
application,
|
|
165
|
+
cloudProvider: 'cloud-provider',
|
|
166
|
+
clusterField: 'newCluster',
|
|
167
|
+
onComponentUpdate: (value: any) => {
|
|
168
|
+
regions = value.regions;
|
|
169
|
+
cluster = value.newCluster;
|
|
170
|
+
},
|
|
171
|
+
component: {
|
|
172
|
+
credentials: 'account-name-one',
|
|
173
|
+
regions: ['region-one'],
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const component = mount<AccountRegionClusterSelector>(
|
|
178
|
+
<AccountRegionClusterSelector {...accountRegionClusterProps} />,
|
|
179
|
+
);
|
|
180
|
+
$scope.$digest();
|
|
181
|
+
|
|
182
|
+
expect(component.state().availableRegions.length).toBe(3, 'number of available regions does not match');
|
|
183
|
+
expect(component.state().availableRegions).toContain('region-one');
|
|
184
|
+
expect(component.state().availableRegions).toContain('region-two');
|
|
185
|
+
expect(component.state().availableRegions).toContain('region-three');
|
|
186
|
+
expect(component.state().clusters.length).toBe(2, 'number of clusters does not match');
|
|
187
|
+
expect(component.state().clusters).toContain('app-stack-detailOne');
|
|
188
|
+
expect(component.state().clusters).toContain('app-stack-detailThree');
|
|
189
|
+
|
|
190
|
+
const accountSelectComponent = component.find('Select[name="regions"] .Select-control input');
|
|
191
|
+
accountSelectComponent.simulate('mouseDown');
|
|
192
|
+
accountSelectComponent.simulate('change', { target: { value: 'region-three' } });
|
|
193
|
+
accountSelectComponent.simulate('keyDown', { keyCode: 9, key: 'Tab' });
|
|
194
|
+
$scope.$digest();
|
|
195
|
+
|
|
196
|
+
expect(component.state().clusters.length).toBe(3, 'number of clusters does not match');
|
|
197
|
+
expect(component.state().clusters).toContain('app-stack-detailOne');
|
|
198
|
+
expect(component.state().clusters).toContain('app-stack-detailThree');
|
|
199
|
+
expect(component.state().clusters).toContain('app-stack-detailFour');
|
|
200
|
+
expect(cluster).toBeUndefined('selected cluster is not cleared');
|
|
201
|
+
expect(regions.length).toBe(2);
|
|
202
|
+
expect(regions).toContain('region-one');
|
|
203
|
+
expect(regions).toContain('region-three');
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('retrieves the correct list of clusters on startup and the selector is single-region', () => {
|
|
207
|
+
const accountRegionClusterProps: IAccountRegionClusterSelectorProps = {
|
|
208
|
+
accounts: [
|
|
209
|
+
{
|
|
210
|
+
accountId: 'account-id-two',
|
|
211
|
+
name: 'account-name-two',
|
|
212
|
+
requiredGroupMembership: [],
|
|
213
|
+
type: 'account-type',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
accountId: 'account-id-one',
|
|
217
|
+
name: 'account-name-one',
|
|
218
|
+
requiredGroupMembership: [],
|
|
219
|
+
type: 'account-type',
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
application,
|
|
223
|
+
cloudProvider: 'cloud-provider',
|
|
224
|
+
onComponentUpdate: (_value: any) => {},
|
|
225
|
+
component: {
|
|
226
|
+
cluster: 'app-stack-detailOne',
|
|
227
|
+
credentials: 'account-name-one',
|
|
228
|
+
region: 'region-one',
|
|
229
|
+
},
|
|
230
|
+
isSingleRegion: true,
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const component = mount<AccountRegionClusterSelector>(
|
|
234
|
+
<AccountRegionClusterSelector {...accountRegionClusterProps} />,
|
|
235
|
+
);
|
|
236
|
+
$scope.$digest();
|
|
237
|
+
|
|
238
|
+
expect(component.state().availableRegions.length).toBe(3, 'number of available regions does not match');
|
|
239
|
+
expect(component.state().availableRegions).toContain('region-one');
|
|
240
|
+
expect(component.state().availableRegions).toContain('region-two');
|
|
241
|
+
expect(component.state().availableRegions).toContain('region-three');
|
|
242
|
+
expect(component.state().clusters.length).toBe(2, 'number of clusters does not match');
|
|
243
|
+
expect(component.state().clusters).toContain('app-stack-detailOne');
|
|
244
|
+
expect(component.state().clusters).toContain('app-stack-detailThree');
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
it('the cluster value is updated in the component when cluster is changed', () => {
|
|
248
|
+
let cluster = '';
|
|
249
|
+
let moniker: IMoniker = { app: '' };
|
|
250
|
+
const accountRegionClusterProps: IAccountRegionClusterSelectorProps = {
|
|
251
|
+
accounts: [
|
|
252
|
+
{
|
|
253
|
+
accountId: 'account-id-two',
|
|
254
|
+
name: 'account-name-two',
|
|
255
|
+
requiredGroupMembership: [],
|
|
256
|
+
type: 'account-type',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
accountId: 'account-id-one',
|
|
260
|
+
name: 'account-name-one',
|
|
261
|
+
requiredGroupMembership: [],
|
|
262
|
+
type: 'account-type',
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
application,
|
|
266
|
+
cloudProvider: 'cloud-provider',
|
|
267
|
+
clusterField: 'newCluster',
|
|
268
|
+
onComponentUpdate: (value: any) => {
|
|
269
|
+
cluster = value.newCluster;
|
|
270
|
+
moniker = value.moniker;
|
|
271
|
+
},
|
|
272
|
+
component: {
|
|
273
|
+
cluster: 'app-stack-detailOne',
|
|
274
|
+
credentials: 'account-name-one',
|
|
275
|
+
regions: ['region-one'],
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
const expectedMoniker = {
|
|
280
|
+
app: 'my-app',
|
|
281
|
+
cluster: 'app-stack-detailThree',
|
|
282
|
+
detail: 'my-detail',
|
|
283
|
+
stack: 'my-stack',
|
|
284
|
+
sequence: null,
|
|
285
|
+
} as IMoniker;
|
|
286
|
+
|
|
287
|
+
const component = mount<AccountRegionClusterSelector>(
|
|
288
|
+
<AccountRegionClusterSelector {...accountRegionClusterProps} />,
|
|
289
|
+
);
|
|
290
|
+
$scope.$digest();
|
|
291
|
+
|
|
292
|
+
expect(component.state().availableRegions.length).toBe(3, 'number of available regions does not match');
|
|
293
|
+
expect(component.state().availableRegions).toContain('region-one');
|
|
294
|
+
expect(component.state().availableRegions).toContain('region-two');
|
|
295
|
+
expect(component.state().availableRegions).toContain('region-three');
|
|
296
|
+
expect(component.state().clusters.length).toBe(2, 'number of clusters does not match');
|
|
297
|
+
expect(component.state().clusters).toContain('app-stack-detailOne');
|
|
298
|
+
expect(component.state().clusters).toContain('app-stack-detailThree');
|
|
299
|
+
|
|
300
|
+
const clusterSelectComponent = component.find('Select[name="newCluster"] .Select-control input');
|
|
301
|
+
clusterSelectComponent.simulate('mouseDown');
|
|
302
|
+
clusterSelectComponent.simulate('change', { target: { value: 'app-stack-detailThree' } });
|
|
303
|
+
clusterSelectComponent.simulate('keyDown', { keyCode: 9, key: 'Tab' });
|
|
304
|
+
$scope.$digest();
|
|
305
|
+
|
|
306
|
+
expect(cluster).toBe('app-stack-detailThree');
|
|
307
|
+
expect(moniker).toEqual(expectedMoniker);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it('the cluster value is updated in the component when cluster is changed to freeform value', () => {
|
|
311
|
+
let cluster = '';
|
|
312
|
+
let moniker: IMoniker = { app: '' };
|
|
313
|
+
const accountRegionClusterProps: IAccountRegionClusterSelectorProps = {
|
|
314
|
+
accounts: [
|
|
315
|
+
{
|
|
316
|
+
accountId: 'account-id-two',
|
|
317
|
+
name: 'account-name-two',
|
|
318
|
+
requiredGroupMembership: [],
|
|
319
|
+
type: 'account-type',
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
accountId: 'account-id-one',
|
|
323
|
+
name: 'account-name-one',
|
|
324
|
+
requiredGroupMembership: [],
|
|
325
|
+
type: 'account-type',
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
application,
|
|
329
|
+
cloudProvider: 'cloud-provider',
|
|
330
|
+
clusterField: 'newCluster',
|
|
331
|
+
onComponentUpdate: (value: any) => {
|
|
332
|
+
cluster = value.newCluster;
|
|
333
|
+
moniker = value.moniker;
|
|
334
|
+
},
|
|
335
|
+
component: {
|
|
336
|
+
cluster: 'app-stack-detailOne',
|
|
337
|
+
credentials: 'account-name-one',
|
|
338
|
+
regions: ['region-one'],
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
const component = mount<AccountRegionClusterSelector>(
|
|
343
|
+
<AccountRegionClusterSelector {...accountRegionClusterProps} />,
|
|
344
|
+
);
|
|
345
|
+
$scope.$digest();
|
|
346
|
+
|
|
347
|
+
const clusterSelectComponent = component.find('Select[name="newCluster"] .Select-control input');
|
|
348
|
+
clusterSelectComponent.simulate('mouseDown');
|
|
349
|
+
clusterSelectComponent.simulate('change', { target: { value: 'app-stack-freeform' } });
|
|
350
|
+
clusterSelectComponent.simulate('keyDown', { keyCode: 9, key: 'Tab' });
|
|
351
|
+
$scope.$digest();
|
|
352
|
+
|
|
353
|
+
expect(cluster).toBe('app-stack-freeform');
|
|
354
|
+
expect(moniker).toBeUndefined();
|
|
355
|
+
expect(component.state().clusters).toContain('app-stack-freeform');
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
it('initialize with form names', () => {
|
|
359
|
+
const accountRegionClusterProps: IAccountRegionClusterSelectorProps = {
|
|
360
|
+
accounts: [
|
|
361
|
+
{
|
|
362
|
+
accountId: 'account-id-one',
|
|
363
|
+
name: 'account-name-one',
|
|
364
|
+
requiredGroupMembership: [],
|
|
365
|
+
type: 'account-type',
|
|
366
|
+
},
|
|
367
|
+
],
|
|
368
|
+
application,
|
|
369
|
+
cloudProvider: 'cloud-provider',
|
|
370
|
+
onComponentUpdate: noop,
|
|
371
|
+
componentName: 'form',
|
|
372
|
+
component: {
|
|
373
|
+
credentials: 'account-name-one',
|
|
374
|
+
regions: ['region-one'],
|
|
375
|
+
},
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
const component = shallow(<AccountRegionClusterSelector {...accountRegionClusterProps} />);
|
|
379
|
+
$scope.$digest();
|
|
380
|
+
|
|
381
|
+
expect(component.find('Select[name="form.credentials"]').length).toBe(1, 'select for account not found');
|
|
382
|
+
expect(component.find('Select[name="form.regions"]').length).toBe(1, 'select for regions not found');
|
|
383
|
+
expect(component.find('StageConfigField [name="form.cluster"]').length).toBe(1, 'select for cluster not found');
|
|
384
|
+
});
|
|
385
|
+
});
|
package/src/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.tsx
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { first, isNil, uniq } from 'lodash';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { Option } from 'react-select';
|
|
4
|
+
import Select, { Creatable } from 'react-select';
|
|
5
|
+
import { from as observableFrom, Subject } from 'rxjs';
|
|
6
|
+
import { takeUntil } from 'rxjs/operators';
|
|
7
|
+
|
|
8
|
+
import type { Application, IAccount, IMoniker, IServerGroup, IServerGroupFilter } from '@spinnaker/core';
|
|
9
|
+
import { AppListExtractor, StageConfigField } from '@spinnaker/core';
|
|
10
|
+
|
|
11
|
+
export interface IAccountRegionClusterSelectorProps {
|
|
12
|
+
accounts: IAccount[];
|
|
13
|
+
application: Application;
|
|
14
|
+
cloudProvider: string;
|
|
15
|
+
clusterField?: string;
|
|
16
|
+
component: any;
|
|
17
|
+
componentName?: string;
|
|
18
|
+
isSingleRegion?: boolean;
|
|
19
|
+
onComponentUpdate?: (component: any) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface IAccountRegionClusterSelectorState {
|
|
23
|
+
[k: string]: any;
|
|
24
|
+
|
|
25
|
+
availableRegions: string[];
|
|
26
|
+
clusterField: string;
|
|
27
|
+
clusters: string[];
|
|
28
|
+
componentName: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class AccountRegionClusterSelector extends React.Component<
|
|
32
|
+
IAccountRegionClusterSelectorProps,
|
|
33
|
+
IAccountRegionClusterSelectorState
|
|
34
|
+
> {
|
|
35
|
+
private destroy$ = new Subject();
|
|
36
|
+
|
|
37
|
+
constructor(props: IAccountRegionClusterSelectorProps) {
|
|
38
|
+
super(props);
|
|
39
|
+
const clusterField = props.clusterField || 'cluster';
|
|
40
|
+
this.state = {
|
|
41
|
+
availableRegions: [],
|
|
42
|
+
cloudProvider: props.cloudProvider,
|
|
43
|
+
clusterField: clusterField,
|
|
44
|
+
clusters: [],
|
|
45
|
+
componentName: props.componentName || '',
|
|
46
|
+
[clusterField]: props.component[clusterField],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public componentDidMount(): void {
|
|
51
|
+
this.setRegionList(this.props.component.credentials);
|
|
52
|
+
this.setClusterList(
|
|
53
|
+
this.props.component.credentials,
|
|
54
|
+
this.props.isSingleRegion ? [this.props.component.region] : this.props.component.regions,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public componentWillUnmount(): void {
|
|
59
|
+
this.destroy$.next();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private setRegionList = (credentials: string): void => {
|
|
63
|
+
const { application } = this.props;
|
|
64
|
+
const accountFilter: IServerGroupFilter = (serverGroup: IServerGroup) =>
|
|
65
|
+
serverGroup ? serverGroup.account === credentials : true;
|
|
66
|
+
observableFrom(application.ready())
|
|
67
|
+
.pipe(takeUntil(this.destroy$))
|
|
68
|
+
.subscribe(() => {
|
|
69
|
+
const availableRegions = AppListExtractor.getRegions([application], accountFilter);
|
|
70
|
+
availableRegions.sort();
|
|
71
|
+
this.setState({ availableRegions });
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
private setClusterList = (credentials: string, regions: string[]): void => {
|
|
76
|
+
const { application } = this.props;
|
|
77
|
+
observableFrom(application.ready())
|
|
78
|
+
.pipe(takeUntil(this.destroy$))
|
|
79
|
+
.subscribe(() => {
|
|
80
|
+
const clusterFilter = AppListExtractor.clusterFilterForCredentialsAndRegion(credentials, regions);
|
|
81
|
+
const clusters = AppListExtractor.getClusters([application], clusterFilter);
|
|
82
|
+
|
|
83
|
+
const clusterField = this.props.component[this.state.clusterField];
|
|
84
|
+
if (clusterField && !clusters.includes(clusterField)) {
|
|
85
|
+
clusters.push(clusterField);
|
|
86
|
+
}
|
|
87
|
+
this.setState({ clusters });
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
public onAccountUpdate = (option: Option<string>): void => {
|
|
92
|
+
const credentials = option.value;
|
|
93
|
+
this.setRegionList(credentials);
|
|
94
|
+
this.setClusterList(credentials, []);
|
|
95
|
+
this.props.onComponentUpdate &&
|
|
96
|
+
this.props.onComponentUpdate({
|
|
97
|
+
...this.props.component,
|
|
98
|
+
credentials,
|
|
99
|
+
region: '',
|
|
100
|
+
regions: [],
|
|
101
|
+
[this.state.clusterField]: undefined,
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
public onRegionsUpdate = (option: Option<string>): void => {
|
|
106
|
+
const regions = option.map((o: Option) => o.value);
|
|
107
|
+
this.setClusterList(this.props.component.credentials, regions);
|
|
108
|
+
this.props.onComponentUpdate &&
|
|
109
|
+
this.props.onComponentUpdate({
|
|
110
|
+
...this.props.component,
|
|
111
|
+
regions,
|
|
112
|
+
[this.state.clusterField]: undefined,
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
public onRegionUpdate = (option: Option<string>): void => {
|
|
117
|
+
const region = option.value;
|
|
118
|
+
this.setClusterList(this.props.component.credentials, [region]);
|
|
119
|
+
this.props.onComponentUpdate &&
|
|
120
|
+
this.props.onComponentUpdate({
|
|
121
|
+
...this.props.component,
|
|
122
|
+
region,
|
|
123
|
+
[this.state.clusterField]: undefined,
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
public onClusterUpdate = (option: Option<string>): void => {
|
|
128
|
+
const clusterName = option.value;
|
|
129
|
+
const filterByCluster = AppListExtractor.monikerClusterNameFilter(clusterName);
|
|
130
|
+
const clusterMoniker = first(uniq(AppListExtractor.getMonikers([this.props.application], filterByCluster)));
|
|
131
|
+
let moniker: IMoniker;
|
|
132
|
+
|
|
133
|
+
if (isNil(clusterMoniker)) {
|
|
134
|
+
// remove the moniker from the stage if one doesn't exist.
|
|
135
|
+
moniker = undefined;
|
|
136
|
+
} else {
|
|
137
|
+
// clusters don't contain sequences, so null it out.
|
|
138
|
+
clusterMoniker.sequence = null;
|
|
139
|
+
moniker = clusterMoniker;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (option.className) {
|
|
143
|
+
const clusters = this.state.clusters;
|
|
144
|
+
clusters.push(clusterName);
|
|
145
|
+
this.setState(clusters);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
this.props.onComponentUpdate &&
|
|
149
|
+
this.props.onComponentUpdate({
|
|
150
|
+
...this.props.component,
|
|
151
|
+
[this.state.clusterField]: clusterName,
|
|
152
|
+
moniker,
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
public render() {
|
|
157
|
+
const { accounts, isSingleRegion, component } = this.props;
|
|
158
|
+
const { availableRegions, clusters, clusterField, componentName } = this.state;
|
|
159
|
+
return (
|
|
160
|
+
<>
|
|
161
|
+
<StageConfigField label="Account">
|
|
162
|
+
<Select
|
|
163
|
+
name={componentName ? `${componentName}.credentials` : 'credentials'}
|
|
164
|
+
options={
|
|
165
|
+
accounts &&
|
|
166
|
+
accounts.map((acc: IAccount) => ({
|
|
167
|
+
label: acc.name,
|
|
168
|
+
value: acc.name,
|
|
169
|
+
}))
|
|
170
|
+
}
|
|
171
|
+
clearable={false}
|
|
172
|
+
value={component.credentials}
|
|
173
|
+
onChange={this.onAccountUpdate}
|
|
174
|
+
/>
|
|
175
|
+
</StageConfigField>
|
|
176
|
+
|
|
177
|
+
{!isSingleRegion && (
|
|
178
|
+
<StageConfigField label="Region">
|
|
179
|
+
<Select
|
|
180
|
+
name={componentName ? `${componentName}.regions` : 'regions'}
|
|
181
|
+
options={
|
|
182
|
+
availableRegions &&
|
|
183
|
+
availableRegions.map((r: string) => ({
|
|
184
|
+
label: r,
|
|
185
|
+
value: r,
|
|
186
|
+
}))
|
|
187
|
+
}
|
|
188
|
+
multi={true}
|
|
189
|
+
clearable={false}
|
|
190
|
+
value={component.regions}
|
|
191
|
+
onChange={this.onRegionsUpdate}
|
|
192
|
+
/>
|
|
193
|
+
</StageConfigField>
|
|
194
|
+
)}
|
|
195
|
+
{isSingleRegion && (
|
|
196
|
+
<StageConfigField label="Region">
|
|
197
|
+
<Select
|
|
198
|
+
name={componentName ? `${componentName}.region` : 'region'}
|
|
199
|
+
options={
|
|
200
|
+
availableRegions &&
|
|
201
|
+
availableRegions.map((r: string) => ({
|
|
202
|
+
label: r,
|
|
203
|
+
value: r,
|
|
204
|
+
}))
|
|
205
|
+
}
|
|
206
|
+
multi={false}
|
|
207
|
+
clearable={false}
|
|
208
|
+
value={component.region}
|
|
209
|
+
onChange={this.onRegionUpdate}
|
|
210
|
+
/>
|
|
211
|
+
</StageConfigField>
|
|
212
|
+
)}
|
|
213
|
+
<StageConfigField label="Cluster" helpKey={'pipeline.config.findAmi.cluster'}>
|
|
214
|
+
<Creatable
|
|
215
|
+
name={componentName ? `${componentName}.${clusterField}` : `${clusterField}`}
|
|
216
|
+
options={
|
|
217
|
+
clusters &&
|
|
218
|
+
clusters.map((c: string) => ({
|
|
219
|
+
label: c,
|
|
220
|
+
value: c,
|
|
221
|
+
}))
|
|
222
|
+
}
|
|
223
|
+
clearable={false}
|
|
224
|
+
value={component[clusterField]}
|
|
225
|
+
onChange={this.onClusterUpdate}
|
|
226
|
+
/>
|
|
227
|
+
</StageConfigField>
|
|
228
|
+
</>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
}
|