@spinnaker/kubernetes 2026.2.3 → 2026.3.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.
Files changed (158) hide show
  1. package/dist/index.d.ts +1 -2
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/instance/details/KubernetesInstanceDetails.d.ts +54 -0
  5. package/dist/instance/details/kubernetesInstanceDetails.utils.d.ts +13 -0
  6. package/dist/instance/index.d.ts +1 -1
  7. package/dist/kubernetes.module.d.ts +5 -1
  8. package/dist/loadBalancer/transformer.d.ts +1 -1
  9. package/dist/manifest/AnnotationCustomSections.d.ts +3 -2
  10. package/dist/manifest/ManifestKindSearch.d.ts +1 -1
  11. package/dist/manifest/delete/Delete.d.ts +0 -1
  12. package/dist/manifest/delete/DeleteModal.d.ts +1 -1
  13. package/dist/manifest/delete/delete.types.d.ts +4 -0
  14. package/dist/manifest/index.d.ts +3 -6
  15. package/dist/manifest/manifest.service.d.ts +5 -0
  16. package/dist/manifest/manifestCommandBuilder.service.d.ts +1 -1
  17. package/dist/manifest/rollout/PauseRollout.d.ts +0 -1
  18. package/dist/manifest/rollout/ResumeRollout.d.ts +0 -1
  19. package/dist/manifest/rollout/RollingRestart.d.ts +4 -4
  20. package/dist/manifest/rollout/UndoRollout.d.ts +0 -1
  21. package/dist/manifest/scale/Scale.d.ts +1 -2
  22. package/dist/manifest/scale/ScaleModal.d.ts +3 -3
  23. package/dist/manifest/scale/ScaleSettingsForm.d.ts +7 -1
  24. package/dist/manifest/selector/ManifestSelector.d.ts +1 -1
  25. package/dist/manifest/traffic/ManifestTrafficService.d.ts +2 -2
  26. package/dist/pipelines/stages/deleteManifest/DeleteManifestOptionsForm.d.ts +1 -1
  27. package/dist/pipelines/stages/deployManifest/manifestStatus/DeployStatus.d.ts +1 -0
  28. package/dist/pipelines/stages/deployManifest/manifestStatus/ManifestDetailsLink.d.ts +6 -3
  29. package/dist/pipelines/stages/traffic/disableManifest.stage.d.ts +2 -1
  30. package/dist/pipelines/stages/traffic/enableManifest.stage.d.ts +2 -1
  31. package/dist/rawResource/index.d.ts +3 -1
  32. package/dist/rawResource/rawResource.dataSource.d.ts +1 -1
  33. package/dist/rawResource/rawResource.states.d.ts +4 -1
  34. package/dist/resources/resources.state.d.ts +2 -1
  35. package/dist/securityGroup/details/KubernetesSecurityGroupDetails.d.ts +49 -0
  36. package/dist/securityGroup/index.d.ts +3 -1
  37. package/dist/securityGroup/transformer.d.ts +4 -1
  38. package/dist/serverGroup/serverGroupCommandBuilder.d.ts +1 -1
  39. package/dist/serverGroup/serverGroupTransformer.d.ts +1 -1
  40. package/dist/serverGroupManager/details/ServerGroupManagerDetails.d.ts +7 -3
  41. package/package.json +3 -12
  42. package/src/help/kubernetes.help.ts +2 -0
  43. package/src/index.ts +2 -2
  44. package/src/instance/details/KubernetesInstanceDetails.spec.tsx +451 -0
  45. package/src/instance/details/KubernetesInstanceDetails.tsx +342 -0
  46. package/src/instance/details/kubernetesInstanceDetails.utils.ts +77 -0
  47. package/src/instance/index.ts +1 -1
  48. package/src/kubernetes.module.spec.ts +25 -0
  49. package/src/kubernetes.module.ts +23 -87
  50. package/src/loadBalancer/details/KubernetesLoadBalancerActions.tsx +30 -35
  51. package/src/loadBalancer/details/sections/LoadBalancerAnnotationCustomSection.tsx +2 -3
  52. package/src/loadBalancer/transformer.ts +1 -1
  53. package/src/manifest/AnnotationCustomSections.spec.tsx +178 -0
  54. package/src/manifest/AnnotationCustomSections.tsx +179 -2
  55. package/src/manifest/ManifestKindSearch.tsx +1 -1
  56. package/src/manifest/delete/Delete.tsx +0 -9
  57. package/src/manifest/delete/DeleteModal.tsx +69 -72
  58. package/src/manifest/delete/delete.types.ts +4 -0
  59. package/src/manifest/index.ts +3 -6
  60. package/src/manifest/manifest.service.ts +18 -1
  61. package/src/manifest/manifestCommandBuilder.service.spec.ts +41 -0
  62. package/src/manifest/manifestCommandBuilder.service.ts +45 -59
  63. package/src/manifest/rollout/PauseRollout.tsx +1 -9
  64. package/src/manifest/rollout/ResumeRollout.tsx +2 -10
  65. package/src/manifest/rollout/RollingRestart.tsx +16 -22
  66. package/src/manifest/rollout/UndoRollout.tsx +1 -10
  67. package/src/manifest/rollout/UndoRolloutModal.tsx +5 -1
  68. package/src/manifest/scale/Scale.tsx +12 -11
  69. package/src/manifest/scale/ScaleModal.tsx +43 -31
  70. package/src/manifest/scale/ScaleSettingsForm.tsx +8 -1
  71. package/src/manifest/selector/ManifestSelector.spec.tsx +89 -46
  72. package/src/manifest/selector/ManifestSelector.tsx +4 -5
  73. package/src/manifest/traffic/ManifestTrafficService.ts +2 -2
  74. package/src/manifest/wizard/ManifestWizard.tsx +1 -1
  75. package/src/pipelines/stages/deleteManifest/DeleteManifestOptionsForm.tsx +1 -1
  76. package/src/pipelines/stages/deleteManifest/DeleteManifestStageConfig.tsx +1 -1
  77. package/src/pipelines/stages/deployManifest/DeployManifestStageForm.tsx +16 -0
  78. package/src/pipelines/stages/deployManifest/ManifestCopier.spec.ts +52 -77
  79. package/src/pipelines/stages/deployManifest/ManifestDeploymentOptions.spec.tsx +2 -0
  80. package/src/pipelines/stages/deployManifest/manifestStatus/DeployStatus.tsx +39 -4
  81. package/src/pipelines/stages/deployManifest/manifestStatus/ManifestDetailsLink.spec.tsx +35 -0
  82. package/src/pipelines/stages/deployManifest/manifestStatus/ManifestDetailsLink.tsx +10 -5
  83. package/src/pipelines/stages/traffic/ManifestTrafficStageRegistration.spec.ts +34 -0
  84. package/src/pipelines/stages/traffic/disableManifest.stage.ts +17 -19
  85. package/src/pipelines/stages/traffic/enableManifest.stage.ts +17 -19
  86. package/src/rawResource/index.ts +18 -1
  87. package/src/rawResource/rawResource.dataSource.ts +5 -8
  88. package/src/rawResource/rawResource.states.ts +50 -51
  89. package/src/resources/resources.state.spec.ts +138 -0
  90. package/src/resources/resources.state.ts +30 -35
  91. package/src/securityGroup/details/KubernetesSecurityGroupDetails.spec.tsx +292 -0
  92. package/src/securityGroup/details/KubernetesSecurityGroupDetails.tsx +304 -0
  93. package/src/securityGroup/index.ts +3 -1
  94. package/src/securityGroup/transformer.ts +2 -10
  95. package/src/serverGroup/details/KubernetesServerGroupActions.tsx +31 -61
  96. package/src/serverGroup/details/kubernetesServerGroupDetailsGetter.ts +1 -1
  97. package/src/serverGroup/details/sections/ServerGroupAnnotationCustomSection.tsx +2 -3
  98. package/src/serverGroup/serverGroupCommandBuilder.ts +1 -1
  99. package/src/serverGroup/serverGroupTransformer.ts +1 -1
  100. package/src/serverGroupManager/details/ServerGroupManagerActions.tsx +48 -128
  101. package/src/serverGroupManager/details/ServerGroupManagerDetails.spec.ts +12 -0
  102. package/src/serverGroupManager/details/ServerGroupManagerDetails.tsx +19 -8
  103. package/src/serverGroupManager/details/sections/ServerGroupManagerAnnotationCustomSection.tsx +2 -3
  104. package/src/serverGroupManager/details/useKubernetesServerGroupManagerDetails.spec.tsx +112 -0
  105. package/src/serverGroupManager/details/useKubernetesServerGroupManagerDetails.tsx +50 -29
  106. package/dist/instance/details/details.controller.d.ts +0 -1
  107. package/dist/manifest/annotationCustomSections.component.d.ts +0 -3
  108. package/dist/manifest/delete/delete.controller.d.ts +0 -12
  109. package/dist/manifest/delete/deleteOptionsForm.component.d.ts +0 -1
  110. package/dist/manifest/editor/json/jsonEditor.component.d.ts +0 -1
  111. package/dist/manifest/manifestEvents.component.d.ts +0 -1
  112. package/dist/manifest/manifestImageDetails.component.d.ts +0 -1
  113. package/dist/manifest/manifestLabels.component.d.ts +0 -1
  114. package/dist/manifest/manifestQos.component.d.ts +0 -1
  115. package/dist/manifest/manifestResources.component.d.ts +0 -1
  116. package/dist/manifest/rollout/pause.controller.d.ts +0 -1
  117. package/dist/manifest/rollout/resume.controller.d.ts +0 -1
  118. package/dist/manifest/rollout/undo.controller.d.ts +0 -5
  119. package/dist/manifest/scale/scale.controller.d.ts +0 -8
  120. package/dist/manifest/scale/scaleSettingsForm.component.d.ts +0 -1
  121. package/dist/manifest/selector/selector.component.d.ts +0 -1
  122. package/dist/manifest/status/condition.component.d.ts +0 -1
  123. package/dist/manifest/status/status.component.d.ts +0 -1
  124. package/dist/rawResource/rawResource.module.d.ts +0 -1
  125. package/dist/reactShims/index.d.ts +0 -1
  126. package/dist/reactShims/kubernetes.react.injector.d.ts +0 -11
  127. package/dist/reactShims/kubernetes.react.module.d.ts +0 -1
  128. package/dist/securityGroup/details/details.controller.d.ts +0 -1
  129. package/src/instance/details/details.controller.ts +0 -186
  130. package/src/instance/details/details.html +0 -80
  131. package/src/manifest/annotationCustomSections.component.ts +0 -114
  132. package/src/manifest/delete/delete.controller.ts +0 -80
  133. package/src/manifest/delete/delete.html +0 -42
  134. package/src/manifest/delete/deleteOptionsForm.component.ts +0 -52
  135. package/src/manifest/editor/json/jsonEditor.component.ts +0 -12
  136. package/src/manifest/manifestEvents.component.ts +0 -12
  137. package/src/manifest/manifestImageDetails.component.ts +0 -12
  138. package/src/manifest/manifestLabels.component.ts +0 -12
  139. package/src/manifest/manifestQos.component.ts +0 -12
  140. package/src/manifest/manifestResources.component.ts +0 -12
  141. package/src/manifest/rollout/pause.controller.ts +0 -66
  142. package/src/manifest/rollout/pause.html +0 -28
  143. package/src/manifest/rollout/resume.controller.ts +0 -66
  144. package/src/manifest/rollout/resume.html +0 -28
  145. package/src/manifest/rollout/undo.controller.ts +0 -74
  146. package/src/manifest/rollout/undo.html +0 -44
  147. package/src/manifest/scale/scale.controller.ts +0 -75
  148. package/src/manifest/scale/scale.html +0 -32
  149. package/src/manifest/scale/scaleSettingsForm.component.ts +0 -11
  150. package/src/manifest/selector/selector.component.ts +0 -17
  151. package/src/manifest/status/condition.component.ts +0 -12
  152. package/src/manifest/status/status.component.ts +0 -11
  153. package/src/rawResource/rawResource.module.ts +0 -8
  154. package/src/reactShims/index.ts +0 -1
  155. package/src/reactShims/kubernetes.react.injector.ts +0 -30
  156. package/src/reactShims/kubernetes.react.module.ts +0 -12
  157. package/src/securityGroup/details/details.controller.ts +0 -118
  158. package/src/securityGroup/details/details.html +0 -91
@@ -1,12 +0,0 @@
1
- import { module } from 'angular';
2
- import { react2angular } from 'react2angular';
3
-
4
- import { withErrorBoundary } from '@spinnaker/core';
5
-
6
- import { JsonEditor } from './JsonEditor';
7
-
8
- export const JSON_EDITOR_COMPONENT = 'spinnaker.kubernetes.jsonEditor.component';
9
- module(JSON_EDITOR_COMPONENT, []).component(
10
- 'jsonEditor',
11
- react2angular(withErrorBoundary(JsonEditor, 'jsonEditor'), ['onChange', 'value']),
12
- );
@@ -1,12 +0,0 @@
1
- import { module } from 'angular';
2
- import { react2angular } from 'react2angular';
3
-
4
- import { withErrorBoundary } from '@spinnaker/core';
5
-
6
- import { ManifestEvents } from '../pipelines/stages/deployManifest/manifestStatus/ManifestEvents';
7
-
8
- export const KUBERNETES_MANIFEST_EVENTS = 'spinnaker.kubernetes.v2.manifest.events';
9
- module(KUBERNETES_MANIFEST_EVENTS, []).component(
10
- 'kubernetesManifestEvents',
11
- react2angular(withErrorBoundary(ManifestEvents, 'kubernetesManifestEvents'), ['manifest']),
12
- );
@@ -1,12 +0,0 @@
1
- import { module } from 'angular';
2
- import { react2angular } from 'react2angular';
3
-
4
- import { withErrorBoundary } from '@spinnaker/core';
5
-
6
- import { ManifestImageDetails } from './ManifestImageDetails';
7
-
8
- export const KUBERNETES_MANIFEST_IMAGE_DETAILS = 'spinnaker.kubernetes.v2.manifestImageDetails.component';
9
- module(KUBERNETES_MANIFEST_IMAGE_DETAILS, []).component(
10
- 'kubernetesManifestImageDetails',
11
- react2angular(withErrorBoundary(ManifestImageDetails, 'kubernetesManifestImageDetails'), ['manifest']),
12
- );
@@ -1,12 +0,0 @@
1
- import { module } from 'angular';
2
- import { react2angular } from 'react2angular';
3
-
4
- import { withErrorBoundary } from '@spinnaker/core';
5
-
6
- import { ManifestLabels } from './ManifestLabels';
7
-
8
- export const KUBERNETES_MANIFEST_LABELS = 'spinnaker.kubernetes.v2.manifest.labels';
9
- module(KUBERNETES_MANIFEST_LABELS, []).component(
10
- 'kubernetesManifestLabels',
11
- react2angular(withErrorBoundary(ManifestLabels, 'kubernetesManifestLabels'), ['manifest']),
12
- );
@@ -1,12 +0,0 @@
1
- import { module } from 'angular';
2
- import { react2angular } from 'react2angular';
3
-
4
- import { withErrorBoundary } from '@spinnaker/core';
5
-
6
- import { ManifestQos } from './ManifestQos';
7
-
8
- export const KUBERNETES_MANIFEST_QOS = 'spinnaker.kubernetes.v2.manifest.qos';
9
- module(KUBERNETES_MANIFEST_QOS, []).component(
10
- 'kubernetesManifestQos',
11
- react2angular(withErrorBoundary(ManifestQos, 'kubernetesManifestQos'), ['manifest']),
12
- );
@@ -1,12 +0,0 @@
1
- import { module } from 'angular';
2
- import { react2angular } from 'react2angular';
3
-
4
- import { withErrorBoundary } from '@spinnaker/core';
5
-
6
- import { ManifestResources } from './ManifestResources';
7
-
8
- export const KUBERNETES_MANIFEST_RESOURCES = 'spinnaker.kubernetes.v2.manifest.resources';
9
- module(KUBERNETES_MANIFEST_RESOURCES, []).component(
10
- 'kubernetesManifestResources',
11
- react2angular(withErrorBoundary(ManifestResources, 'kubernetesManifestResources'), ['manifest', 'metrics']),
12
- );
@@ -1,66 +0,0 @@
1
- import type { IController } from 'angular';
2
- import { copy, module } from 'angular';
3
- import type { IModalServiceInstance } from 'angular-ui-bootstrap';
4
-
5
- import type { Application } from '@spinnaker/core';
6
- import { ManifestWriter, TaskMonitor } from '@spinnaker/core';
7
- import type { IManifestCoordinates } from '../IManifestCoordinates';
8
-
9
- interface IPauseRolloutCommand {
10
- manifestName: string;
11
- location: string;
12
- account: string;
13
- reason: string;
14
- }
15
-
16
- class KubernetesManifestPauseRolloutController implements IController {
17
- public taskMonitor: TaskMonitor;
18
- public command: IPauseRolloutCommand;
19
- public verification = {
20
- verified: false,
21
- };
22
-
23
- public static $inject = ['coordinates', '$uibModalInstance', 'application'];
24
- constructor(
25
- coordinates: IManifestCoordinates,
26
- private $uibModalInstance: IModalServiceInstance,
27
- private application: Application,
28
- ) {
29
- this.taskMonitor = new TaskMonitor({
30
- title: `Pause rollout of ${coordinates.name} in ${coordinates.namespace}`,
31
- application,
32
- modalInstance: $uibModalInstance,
33
- });
34
-
35
- this.command = {
36
- manifestName: coordinates.name,
37
- location: coordinates.namespace,
38
- account: coordinates.account,
39
- reason: null,
40
- };
41
- }
42
-
43
- public isValid(): boolean {
44
- return this.verification.verified;
45
- }
46
-
47
- public cancel(): void {
48
- this.$uibModalInstance.dismiss();
49
- }
50
-
51
- public pauseRollout(): void {
52
- this.taskMonitor.submit(() => {
53
- const payload = copy(this.command) as any;
54
- payload.cloudProvider = 'kubernetes';
55
-
56
- return ManifestWriter.pauseRolloutManifest(payload, this.application);
57
- });
58
- }
59
- }
60
-
61
- export const KUBERNETES_MANIFEST_PAUSE_ROLLOUT_CTRL = 'spinnaker.kubernetes.v2.manifest.pauseRollout.controller';
62
-
63
- module(KUBERNETES_MANIFEST_PAUSE_ROLLOUT_CTRL, []).controller(
64
- 'kubernetesV2ManifestPauseRolloutCtrl',
65
- KubernetesManifestPauseRolloutController,
66
- );
@@ -1,28 +0,0 @@
1
- <div modal-page class="confirmation-modal">
2
- <task-monitor monitor="ctrl.taskMonitor"></task-monitor>
3
- <form role="form" name="pauseRolloutForm">
4
- <modal-close dismiss="$dismiss()"></modal-close>
5
- <div class="modal-header">
6
- <h4 class="modal-title">
7
- Pause rollout of {{ctrl.command.manifestName | robotToHuman}} in {{ctrl.command.location}}
8
- </h4>
9
- </div>
10
- <div class="modal-body confirmation-modal">
11
- <task-reason command="ctrl.command"></task-reason>
12
- </div>
13
- <div class="modal-footer">
14
- <user-verification account="ctrl.command.account" verification="ctrl.verification"></user-verification>
15
- <button type="submit" ng-click="ctrl.pauseRollout()" style="display: none"></button>
16
- <!-- Allows form submission via enter keypress-->
17
- <button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>
18
- <button
19
- type="submit"
20
- class="btn btn-primary"
21
- ng-click="ctrl.pauseRollout()"
22
- ng-disabled="!ctrl.isValid() || !pauseRolloutForm.$valid"
23
- >
24
- Submit
25
- </button>
26
- </div>
27
- </form>
28
- </div>
@@ -1,66 +0,0 @@
1
- import type { IController } from 'angular';
2
- import { copy, module } from 'angular';
3
- import type { IModalServiceInstance } from 'angular-ui-bootstrap';
4
-
5
- import type { Application } from '@spinnaker/core';
6
- import { ManifestWriter, TaskMonitor } from '@spinnaker/core';
7
- import type { IManifestCoordinates } from '../IManifestCoordinates';
8
-
9
- interface IResumeRolloutCommand {
10
- manifestName: string;
11
- location: string;
12
- account: string;
13
- reason: string;
14
- }
15
-
16
- class KubernetesManifestResumeRolloutController implements IController {
17
- public taskMonitor: TaskMonitor;
18
- public command: IResumeRolloutCommand;
19
- public verification = {
20
- verified: false,
21
- };
22
-
23
- public static $inject = ['coordinates', '$uibModalInstance', 'application'];
24
- constructor(
25
- coordinates: IManifestCoordinates,
26
- private $uibModalInstance: IModalServiceInstance,
27
- private application: Application,
28
- ) {
29
- this.taskMonitor = new TaskMonitor({
30
- title: `Resume rollout of ${coordinates.name} in ${coordinates.namespace}`,
31
- application,
32
- modalInstance: $uibModalInstance,
33
- });
34
-
35
- this.command = {
36
- manifestName: coordinates.name,
37
- location: coordinates.namespace,
38
- account: coordinates.account,
39
- reason: null,
40
- };
41
- }
42
-
43
- public isValid(): boolean {
44
- return this.verification.verified;
45
- }
46
-
47
- public cancel(): void {
48
- this.$uibModalInstance.dismiss();
49
- }
50
-
51
- public resumeRollout(): void {
52
- this.taskMonitor.submit(() => {
53
- const payload = copy(this.command) as any;
54
- payload.cloudProvider = 'kubernetes';
55
-
56
- return ManifestWriter.resumeRolloutManifest(payload, this.application);
57
- });
58
- }
59
- }
60
-
61
- export const KUBERNETES_MANIFEST_RESUME_ROLLOUT_CTRL = 'spinnaker.kubernetes.v2.manifest.resumeRollout.controller';
62
-
63
- module(KUBERNETES_MANIFEST_RESUME_ROLLOUT_CTRL, []).controller(
64
- 'kubernetesV2ManifestResumeRolloutCtrl',
65
- KubernetesManifestResumeRolloutController,
66
- );
@@ -1,28 +0,0 @@
1
- <div modal-page class="confirmation-modal">
2
- <task-monitor monitor="ctrl.taskMonitor"></task-monitor>
3
- <form role="form" name="resumeRolloutForm">
4
- <modal-close dismiss="$dismiss()"></modal-close>
5
- <div class="modal-header">
6
- <h4 class="modal-title">
7
- Resume rollout of {{ctrl.command.manifestName | robotToHuman}} in {{ctrl.command.location}}
8
- </h4>
9
- </div>
10
- <div class="modal-body confirmation-modal">
11
- <task-reason command="ctrl.command"></task-reason>
12
- </div>
13
- <div class="modal-footer">
14
- <user-verification account="ctrl.command.account" verification="ctrl.verification"></user-verification>
15
- <button type="submit" ng-click="ctrl.resumeRollout()" style="display: none"></button>
16
- <!-- Allows form submission via enter keypress-->
17
- <button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>
18
- <button
19
- type="submit"
20
- class="btn btn-primary"
21
- ng-click="ctrl.resumeRollout()"
22
- ng-disabled="!ctrl.isValid() || !resumeRolloutForm.$valid"
23
- >
24
- Submit
25
- </button>
26
- </div>
27
- </form>
28
- </div>
@@ -1,74 +0,0 @@
1
- import type { IController } from 'angular';
2
- import { copy, module } from 'angular';
3
- import type { IModalServiceInstance } from 'angular-ui-bootstrap';
4
-
5
- import type { Application } from '@spinnaker/core';
6
- import { ManifestWriter, TaskMonitor } from '@spinnaker/core';
7
- import type { IManifestCoordinates } from '../IManifestCoordinates';
8
-
9
- interface IUndoRolloutCommand {
10
- manifestName: string;
11
- location: string;
12
- account: string;
13
- reason: string;
14
- revision: number;
15
- }
16
-
17
- export interface IRolloutRevision {
18
- label: string;
19
- revision: number;
20
- }
21
-
22
- class KubernetesManifestUndoRolloutController implements IController {
23
- public taskMonitor: TaskMonitor;
24
- public command: IUndoRolloutCommand;
25
- public verification = {
26
- verified: false,
27
- };
28
-
29
- public static $inject = ['coordinates', 'revisions', '$uibModalInstance', 'application'];
30
- constructor(
31
- coordinates: IManifestCoordinates,
32
- public revisions: IRolloutRevision[],
33
- private $uibModalInstance: IModalServiceInstance,
34
- private application: Application,
35
- ) {
36
- this.taskMonitor = new TaskMonitor({
37
- title: `Undo rollout of ${coordinates.name} in ${coordinates.namespace}`,
38
- application,
39
- modalInstance: $uibModalInstance,
40
- });
41
-
42
- this.command = {
43
- manifestName: coordinates.name,
44
- location: coordinates.namespace,
45
- account: coordinates.account,
46
- reason: null,
47
- revision: null,
48
- };
49
- }
50
-
51
- public isValid(): boolean {
52
- return this.verification.verified;
53
- }
54
-
55
- public cancel(): void {
56
- this.$uibModalInstance.dismiss();
57
- }
58
-
59
- public undoRollout(): void {
60
- this.taskMonitor.submit(() => {
61
- const payload = copy(this.command) as any;
62
- payload.cloudProvider = 'kubernetes';
63
-
64
- return ManifestWriter.undoRolloutManifest(payload, this.application);
65
- });
66
- }
67
- }
68
-
69
- export const KUBERNETES_MANIFEST_UNDO_ROLLOUT_CTRL = 'spinnaker.kubernetes.v2.manifest.undoRollout.controller';
70
-
71
- module(KUBERNETES_MANIFEST_UNDO_ROLLOUT_CTRL, []).controller(
72
- 'kubernetesV2ManifestUndoRolloutCtrl',
73
- KubernetesManifestUndoRolloutController,
74
- );
@@ -1,44 +0,0 @@
1
- <div modal-page class="confirmation-modal">
2
- <task-monitor monitor="ctrl.taskMonitor"></task-monitor>
3
- <form role="form" name="undoRolloutForm">
4
- <modal-close dismiss="$dismiss()"></modal-close>
5
- <div class="modal-header">
6
- <h4 class="modal-title">
7
- Undo rollout of {{ctrl.command.manifestName | robotToHuman}} in {{ctrl.command.location}}
8
- </h4>
9
- </div>
10
- <div class="modal-body confirmation-modal">
11
- <div class="form-horizontal">
12
- <div class="form-group form-inline">
13
- <div class="col-md-3 sm-label-right">Revision</div>
14
- <div class="col-md-7">
15
- <select style="width: 100%" class="form-control input-sm" ng-model="ctrl.command.revision">
16
- <option
17
- ng-repeat="revision in ctrl.revisions"
18
- value="{{revision.revision}}"
19
- ng-selected="ctrl.command.revisions === revision.revision"
20
- >
21
- {{revision.label}}
22
- </option>
23
- </select>
24
- </div>
25
- </div>
26
- </div>
27
- <task-reason command="ctrl.command"></task-reason>
28
- </div>
29
- <div class="modal-footer">
30
- <user-verification account="ctrl.command.account" verification="ctrl.verification"></user-verification>
31
- <button type="submit" ng-click="ctrl.undoRollout()" style="display: none"></button>
32
- <!-- Allows form submission via enter keypress-->
33
- <button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>
34
- <button
35
- type="submit"
36
- class="btn btn-primary"
37
- ng-click="ctrl.undoRollout()"
38
- ng-disabled="!ctrl.isValid() || !undoRolloutForm.$valid"
39
- >
40
- Submit
41
- </button>
42
- </div>
43
- </form>
44
- </div>
@@ -1,75 +0,0 @@
1
- import type { IController, IScope } from 'angular';
2
- import { copy, module } from 'angular';
3
- import type { IModalServiceInstance } from 'angular-ui-bootstrap';
4
-
5
- import type { Application } from '@spinnaker/core';
6
- import { ManifestWriter, TaskMonitor } from '@spinnaker/core';
7
- import type { IManifestCoordinates } from '../IManifestCoordinates';
8
- import { KUBERNETES_SCALE_MANIFEST_SETTINGS_FORM } from './scaleSettingsForm.component';
9
-
10
- export interface IScaleCommand {
11
- manifestName: string;
12
- location: string;
13
- account: string;
14
- reason: string;
15
- replicas: number;
16
- }
17
-
18
- class KubernetesManifestScaleController implements IController {
19
- public taskMonitor: TaskMonitor;
20
- public verification = {
21
- verified: false,
22
- };
23
-
24
- public static $inject = ['$scope', 'coordinates', 'currentReplicas', '$uibModalInstance', 'application'];
25
- constructor(
26
- private $scope: IScope,
27
- coordinates: IManifestCoordinates,
28
- currentReplicas: number,
29
- private $uibModalInstance: IModalServiceInstance,
30
- private application: Application,
31
- ) {
32
- this.taskMonitor = new TaskMonitor({
33
- title: `Scaling ${coordinates.name} in ${coordinates.namespace}`,
34
- application,
35
- modalInstance: $uibModalInstance,
36
- });
37
-
38
- this.$scope.command = {
39
- manifestName: coordinates.name,
40
- location: coordinates.namespace,
41
- account: coordinates.account,
42
- reason: null,
43
- replicas: currentReplicas,
44
- };
45
-
46
- // used by react components to update command fields in parent (angular) scope
47
- this.$scope.onChange = () => {
48
- this.$scope.$applyAsync();
49
- };
50
- }
51
-
52
- public isValid(): boolean {
53
- return this.verification.verified;
54
- }
55
-
56
- public cancel(): void {
57
- this.$uibModalInstance.dismiss();
58
- }
59
-
60
- public scale(): void {
61
- this.taskMonitor.submit(() => {
62
- const payload = copy(this.$scope.command) as any;
63
- payload.cloudProvider = 'kubernetes';
64
-
65
- return ManifestWriter.scaleManifest(payload, this.application);
66
- });
67
- }
68
- }
69
-
70
- export const KUBERNETES_MANIFEST_SCALE_CTRL = 'spinnaker.kubernetes.v2.manifest.scale.controller';
71
-
72
- module(KUBERNETES_MANIFEST_SCALE_CTRL, [KUBERNETES_SCALE_MANIFEST_SETTINGS_FORM]).controller(
73
- 'kubernetesV2ManifestScaleCtrl',
74
- KubernetesManifestScaleController,
75
- );
@@ -1,32 +0,0 @@
1
- <div modal-page class="confirmation-modal">
2
- <task-monitor monitor="ctrl.taskMonitor"></task-monitor>
3
- <form role="form" name="scaleForm">
4
- <modal-close dismiss="$dismiss()"></modal-close>
5
- <div class="modal-header">
6
- <h4 class="modal-title">
7
- Scale {{ctrl.$scope.command.manifestName | robotToHuman}} in {{ctrl.$scope.command.location}}
8
- </h4>
9
- </div>
10
- <div class="modal-body confirmation-modal">
11
- <kubernetes-scale-manifest-settings-form
12
- options="ctrl.$scope.command"
13
- on-change="ctrl.$scope.onChange"
14
- ></kubernetes-scale-manifest-settings-form>
15
- <task-reason command="ctrl.$scope.command"></task-reason>
16
- </div>
17
- <div class="modal-footer">
18
- <user-verification account="ctrl.$scope.command.account" verification="ctrl.verification"></user-verification>
19
- <button type="submit" ng-click="ctrl.scale()" style="display: none"></button>
20
- <!-- Allows form submission via enter keypress-->
21
- <button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>
22
- <button
23
- type="submit"
24
- class="btn btn-primary"
25
- ng-click="ctrl.scale()"
26
- ng-disabled="!ctrl.isValid() || !scaleForm.$valid"
27
- >
28
- Submit
29
- </button>
30
- </div>
31
- </form>
32
- </div>
@@ -1,11 +0,0 @@
1
- import { module } from 'angular';
2
- import { react2angular } from 'react2angular';
3
- import { withErrorBoundary } from '@spinnaker/core';
4
- import { ScaleSettingsForm } from './ScaleSettingsForm';
5
-
6
- export const KUBERNETES_SCALE_MANIFEST_SETTINGS_FORM =
7
- 'spinnaker.kubernetes.v2.kubernetes.manifest.scale.settingsForm.component';
8
- module(KUBERNETES_SCALE_MANIFEST_SETTINGS_FORM, []).component(
9
- 'kubernetesScaleManifestSettingsForm',
10
- react2angular(withErrorBoundary(ScaleSettingsForm, 'kubernetesScaleManifestSettingsForm'), ['options', 'onChange']),
11
- );
@@ -1,17 +0,0 @@
1
- import { module } from 'angular';
2
- import { react2angular } from 'react2angular';
3
-
4
- import { withErrorBoundary } from '@spinnaker/core';
5
-
6
- import { ManifestSelector } from './ManifestSelector';
7
-
8
- export const KUBERNETES_MANIFEST_SELECTOR = 'spinnaker.kubernetes.v2.manifest.selector.component';
9
- module(KUBERNETES_MANIFEST_SELECTOR, []).component(
10
- 'kubernetesManifestSelector',
11
- react2angular(withErrorBoundary(ManifestSelector, 'kubernetesManifestSelector'), [
12
- 'selector',
13
- 'modes',
14
- 'application',
15
- 'onChange',
16
- ]),
17
- );
@@ -1,12 +0,0 @@
1
- import { module } from 'angular';
2
- import { react2angular } from 'react2angular';
3
-
4
- import { withErrorBoundary } from '@spinnaker/core';
5
-
6
- import { ManifestCondition } from './ManifestCondition';
7
-
8
- export const KUBERNETES_MANIFEST_CONDITION = 'spinnaker.kubernetes.v2.manifest.condition.component';
9
- module(KUBERNETES_MANIFEST_CONDITION, []).component(
10
- 'kubernetesManifestCondition',
11
- react2angular(withErrorBoundary(ManifestCondition, 'kubernetesManifestCondition'), ['condition']),
12
- );
@@ -1,11 +0,0 @@
1
- import { module } from 'angular';
2
-
3
- import { react2angular } from 'react2angular';
4
- import { withErrorBoundary } from '@spinnaker/core';
5
- import { ManifestStatus } from './ManifestStatus';
6
-
7
- export const KUBERNETES_MANIFEST_STATUS = 'spinnaker.kubernetes.v2.kubernetes.manifest.status.component';
8
- module(KUBERNETES_MANIFEST_STATUS, []).component(
9
- 'kubernetesManifestStatus',
10
- react2angular(withErrorBoundary(ManifestStatus, 'kubernetesManifestStatus'), ['status']),
11
- );
@@ -1,8 +0,0 @@
1
- import { module } from 'angular';
2
-
3
- import { KUBERNETS_RAW_RESOURCE_DATA_SOURCE } from './rawResource.dataSource';
4
- import { KUBERNETS_RAW_RESOURCE_STATES } from './rawResource.states';
5
-
6
- export const KUBERNETS_RAW_RESOURCE_MODULE = 'spinnaker.kubernetes.rawresource';
7
-
8
- module(KUBERNETS_RAW_RESOURCE_MODULE, [KUBERNETS_RAW_RESOURCE_DATA_SOURCE, KUBERNETS_RAW_RESOURCE_STATES]);
@@ -1 +0,0 @@
1
- export * from './kubernetes.react.injector';
@@ -1,30 +0,0 @@
1
- import { angular2react } from 'angular2react';
2
- import type React from 'react';
3
-
4
- import { ReactInject } from '@spinnaker/core';
5
-
6
- import type { IAnnotationCustomSectionsProps } from '../manifest/AnnotationCustomSections';
7
- import { kubernetesAnnotationCustomSectionsComponent } from '../manifest/annotationCustomSections.component';
8
-
9
- import IInjectorService = angular.auto.IInjectorService;
10
-
11
- export class KubernetesReactInject extends ReactInject {
12
- private $injectorProxy = {} as IInjectorService;
13
-
14
- public KubernetesAnnotationCustomSections: React.ComponentClass<IAnnotationCustomSectionsProps> = angular2react(
15
- 'kubernetesAnnotationCustomSections',
16
- kubernetesAnnotationCustomSectionsComponent,
17
- this.$injectorProxy,
18
- ) as any;
19
-
20
- public initialize($injector: IInjectorService) {
21
- const realInjector: { [key: string]: Function } = $injector as any;
22
- const proxyInjector: { [key: string]: Function } = this.$injectorProxy as any;
23
-
24
- Object.keys($injector)
25
- .filter((key) => typeof realInjector[key] === 'function')
26
- .forEach((key) => (proxyInjector[key] = realInjector[key].bind(realInjector)));
27
- }
28
- }
29
-
30
- export const KubernetesReactInjector: KubernetesReactInject = new KubernetesReactInject();
@@ -1,12 +0,0 @@
1
- import { module } from 'angular';
2
-
3
- import { KubernetesReactInjector } from './kubernetes.react.injector';
4
-
5
- export const KUBERNETES_REACT_MODULE = 'spinnaker.kubernetes.react';
6
- module(KUBERNETES_REACT_MODULE, []).run([
7
- '$injector',
8
- function ($injector: any) {
9
- // Make angular services importable and (TODO when relevant) convert angular components to react
10
- KubernetesReactInjector.initialize($injector);
11
- },
12
- ]);