@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,3 +0,0 @@
1
- import type { IComponentOptions } from 'angular';
2
- export declare const kubernetesAnnotationCustomSectionsComponent: IComponentOptions;
3
- export declare const KUBERNETES_ANNOTATION_CUSTOM_SECTIONS = "spinnaker.kubernetes.v2.manifest.annotation.custom.sections";
@@ -1,12 +0,0 @@
1
- export interface IDeleteCommand {
2
- manifestName: string;
3
- location: string;
4
- account: string;
5
- reason: string;
6
- options: IDeleteOptions;
7
- }
8
- export interface IDeleteOptions {
9
- gracePeriodSeconds?: number;
10
- cascading: boolean;
11
- }
12
- export declare const KUBERNETES_MANIFEST_DELETE_CTRL = "spinnaker.kubernetes.v2.manifest.delete.controller";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_DELETE_MANIFEST_OPTIONS_FORM = "spinnaker.kubernetes.v2.kubernetes.manifest.delete.options.component";
@@ -1 +0,0 @@
1
- export declare const JSON_EDITOR_COMPONENT = "spinnaker.kubernetes.jsonEditor.component";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_MANIFEST_EVENTS = "spinnaker.kubernetes.v2.manifest.events";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_MANIFEST_IMAGE_DETAILS = "spinnaker.kubernetes.v2.manifestImageDetails.component";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_MANIFEST_LABELS = "spinnaker.kubernetes.v2.manifest.labels";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_MANIFEST_QOS = "spinnaker.kubernetes.v2.manifest.qos";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_MANIFEST_RESOURCES = "spinnaker.kubernetes.v2.manifest.resources";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_MANIFEST_PAUSE_ROLLOUT_CTRL = "spinnaker.kubernetes.v2.manifest.pauseRollout.controller";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_MANIFEST_RESUME_ROLLOUT_CTRL = "spinnaker.kubernetes.v2.manifest.resumeRollout.controller";
@@ -1,5 +0,0 @@
1
- export interface IRolloutRevision {
2
- label: string;
3
- revision: number;
4
- }
5
- export declare const KUBERNETES_MANIFEST_UNDO_ROLLOUT_CTRL = "spinnaker.kubernetes.v2.manifest.undoRollout.controller";
@@ -1,8 +0,0 @@
1
- export interface IScaleCommand {
2
- manifestName: string;
3
- location: string;
4
- account: string;
5
- reason: string;
6
- replicas: number;
7
- }
8
- export declare const KUBERNETES_MANIFEST_SCALE_CTRL = "spinnaker.kubernetes.v2.manifest.scale.controller";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_SCALE_MANIFEST_SETTINGS_FORM = "spinnaker.kubernetes.v2.kubernetes.manifest.scale.settingsForm.component";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_MANIFEST_SELECTOR = "spinnaker.kubernetes.v2.manifest.selector.component";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_MANIFEST_CONDITION = "spinnaker.kubernetes.v2.manifest.condition.component";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_MANIFEST_STATUS = "spinnaker.kubernetes.v2.kubernetes.manifest.status.component";
@@ -1 +0,0 @@
1
- export declare const KUBERNETS_RAW_RESOURCE_MODULE = "spinnaker.kubernetes.rawresource";
@@ -1 +0,0 @@
1
- export * from './kubernetes.react.injector';
@@ -1,11 +0,0 @@
1
- /// <reference types="angular" />
2
- import type React from 'react';
3
- import { ReactInject } from '@spinnaker/core';
4
- import type { IAnnotationCustomSectionsProps } from '../manifest/AnnotationCustomSections';
5
- import IInjectorService = angular.auto.IInjectorService;
6
- export declare class KubernetesReactInject extends ReactInject {
7
- private $injectorProxy;
8
- KubernetesAnnotationCustomSections: React.ComponentClass<IAnnotationCustomSectionsProps>;
9
- initialize($injector: IInjectorService): void;
10
- }
11
- export declare const KubernetesReactInjector: KubernetesReactInject;
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_REACT_MODULE = "spinnaker.kubernetes.react";
@@ -1 +0,0 @@
1
- export declare const KUBERNETES_SECURITY_GROUP_DETAILS_CTRL = "spinnaker.kubernetes.securityGroupDetails.controller";
@@ -1,186 +0,0 @@
1
- import type { StateService } from '@uirouter/angularjs';
2
- import type { IController, IQService, IScope } from 'angular';
3
- import { module } from 'angular';
4
- import type { IModalService } from 'angular-ui-bootstrap';
5
- import { flattenDeep } from 'lodash';
6
-
7
- import type { Application, ILoadBalancer, IManifest } from '@spinnaker/core';
8
- import { InstanceReader, ManifestReader, RecentHistoryService, SETTINGS } from '@spinnaker/core';
9
-
10
- import type { IKubernetesInstance } from '../../interfaces';
11
- import { KubernetesManifestCommandBuilder } from '../../manifest/manifestCommandBuilder.service';
12
- import { ManifestWizard } from '../../manifest/wizard/ManifestWizard';
13
-
14
- interface InstanceFromStateParams {
15
- instanceId: string;
16
- }
17
-
18
- interface InstanceManager {
19
- account: string;
20
- region: string;
21
- category: string; // e.g., serverGroup, loadBalancer.
22
- name: string; // Parent resource name, not instance name.
23
- instances: IKubernetesInstance[];
24
- }
25
-
26
- interface IConsoleOutputInstance {
27
- account: string;
28
- region: string;
29
- id: string;
30
- provider: string;
31
- }
32
-
33
- interface InstanceIdentifier {
34
- account: string;
35
- id: string;
36
- name: string;
37
- namespace: string;
38
- }
39
-
40
- class KubernetesInstanceDetailsController implements IController {
41
- public state = { loading: true };
42
- public instance: IKubernetesInstance;
43
- public manifest: IManifest;
44
- public consoleOutputInstance: IConsoleOutputInstance;
45
- public environment: string;
46
-
47
- public static $inject = ['instance', '$uibModal', '$q', '$scope', 'app', '$state'];
48
- constructor(
49
- instance: InstanceFromStateParams,
50
- private $uibModal: IModalService,
51
- private $q: IQService,
52
- private $scope: IScope,
53
- private app: Application,
54
- private $state: StateService,
55
- ) {
56
- this.app
57
- .ready()
58
- .then(() => {
59
- this.extractInstance(instance);
60
- this.app.onRefresh(this.$scope, () => this.extractInstance(instance));
61
- this.$scope.isDisabled = !SETTINGS.kubernetesAdHocInfraWritesEnabled;
62
- })
63
- .catch(() => this.autoClose());
64
- }
65
-
66
- public deleteInstance(): void {
67
- this.$uibModal.open({
68
- templateUrl: require('../../manifest/delete/delete.html'),
69
- controller: 'kubernetesV2ManifestDeleteCtrl',
70
- controllerAs: 'ctrl',
71
- resolve: {
72
- coordinates: {
73
- name: this.instance.name,
74
- namespace: this.instance.namespace,
75
- account: this.instance.account,
76
- },
77
- application: this.app,
78
- manifestController: (): string => null,
79
- },
80
- });
81
- }
82
-
83
- public editInstance(): void {
84
- KubernetesManifestCommandBuilder.buildNewManifestCommand(
85
- this.app,
86
- this.manifest.manifest,
87
- this.instance.moniker,
88
- this.instance.account,
89
- ).then((builtCommand) => {
90
- ManifestWizard.show({ title: 'Edit Manifest', application: this.app, command: builtCommand });
91
- });
92
- }
93
-
94
- private extractInstance(instanceFromState: InstanceFromStateParams): void {
95
- const instanceId = this.retrieveInstance(instanceFromState);
96
- if (!instanceId) {
97
- return this.autoClose();
98
- }
99
- this.$q
100
- .all([
101
- this.fetchInstance(instanceId).then((instance: IKubernetesInstance) => {
102
- this.instance = instance;
103
- this.consoleOutputInstance = {
104
- account: instance.account,
105
- region: instance.zone,
106
- id: instance.humanReadableName,
107
- provider: instance.provider,
108
- };
109
- }),
110
- ManifestReader.getManifest(instanceId.account, instanceId.namespace, instanceId.name).then(
111
- (manifest: IManifest) => {
112
- this.manifest = manifest;
113
- },
114
- ),
115
- ])
116
- .then(() => {
117
- this.state.loading = false;
118
- });
119
- }
120
-
121
- private fetchInstance(instance: InstanceIdentifier): PromiseLike<IKubernetesInstance> {
122
- return InstanceReader.getInstanceDetails(instance.account, instance.namespace, instance.name).then(
123
- (instanceDetails: IKubernetesInstance) => {
124
- instanceDetails.id = instance.id;
125
- instanceDetails.name = instance.name;
126
- instanceDetails.provider = 'kubernetes';
127
- return instanceDetails;
128
- },
129
- );
130
- }
131
-
132
- private retrieveInstance(instanceFromState: InstanceFromStateParams): InstanceIdentifier {
133
- const instanceLocatorPredicate = (dataSource: InstanceManager) => {
134
- return dataSource.instances.some((possibleMatch) => possibleMatch.id === instanceFromState.instanceId);
135
- };
136
-
137
- const dataSources: InstanceManager[] = flattenDeep([
138
- this.app.getDataSource('serverGroups').data,
139
- this.app.getDataSource('loadBalancers').data,
140
- this.app.getDataSource('loadBalancers').data.map((loadBalancer: ILoadBalancer) => loadBalancer.serverGroups),
141
- ]);
142
-
143
- const instanceManager = dataSources.find(instanceLocatorPredicate);
144
- if (!instanceManager) {
145
- return null;
146
- }
147
- const recentHistoryExtraData: { [key: string]: string } = {
148
- region: instanceManager.region,
149
- account: instanceManager.account,
150
- };
151
-
152
- if (instanceManager.category === 'serverGroup') {
153
- recentHistoryExtraData.serverGroup = instanceManager.name;
154
- }
155
-
156
- const instance = instanceManager.instances.find((i) => i.id === instanceFromState.instanceId);
157
- if (!instance) {
158
- return null;
159
- }
160
-
161
- RecentHistoryService.addExtraDataToLatest('instances', recentHistoryExtraData);
162
-
163
- return {
164
- id: instance.id,
165
- name: instance.name,
166
- namespace: instanceManager.region,
167
- account: instanceManager.account,
168
- };
169
- }
170
-
171
- private autoClose(): void {
172
- if (this.$scope.$$destroyed) {
173
- return;
174
- } else {
175
- this.$state.params.allowModalToStayOpen = true;
176
- this.$state.go('^', null, { location: 'replace' });
177
- }
178
- }
179
- }
180
-
181
- export const KUBERNETES_INSTANCE_DETAILS_CTRL = 'spinnaker.kubernetes.instanceDetails.controller';
182
-
183
- module(KUBERNETES_INSTANCE_DETAILS_CTRL, []).controller(
184
- 'kubernetesV2InstanceDetailsCtrl',
185
- KubernetesInstanceDetailsController,
186
- );
@@ -1,80 +0,0 @@
1
- <div class="details-panel">
2
- <div class="header">
3
- <instance-details-header
4
- cloud-provider="ctrl.instance.cloudProvider"
5
- health-state="instance.healthState"
6
- instance-id="ctrl.instance.displayName"
7
- loading="ctrl.state.loading"
8
- standalone="false"
9
- ></instance-details-header>
10
- <div class="actions" ng-if="!ctrl.state.loading">
11
- <div class="dropdown" uib-dropdown dropdown-append-to-body>
12
- <button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle ng-hide="isDisabled">
13
- {{ctrl.instance.kind | robotToHuman}} Actions <span class="caret"></span>
14
- </button>
15
- <ul class="dropdown-menu" uib-dropdown-menu role="menu">
16
- <li>
17
- <a href ng-click="ctrl.deleteInstance()">Delete</a>
18
- </li>
19
- <li>
20
- <a href ng-click="ctrl.editInstance()">Edit</a>
21
- </li>
22
- </ul>
23
- </div>
24
- </div>
25
- </div>
26
-
27
- <div ng-if="!ctrl.state.loading" class="content">
28
- <collapsible-section heading="Information" expanded="true">
29
- <dl class="dl-horizontal dl-narrow">
30
- <dt>Created</dt>
31
- <dd>{{ctrl.instance.createdTime | timestamp}}</dd>
32
- <dt>Account</dt>
33
- <dd><account-tag account="ctrl.instance.account" pad="right"></account-tag></dd>
34
- <dt>Namespace</dt>
35
- <dd>{{ctrl.instance.namespace}}</dd>
36
- <dt>Kind</dt>
37
- <dd>{{ctrl.instance.kind}}</dd>
38
- <dt>QOS Class</dt>
39
- <dd><kubernetes-manifest-qos manifest="ctrl.manifest.manifest"></kubernetes-manifest-qos></dd>
40
- <dt>Logs</dt>
41
- <dd>
42
- <console-output-link instance="ctrl.consoleOutputInstance" uses-multi-output="true"></console-output-link>
43
- </dd>
44
- </dl>
45
- </collapsible-section>
46
- <collapsible-section heading="Status" expanded="true">
47
- <ul ng-repeat="condition in ctrl.manifest.manifest.status.conditions">
48
- <kubernetes-manifest-condition condition="condition"></kubernetes-manifest-condition>
49
- </ul>
50
- </collapsible-section>
51
-
52
- <kubernetes-annotation-custom-sections
53
- manifest="ctrl.manifest.manifest"
54
- resource="ctrl.instance"
55
- ></kubernetes-annotation-custom-sections>
56
-
57
- <collapsible-section heading="Events" expanded="true">
58
- <kubernetes-manifest-events manifest="ctrl.manifest"></kubernetes-manifest-events>
59
- </collapsible-section>
60
-
61
- <collapsible-section heading="Resources" expanded="true">
62
- <kubernetes-manifest-resources
63
- manifest="ctrl.manifest.manifest"
64
- metrics="ctrl.manifest.metrics"
65
- ></kubernetes-manifest-resources>
66
- </collapsible-section>
67
-
68
- <collapsible-section heading="Labels" expanded="true">
69
- <kubernetes-manifest-labels manifest="ctrl.manifest.manifest"></kubernetes-manifest-labels>
70
- </collapsible-section>
71
-
72
- <instance-links
73
- address="ctrl.instance.publicDnsName"
74
- application="ctrl.app"
75
- instance="ctrl.instance"
76
- moniker="ctrl.instance.moniker"
77
- environment="ctrl.environment"
78
- ></instance-links>
79
- </div>
80
- </div>
@@ -1,114 +0,0 @@
1
- import type { IComponentOptions, IController, IInterpolateService, ISCEService } from 'angular';
2
- import { module } from 'angular';
3
- import DOMPurify from 'dompurify';
4
- import { get, partition } from 'lodash';
5
-
6
- interface IAnnotationsMap {
7
- [key: string]: string;
8
- }
9
-
10
- interface ICustomSection {
11
- title: string;
12
- key: string;
13
- isHtml: boolean;
14
- content: string;
15
- }
16
-
17
- interface ICustomSectionMap {
18
- [key: string]: ICustomSection[];
19
- }
20
-
21
- class KubernetesAnnotationCustomSections implements IController {
22
- private resource: any;
23
- public manifest: any;
24
- public customSections: ICustomSectionMap;
25
-
26
- public static $inject = ['$sce', '$interpolate'];
27
- constructor(private $sce: ISCEService, private $interpolate: IInterpolateService) {}
28
-
29
- public $onInit() {
30
- const annotations: IAnnotationsMap = get(this, ['manifest', 'metadata', 'annotations']);
31
- if (annotations == null) {
32
- return;
33
- }
34
- this.populateCustomSections(annotations);
35
- }
36
-
37
- private populateCustomSections(annotations: IAnnotationsMap) {
38
- const customSections: ICustomSectionMap = Object.keys(annotations).reduce(
39
- (memo: ICustomSectionMap, annotationKey: string) => {
40
- const entry = this.annotationToEntry(annotations[annotationKey], annotationKey);
41
- if (entry != null && entry.title) {
42
- memo[entry.title] = memo[entry.title] || [];
43
- memo[entry.title].push(entry);
44
- }
45
- return memo;
46
- },
47
- {},
48
- );
49
- // Sort section contents such that text entries appear before HTML entries.
50
- this.customSections = Object.keys(customSections).reduce((memo: ICustomSectionMap, sectionTitle: string) => {
51
- const entriesHtmlText = partition(customSections[sectionTitle], (section) => section.isHtml);
52
- memo[sectionTitle] = entriesHtmlText[1].concat(entriesHtmlText[0]);
53
- return memo;
54
- }, {});
55
- }
56
-
57
- private annotationToEntry(content: string, annotationKey: string): ICustomSection {
58
- const parsed = this.parseAnnotationKey(annotationKey);
59
- if (parsed == null) {
60
- return null;
61
- }
62
- if (this.resource && content.includes('{{')) {
63
- content = this.$interpolate(content)({ ...this.resource, manifest: this.manifest });
64
- }
65
- return {
66
- title: parsed.title.replace(/-/g, ' ').trim(),
67
- key: parsed.key.replace(/-/g, ' ').trim(),
68
- content: parsed.isHtml ? this.sanitizeContent(content) : content,
69
- isHtml: parsed.isHtml,
70
- };
71
- }
72
-
73
- private parseAnnotationKey(annotationKey: string): { title: string; key: string; isHtml: boolean } {
74
- const keyParts = /([^.]+)\.details\.(html\.)?spinnaker\.io(?:\/(.*))?/.exec(annotationKey);
75
- if (keyParts == null || keyParts.length !== 4) {
76
- return null;
77
- }
78
- return {
79
- title: keyParts[1] || '',
80
- key: keyParts[3] || '',
81
- isHtml: !!keyParts[2],
82
- };
83
- }
84
-
85
- private sanitizeContent(unsanitized: string): any {
86
- const sanitized = DOMPurify.sanitize(unsanitized, {
87
- ADD_ATTR: ['target'],
88
- });
89
- return this.$sce.trustAsHtml(sanitized);
90
- }
91
- }
92
-
93
- export const kubernetesAnnotationCustomSectionsComponent: IComponentOptions = {
94
- bindings: { manifest: '<', resource: '<' },
95
- controller: ['$sce', '$interpolate', KubernetesAnnotationCustomSections],
96
- controllerAs: 'ctrl',
97
- template: `
98
- <collapsible-section expanded="true" ng-if="ctrl.manifest" ng-repeat="(section, entries) in ctrl.customSections" heading="{{ section }}">
99
- <div ng-repeat="entry in entries">
100
- <div ng-if="entry.isHtml" ng-bind-html="entry.content"></div>
101
- <div ng-if="!entry.isHtml">
102
- <span ng-if="entry.key" style="font-weight:bold">{{ entry.key }}</span>
103
- <span>{{ entry.content }}</span>
104
- </div>
105
- </div>
106
- </collapsible-section>
107
- `,
108
- };
109
-
110
- export const KUBERNETES_ANNOTATION_CUSTOM_SECTIONS = 'spinnaker.kubernetes.v2.manifest.annotation.custom.sections';
111
- module(KUBERNETES_ANNOTATION_CUSTOM_SECTIONS, []).component(
112
- 'kubernetesAnnotationCustomSections',
113
- kubernetesAnnotationCustomSectionsComponent,
114
- );
@@ -1,80 +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
- import { KUBERNETES_DELETE_MANIFEST_OPTIONS_FORM } from './deleteOptionsForm.component';
9
-
10
- export interface IDeleteCommand {
11
- manifestName: string;
12
- location: string;
13
- account: string;
14
- reason: string;
15
- options: IDeleteOptions;
16
- }
17
-
18
- export interface IDeleteOptions {
19
- gracePeriodSeconds?: number;
20
- cascading: boolean;
21
- }
22
-
23
- class KubernetesManifestDeleteController implements IController {
24
- public taskMonitor: TaskMonitor;
25
- public command: IDeleteCommand;
26
- public verification = {
27
- verified: false,
28
- };
29
-
30
- public static $inject = ['coordinates', '$uibModalInstance', 'application', 'manifestController'];
31
- constructor(
32
- coordinates: IManifestCoordinates,
33
- private $uibModalInstance: IModalServiceInstance,
34
- private application: Application,
35
- public manifestController: string,
36
- ) {
37
- this.taskMonitor = new TaskMonitor({
38
- title: `Deleting ${coordinates.name} in ${coordinates.namespace}`,
39
- application,
40
- modalInstance: $uibModalInstance,
41
- });
42
-
43
- this.command = {
44
- manifestName: coordinates.name,
45
- location: coordinates.namespace,
46
- account: coordinates.account,
47
- reason: null,
48
- options: {
49
- cascading: true,
50
- },
51
- };
52
- }
53
-
54
- public isValid(): boolean {
55
- return this.verification.verified;
56
- }
57
-
58
- public cancel(): void {
59
- this.$uibModalInstance.dismiss();
60
- }
61
-
62
- public delete(): void {
63
- this.taskMonitor.submit(() => {
64
- const payload = copy(this.command) as any;
65
- payload.cloudProvider = 'kubernetes';
66
- // cascading is the kubectl term (more familiar) orphanDependants is the k8s server term
67
- payload.options.orphanDependants = !payload.options.cascading;
68
- delete payload.options.cascading;
69
-
70
- return ManifestWriter.deleteManifest(payload, this.application);
71
- });
72
- }
73
- }
74
-
75
- export const KUBERNETES_MANIFEST_DELETE_CTRL = 'spinnaker.kubernetes.v2.manifest.delete.controller';
76
-
77
- module(KUBERNETES_MANIFEST_DELETE_CTRL, [KUBERNETES_DELETE_MANIFEST_OPTIONS_FORM]).controller(
78
- 'kubernetesV2ManifestDeleteCtrl',
79
- KubernetesManifestDeleteController,
80
- );
@@ -1,42 +0,0 @@
1
- <div modal-page class="confirmation-modal">
2
- <task-monitor monitor="ctrl.taskMonitor"></task-monitor>
3
- <form role="form" name="deleteForm">
4
- <modal-close dismiss="$dismiss()"></modal-close>
5
- <div class="modal-header">
6
- <h4 class="modal-title">Delete {{ctrl.command.manifestName | robotToHuman}} in {{ctrl.command.location}}</h4>
7
- </div>
8
- <div ng-if="ctrl.manifestController">
9
- <div class="alert alert-warning">
10
- Manifest is controlled by
11
- <a
12
- ui-sref="^.serverGroupManager({
13
- accountId: ctrl.command.account,
14
- region: ctrl.command.location,
15
- serverGroupManager: ctrl.manifestController,
16
- provider: 'kubernetes'})"
17
- >
18
- {{ctrl.manifestController | robotToHuman }}
19
- </a>
20
- and may be recreated after deletion.
21
- </div>
22
- </div>
23
- <div class="modal-body confirmation-modal">
24
- <kubernetes-delete-manifest-options-form options="ctrl.command.options"></kubernetes-delete-manifest-options-form>
25
- <task-reason command="ctrl.command"></task-reason>
26
- </div>
27
- <div class="modal-footer">
28
- <user-verification account="ctrl.command.account" verification="ctrl.verification"></user-verification>
29
- <button type="submit" ng-click="ctrl.delete()" style="display: none"></button>
30
- <!-- Allows form submission via enter keypress-->
31
- <button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>
32
- <button
33
- type="submit"
34
- class="btn btn-primary"
35
- ng-click="ctrl.delete()"
36
- ng-disabled="!ctrl.isValid() || !deleteForm.$valid"
37
- >
38
- Submit
39
- </button>
40
- </div>
41
- </form>
42
- </div>
@@ -1,52 +0,0 @@
1
- import type { IComponentOptions, IController } from 'angular';
2
- import { module } from 'angular';
3
-
4
- import type { IDeleteOptions } from './delete.controller';
5
-
6
- class KubernetesDeleteManifestOptionsFormCtrl implements IController {
7
- public options: IDeleteOptions;
8
- }
9
-
10
- const kubernetesDeletManifestOptionsFormComponent: IComponentOptions = {
11
- bindings: { options: '=' },
12
- controller: KubernetesDeleteManifestOptionsFormCtrl,
13
- controllerAs: 'ctrl',
14
- template: `
15
- <div class="form-horizontal">
16
- <div class="form-group form-inline">
17
- <div class="col-md-3 sm-label-right">
18
- Cascading
19
- <help-field key="kubernetes.manifest.delete.cascading"></help-field>
20
- </div>
21
- <div class="col-md-3">
22
- <div class="input-group">
23
- <input type="checkbox"
24
- ng-model="ctrl.options.cascading"/>
25
- </div>
26
- </div>
27
- </div>
28
- <div class="form-group form-inline">
29
- <div class="col-md-3 sm-label-right">
30
- Grace Period
31
- <help-field key="kubernetes.manifest.delete.gracePeriod"></help-field>
32
- </div>
33
- <div class="col-md-4">
34
- <div class="input-group">
35
- <input type="number"
36
- class="form-control input-sm highlight-pristine"
37
- ng-model="ctrl.options.gracePeriodSeconds"
38
- min="0"/>
39
- <span class="input-group-addon">second<span ng-if="ctrl.options.gracePeriodSeconds !== 1">s</span></span>
40
- </div>
41
- </div>
42
- </div>
43
- </div>
44
- `,
45
- };
46
-
47
- export const KUBERNETES_DELETE_MANIFEST_OPTIONS_FORM =
48
- 'spinnaker.kubernetes.v2.kubernetes.manifest.delete.options.component';
49
- module(KUBERNETES_DELETE_MANIFEST_OPTIONS_FORM, []).component(
50
- 'kubernetesDeleteManifestOptionsForm',
51
- kubernetesDeletManifestOptionsFormComponent,
52
- );