@spinnaker/amazon 2025.0.6 → 2025.1.0

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.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { IAmazonHealth } from '../../domain';
3
- export declare type MetricTypes = 'LoadBalancer' | 'TargetGroup';
3
+ export type MetricTypes = 'LoadBalancer' | 'TargetGroup';
4
4
  export interface CustomHealthLink {
5
5
  type: string;
6
6
  href: string;
@@ -1,7 +1,7 @@
1
1
  import type { Application, CacheInitializerService, ISecurityGroup, IServerGroupCommand, IServerGroupCommandBackingData, IServerGroupCommandBackingDataFiltered, IServerGroupCommandDirty, IServerGroupCommandResult, IServerGroupCommandViewState, LoadBalancerReader, SecurityGroupReader, ServerGroupCommandRegistry } from '@spinnaker/core';
2
2
  import type { IAmazonLoadBalancerSourceData, IKeyPair, IScalingProcess } from '../../domain';
3
3
  import type { IAmazonInstanceType } from '../../instance/awsInstanceType.service';
4
- export declare type IBlockDeviceMappingSource = 'source' | 'ami' | 'default';
4
+ export type IBlockDeviceMappingSource = 'source' | 'ami' | 'default';
5
5
  export interface IAmazonServerGroupCommandDirty extends IServerGroupCommandDirty {
6
6
  targetGroups?: string[];
7
7
  launchTemplateOverridesForInstanceType?: IAmazonInstanceTypeOverride[];
@@ -5,7 +5,7 @@ interface IDateSeriesTuple {
5
5
  x: Date;
6
6
  y: number;
7
7
  }
8
- export declare type IDateLine = ChartDataset<'line', IDateSeriesTuple[]>;
8
+ export type IDateLine = ChartDataset<'line', IDateSeriesTuple[]>;
9
9
  export interface IDateLineChartProps {
10
10
  lines: IDateLine[];
11
11
  style?: object;
@@ -3,7 +3,7 @@ import type { Application } from '@spinnaker/core';
3
3
  import type { ITargetTrackingPolicyCommand } from '../ScalingPolicyWriter';
4
4
  import type { IAmazonServerGroup } from '../../../../domain';
5
5
  import './TargetMetricFields.less';
6
- export declare type MetricType = 'custom' | 'predefined';
6
+ export type MetricType = 'custom' | 'predefined';
7
7
  export interface ITargetMetricFieldsProps {
8
8
  allowDualMode?: boolean;
9
9
  cloudwatch?: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { ISimplePolicyDescription, IStepPolicyDescription, IUpsertAlarmDescription, IUpsertScalingPolicyCommand } from '../ScalingPolicyWriter';
2
2
  import type { IAmazonServerGroup, IScalingPolicy, ITargetTrackingPolicy } from '../../../../domain';
3
- declare type PolicyType = 'Step' | 'TargetTracking';
3
+ type PolicyType = 'Step' | 'TargetTracking';
4
4
  export declare const ScalingPolicyCommandBuilder: {
5
5
  buildAlarm: (policy: IScalingPolicy, region: string, asgName: string) => IUpsertAlarmDescription;
6
6
  buildStepPolicy: (policy: IScalingPolicy, threshold: number, cooldown: number) => IStepPolicyDescription;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import './SimplePolicyAction.less';
3
- declare type Operator = 'Add' | 'Remove' | 'Set to';
4
- declare type AdjustmentTypeView = 'instances' | 'percent of group';
3
+ type Operator = 'Add' | 'Remove' | 'Set to';
4
+ type AdjustmentTypeView = 'instances' | 'percent of group';
5
5
  export interface ISimplePolicyActionProps {
6
6
  adjustmentType: AdjustmentTypeView;
7
7
  adjustmentTypeChanged: (action: Operator, type: AdjustmentTypeView) => void;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import type { IScalingPolicyAlarm, IStepAdjustment } from '../../../../../domain';
3
3
  import './StepPolicyAction.less';
4
- export declare type Operator = 'Add' | 'Remove' | 'Set to';
5
- export declare type AdjustmentTypeView = 'instances' | 'percent of group';
4
+ export type Operator = 'Add' | 'Remove' | 'Set to';
5
+ export type AdjustmentTypeView = 'instances' | 'percent of group';
6
6
  export interface IStepPolicyActionProps {
7
7
  adjustmentType: AdjustmentTypeView;
8
8
  adjustmentTypeChanged: (action: Operator, type: AdjustmentTypeView) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spinnaker/amazon",
3
3
  "license": "Apache-2.0",
4
- "version": "2025.0.6",
4
+ "version": "2025.1.0",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "publishConfig": {
@@ -57,7 +57,7 @@
57
57
  "@types/react-sortable-hoc": "0.6.2",
58
58
  "@types/react-virtualized-select": "3.0.8",
59
59
  "shx": "0.3.3",
60
- "typescript": "4.3.5"
60
+ "typescript": "5.0.4"
61
61
  },
62
- "gitHead": "9f1607115a075e95b75864f2304adb6c67157e86"
62
+ "gitHead": "ed6c0f8929f68fcb6295c4d56c4bfbdec8d21ce6"
63
63
  }
@@ -3,6 +3,7 @@ import { Field } from 'formik';
3
3
  import React from 'react';
4
4
 
5
5
  import type { IServerGroupCommand, IWizardPageComponent } from '@spinnaker/core';
6
+ import { parseNum } from '@spinnaker/core';
6
7
 
7
8
  import { CapacitySelector } from '../capacity/CapacitySelector';
8
9
  import { MinMaxDesired } from '../capacity/MinMaxDesired';
@@ -18,7 +19,11 @@ export class ServerGroupCapacity
18
19
  public validate(values: IServerGroupCommand): { [key: string]: string } {
19
20
  const errors: { [key: string]: string } = {};
20
21
 
21
- if (values.capacity.min < 0 || values.capacity.max < 0 || values.capacity.desired < 0) {
22
+ if (
23
+ parseNum(values.capacity.min) < 0 ||
24
+ parseNum(values.capacity.max) < 0 ||
25
+ parseNum(values.capacity.desired) < 0
26
+ ) {
22
27
  errors.capacity = 'Capacity min, max, and desired all have to be non-negative values.';
23
28
  }
24
29
 
@@ -4,6 +4,7 @@ import React from 'react';
4
4
  import { Subject } from 'rxjs';
5
5
 
6
6
  import type { IWizardPageComponent } from '@spinnaker/core';
7
+ import { parseNum } from '@spinnaker/core';
7
8
 
8
9
  import type { IAmazonInstanceTypeCategory } from '../../../../instance/awsInstanceType.service';
9
10
  import { InstanceTypeSelector } from '../instanceType/InstanceTypeSelector';
@@ -86,7 +87,7 @@ export class ServerGroupInstanceType
86
87
  errors.onDemandBaseCapacity = 'On-Demand base capacity must be non-negative.';
87
88
  }
88
89
 
89
- if (values.onDemandBaseCapacity > values.capacity.max) {
90
+ if (values.onDemandBaseCapacity > parseNum(values.capacity.max)) {
90
91
  errors.onDemandBaseCapacity = 'On-Demand base capacity must be less than or equal to max capacity.';
91
92
  }
92
93