@spinnaker/tencentcloud 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 +751 -0
- package/LICENSE.txt +203 -0
- package/dist/domain/IKeyPair.d.ts +8 -0
- package/dist/domain/IScalingPolicy.d.ts +44 -0
- package/dist/domain/IScalingProcess.d.ts +10 -0
- package/dist/domain/ITargetTrackingPolicy.d.ts +21 -0
- package/dist/domain/ITencentcloudCertificate.d.ts +5 -0
- package/dist/domain/ITencentcloudHealth.d.ts +18 -0
- package/dist/domain/ITencentcloudInstance.d.ts +4 -0
- package/dist/domain/ITencentcloudLoadBalancer.d.ts +278 -0
- package/dist/domain/ITencentcloudLoadBalancerSourceData.d.ts +171 -0
- package/dist/domain/ITencentcloudScalingPolicy.d.ts +19 -0
- package/dist/domain/ITencentcloudServerGroup.d.ts +43 -0
- package/dist/domain/index.d.ts +11 -0
- package/dist/help/tencentcloud.help.d.ts +1 -0
- package/dist/image/image.reader.d.ts +35 -0
- package/dist/image/index.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +553 -0
- package/dist/index.js.map +1 -0
- package/dist/keyPairs/KeyPairsReader.d.ts +4 -0
- package/dist/keyPairs/index.d.ts +1 -0
- package/dist/pipeline/stages/disableCluster/DisableClusterConfig.d.ts +3 -0
- package/dist/pipeline/stages/disableCluster/DisableClusterStageForm.d.ts +3 -0
- package/dist/pipeline/stages/disableCluster/disableClusterStage.d.ts +1 -0
- package/dist/pipeline/stages/disableCluster/disableClusterValidators.d.ts +2 -0
- package/dist/pipeline/stages/rollbackCluster/RollbackClusterConfig.d.ts +3 -0
- package/dist/pipeline/stages/rollbackCluster/RollbackClusterStageForm.d.ts +3 -0
- package/dist/pipeline/stages/rollbackCluster/rollbackClusterStage.d.ts +1 -0
- package/dist/pipeline/stages/rollbackCluster/rollbackClusterValidators.d.ts +2 -0
- package/dist/pipeline/stages/scaleDownCluster/ScaleDownClusterConfig.d.ts +3 -0
- package/dist/pipeline/stages/scaleDownCluster/ScaleDownClusterStageForm.d.ts +3 -0
- package/dist/pipeline/stages/scaleDownCluster/scaleDownClusterStage.d.ts +1 -0
- package/dist/pipeline/stages/scaleDownCluster/scaledownClusterValidators.d.ts +2 -0
- package/dist/pipeline/stages/shrinkCluster/ShrinkClusterConfig.d.ts +3 -0
- package/dist/pipeline/stages/shrinkCluster/ShrinkClusterStageForm.d.ts +3 -0
- package/dist/pipeline/stages/shrinkCluster/shrinkClusterStage.d.ts +1 -0
- package/dist/pipeline/stages/shrinkCluster/shrinkClusterValidators.d.ts +2 -0
- package/dist/reactShims/index.d.ts +2 -0
- package/dist/reactShims/tencentcloud.ngReact.d.ts +8 -0
- package/dist/reactShims/tencentcloud.react.injector.d.ts +7 -0
- package/dist/reactShims/tencentcloud.react.module.d.ts +1 -0
- package/dist/search/searchResultFormatter.d.ts +1 -0
- package/dist/tencentcloud.module.d.ts +7 -0
- package/dist/tencentcloud.settings.d.ts +26 -0
- package/dist/validation/ApplicationNameValidator.d.ts +1 -0
- package/package.json +37 -0
- package/src/domain/IKeyPair.ts +8 -0
- package/src/domain/IScalingPolicy.ts +84 -0
- package/src/domain/IScalingProcess.ts +11 -0
- package/src/domain/ITargetTrackingPolicy.ts +26 -0
- package/src/domain/ITencentcloudCertificate.ts +6 -0
- package/src/domain/ITencentcloudHealth.ts +21 -0
- package/src/domain/ITencentcloudInstance.ts +5 -0
- package/src/domain/ITencentcloudLoadBalancer.ts +326 -0
- package/src/domain/ITencentcloudLoadBalancerSourceData.ts +189 -0
- package/src/domain/ITencentcloudScalingPolicy.ts +23 -0
- package/src/domain/ITencentcloudServerGroup.ts +46 -0
- package/src/domain/index.ts +11 -0
- package/src/help/tencentcloud.help.ts +5 -0
- package/src/image/image.reader.ts +53 -0
- package/src/image/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/keyPairs/KeyPairsReader.ts +11 -0
- package/src/keyPairs/index.ts +1 -0
- package/src/logo/tencentcloud.icon.svg +24 -0
- package/src/logo/tencentcloud.logo.less +5 -0
- package/src/logo/tencentcloud.logo.svg +53 -0
- package/src/pipeline/stages/disableCluster/DisableClusterConfig.tsx +27 -0
- package/src/pipeline/stages/disableCluster/DisableClusterStageForm.tsx +87 -0
- package/src/pipeline/stages/disableCluster/disableClusterStage.ts +12 -0
- package/src/pipeline/stages/disableCluster/disableClusterValidators.ts +10 -0
- package/src/pipeline/stages/rollbackCluster/RollbackClusterConfig.tsx +27 -0
- package/src/pipeline/stages/rollbackCluster/RollbackClusterStageForm.tsx +74 -0
- package/src/pipeline/stages/rollbackCluster/rollbackClusterStage.ts +12 -0
- package/src/pipeline/stages/rollbackCluster/rollbackClusterValidators.ts +10 -0
- package/src/pipeline/stages/scaleDownCluster/ScaleDownClusterConfig.tsx +27 -0
- package/src/pipeline/stages/scaleDownCluster/ScaleDownClusterStageForm.tsx +102 -0
- package/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.ts +12 -0
- package/src/pipeline/stages/scaleDownCluster/scaledownClusterValidators.ts +10 -0
- package/src/pipeline/stages/shrinkCluster/ShrinkClusterConfig.tsx +27 -0
- package/src/pipeline/stages/shrinkCluster/ShrinkClusterStageForm.tsx +104 -0
- package/src/pipeline/stages/shrinkCluster/shrinkClusterStage.ts +12 -0
- package/src/pipeline/stages/shrinkCluster/shrinkClusterValidators.ts +10 -0
- package/src/reactShims/index.ts +2 -0
- package/src/reactShims/tencentcloud.ngReact.ts +21 -0
- package/src/reactShims/tencentcloud.react.injector.ts +14 -0
- package/src/reactShims/tencentcloud.react.module.ts +14 -0
- package/src/search/searchResultFormatter.js +10 -0
- package/src/tencentcloud.module.ts +32 -0
- package/src/tencentcloud.settings.ts +35 -0
- package/src/validation/ApplicationNameValidator.ts +71 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import IInjectorService = angular.auto.IInjectorService;
|
|
2
|
+
|
|
3
|
+
import { ReactInject } from '@spinnaker/core';
|
|
4
|
+
|
|
5
|
+
// prettier-ignore
|
|
6
|
+
export class TencentcloudNgReactInjector extends ReactInject {
|
|
7
|
+
public $injectorProxy = {} as IInjectorService;
|
|
8
|
+
|
|
9
|
+
// Reactified components
|
|
10
|
+
|
|
11
|
+
public initialize($injector: IInjectorService) {
|
|
12
|
+
const realInjector: { [key: string]: Function } = $injector as any;
|
|
13
|
+
const proxyInjector: { [key: string]: Function } = this.$injectorProxy as any;
|
|
14
|
+
|
|
15
|
+
Object.keys($injector)
|
|
16
|
+
.filter(key => typeof realInjector[key] === 'function')
|
|
17
|
+
.forEach(key => proxyInjector[key] = realInjector[key].bind(realInjector));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const TencentcloudNgReact = new TencentcloudNgReactInjector();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import IInjectorService = angular.auto.IInjectorService;
|
|
2
|
+
|
|
3
|
+
import { ReactInject } from '@spinnaker/core';
|
|
4
|
+
|
|
5
|
+
// prettier-ignore
|
|
6
|
+
export class TencentcloudReactInject extends ReactInject {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
public initialize($injector: IInjectorService) {
|
|
10
|
+
this.$injector = $injector;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const TencentcloudReactInjector: TencentcloudReactInject = new TencentcloudReactInject();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { module } from 'angular';
|
|
2
|
+
|
|
3
|
+
import { TencentcloudNgReact } from './tencentcloud.ngReact';
|
|
4
|
+
import { TencentcloudReactInjector } from './tencentcloud.react.injector';
|
|
5
|
+
|
|
6
|
+
export const TENCENTCLOUD_REACT_MODULE = 'spinnaker.tencentcloud.react';
|
|
7
|
+
module(TENCENTCLOUD_REACT_MODULE, []).run([
|
|
8
|
+
'$injector',
|
|
9
|
+
function ($injector: any) {
|
|
10
|
+
// Make angular services importable and (TODO when relevant) convert angular components to react
|
|
11
|
+
TencentcloudReactInjector.initialize($injector);
|
|
12
|
+
TencentcloudNgReact.initialize($injector);
|
|
13
|
+
},
|
|
14
|
+
]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import { module } from 'angular';
|
|
4
|
+
|
|
5
|
+
export const TENCENTCLOUD_SEARCH_SEARCHRESULTFORMATTER = 'spinnaker.tencentcloud.search.searchResultFormatter';
|
|
6
|
+
module(TENCENTCLOUD_SEARCH_SEARCHRESULTFORMATTER, []).factory('tencentcloudSearchResultFormatter', function () {
|
|
7
|
+
return {
|
|
8
|
+
securityGroups: function (entry) {},
|
|
9
|
+
};
|
|
10
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import { module } from 'angular';
|
|
4
|
+
|
|
5
|
+
import { CloudProviderRegistry, DeploymentStrategyRegistry } from '@spinnaker/core';
|
|
6
|
+
|
|
7
|
+
import './help/tencentcloud.help';
|
|
8
|
+
import { TencentcloudImageReader } from './image';
|
|
9
|
+
import logo from './logo/tencentcloud.logo.svg';
|
|
10
|
+
// load pipeline stage
|
|
11
|
+
import './pipeline/stages/disableCluster/disableClusterStage';
|
|
12
|
+
import './pipeline/stages/rollbackCluster/rollbackClusterStage';
|
|
13
|
+
import './pipeline/stages/scaleDownCluster/scaleDownClusterStage';
|
|
14
|
+
import './pipeline/stages/shrinkCluster/shrinkClusterStage';
|
|
15
|
+
import { TENCENTCLOUD_REACT_MODULE } from './reactShims/tencentcloud.react.module';
|
|
16
|
+
import { TENCENTCLOUD_SEARCH_SEARCHRESULTFORMATTER } from './search/searchResultFormatter';
|
|
17
|
+
import './validation/ApplicationNameValidator';
|
|
18
|
+
|
|
19
|
+
export const TENCENTCLOUD_MODULE = 'spinnaker.tencentcloud';
|
|
20
|
+
module(TENCENTCLOUD_MODULE, [TENCENTCLOUD_REACT_MODULE, TENCENTCLOUD_SEARCH_SEARCHRESULTFORMATTER]).config(() => {
|
|
21
|
+
CloudProviderRegistry.registerProvider('tencentcloud', {
|
|
22
|
+
name: 'tencentcloud',
|
|
23
|
+
logo: {
|
|
24
|
+
path: logo,
|
|
25
|
+
},
|
|
26
|
+
image: {
|
|
27
|
+
reader: TencentcloudImageReader,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
DeploymentStrategyRegistry.registerProvider('tencentcloud', ['custom', 'redblack', 'rollingpush', 'rollingredblack']);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IProviderSettings } from '@spinnaker/core';
|
|
2
|
+
import { SETTINGS } from '@spinnaker/core';
|
|
3
|
+
|
|
4
|
+
export interface IClassicLaunchAllowlist {
|
|
5
|
+
region: string;
|
|
6
|
+
credentials: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ITencentcloudProviderSettings extends IProviderSettings {
|
|
10
|
+
defaults: {
|
|
11
|
+
account?: string;
|
|
12
|
+
region?: string;
|
|
13
|
+
subnetType?: string;
|
|
14
|
+
vpc?: string;
|
|
15
|
+
};
|
|
16
|
+
defaultSecurityGroups?: string[];
|
|
17
|
+
loadBalancers?: {
|
|
18
|
+
inferInternalFlagFromSubnet: boolean;
|
|
19
|
+
certificateTypes?: string[];
|
|
20
|
+
};
|
|
21
|
+
classicLaunchLockout?: number;
|
|
22
|
+
classicLaunchAllowlist?: IClassicLaunchAllowlist[];
|
|
23
|
+
metrics?: {
|
|
24
|
+
customNamespaces?: string[];
|
|
25
|
+
};
|
|
26
|
+
minRootVolumeSize?: number;
|
|
27
|
+
disableSpotPricing?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const TencentcloudProviderSettings: ITencentcloudProviderSettings = (SETTINGS.providers
|
|
31
|
+
.tencentcloud as ITencentcloudProviderSettings) || { defaults: {} };
|
|
32
|
+
|
|
33
|
+
if (TencentcloudProviderSettings) {
|
|
34
|
+
TencentcloudProviderSettings.resetToOriginal = SETTINGS.resetProvider('tencentcloud');
|
|
35
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { IApplicationNameValidator } from '@spinnaker/core';
|
|
2
|
+
import { ApplicationNameValidator, FirewallLabels } from '@spinnaker/core';
|
|
3
|
+
|
|
4
|
+
class TencentcloudApplicationNameValidator implements IApplicationNameValidator {
|
|
5
|
+
private validateSpecialCharacters(name: string, errors: string[]): void {
|
|
6
|
+
const pattern = /^[a-zA-Z_0-9.]*$/g;
|
|
7
|
+
if (!pattern.test(name)) {
|
|
8
|
+
errors.push('Only dot(.) and underscore(_) special characters are allowed.');
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
private validateLoadBalancerCharacters(name: string, warnings: string[]) {
|
|
13
|
+
if (name.includes('.') || name.includes('_')) {
|
|
14
|
+
warnings.push(`If the application's name contains an underscore(_) or dot(.),
|
|
15
|
+
you will not be able to create a load balancer,
|
|
16
|
+
preventing it from being used as a front end service.`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
private validateLength(name: string, warnings: string[], errors: string[]) {
|
|
21
|
+
if (name.length > 250) {
|
|
22
|
+
errors.push('The maximum length for an application in Tencentcloud is 250 characters.');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (name.length > 240) {
|
|
26
|
+
if (name.length >= 248) {
|
|
27
|
+
warnings.push(
|
|
28
|
+
`You will not be able to include a stack or detail field for clusters or ${FirewallLabels.get('firewalls')}.`,
|
|
29
|
+
);
|
|
30
|
+
} else {
|
|
31
|
+
const remaining = 248 - name.length;
|
|
32
|
+
warnings.push(`If you plan to include a stack or detail field for clusters, you will only
|
|
33
|
+
have ~${remaining} characters to do so.`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (name.length > 20) {
|
|
37
|
+
if (name.length > 32) {
|
|
38
|
+
warnings.push(`You will not be able to create an Tencentcloud load balancer for this application if the
|
|
39
|
+
application's name is longer than 32 characters (currently: ${name.length} characters)`);
|
|
40
|
+
} else {
|
|
41
|
+
if (name.length >= 30) {
|
|
42
|
+
warnings.push(`If you plan to create load balancers for this application, be aware that the character limit
|
|
43
|
+
for load balancer names is 32 (currently: ${name.length} characters). With separators ("-"), you will not
|
|
44
|
+
be able to add a stack and detail field to any load balancer.`);
|
|
45
|
+
} else {
|
|
46
|
+
const remaining = 30 - name.length;
|
|
47
|
+
warnings.push(`If you plan to create load balancers for this application, be aware that the character limit
|
|
48
|
+
for load balancer names is 32. You will only have ~${remaining} characters to add a stack or detail
|
|
49
|
+
field to any load balancer.`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public validate(name = '') {
|
|
56
|
+
const warnings: string[] = [];
|
|
57
|
+
const errors: string[] = [];
|
|
58
|
+
|
|
59
|
+
if (name.length) {
|
|
60
|
+
this.validateSpecialCharacters(name, errors);
|
|
61
|
+
this.validateLoadBalancerCharacters(name, warnings);
|
|
62
|
+
this.validateLength(name, warnings, errors);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
warnings,
|
|
67
|
+
errors,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
ApplicationNameValidator.registerValidator('tencentcloud', new TencentcloudApplicationNameValidator());
|