Skip to content

Commit

Permalink
refactor(kubernetes): remove some unused code (#8458)
Browse files Browse the repository at this point in the history
* refactor(core): remove unused ManifestService

For some reason, we ended up with a KubernetesManifestService and a similar but unused core ManifestService.

* refactor(kubernetes): remove unused method from KubernetesManifestService

We have now removed all clients of `makeManifestRefresher`, and since we will not be adding additional Angular code, it is unlikely that we would ever need a method that directly mutates some input based on the most recent result of fetching manifests.

* refactor(kubernetes): remove unused interface

There is a duplicate IManifestSubscription interface in the DeployStatus component and no other uses.

* refactor(core): remove unused methods from ManifestWriter

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
maggieneterval and mergify[bot] authored Aug 3, 2020
1 parent df435ac commit 9503258
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 101 deletions.

This file was deleted.

57 changes: 0 additions & 57 deletions app/scripts/modules/core/src/manifest/ManifestService.ts

This file was deleted.

20 changes: 0 additions & 20 deletions app/scripts/modules/core/src/manifest/ManifestWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ export class ManifestWriter {
});
}

public static patchManifest(command: any, application: Application): IPromise<ITask> {
const description = 'Patch a manifest';
command.type = 'patchManifest';
return TaskExecutor.executeTask({
job: [command],
application,
description,
});
}

public static scaleManifest(command: any, application: Application): IPromise<ITask> {
const description = 'Scale manifest';
command.type = 'scaleManifest';
Expand Down Expand Up @@ -84,14 +74,4 @@ export class ManifestWriter {
description,
});
}

public static findArtifactsFromResource(command: any, application: Application): IPromise<ITask> {
const description = 'Find artifacts from a Kubernetes resource';
command.type = 'findArtifactsFromResource';
return TaskExecutor.executeTask({
job: [command],
application,
description,
});
}
}
2 changes: 0 additions & 2 deletions app/scripts/modules/core/src/manifest/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export * from './ManifestWriter';
export * from './ManifestReader';
export * from './stage/JobStageExecutionLogs';
export * from './IManifestSubscription';
export * from './ManifestService';
export * from './stage/JobManifestPodLogs';
export * from './ManifestYaml';
export * from './PodNameProvider';
15 changes: 0 additions & 15 deletions app/scripts/modules/kubernetes/src/manifest/manifest.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { Application, IManifest, ManifestReader } from '@spinnaker/core';

export interface IManifestContainer {
manifest: IManifest;
}

export interface IStageManifest {
kind: string;
apiVersion: string;
Expand All @@ -22,17 +18,6 @@ export interface IManifestParams {
export type IManifestCallback = (manifest: IManifest) => void;

export class KubernetesManifestService {
public static makeManifestRefresher(
app: Application,
params: IManifestParams,
container: IManifestContainer,
): () => void {
const onUpdate = (manifest: IManifest) => {
container.manifest = manifest || container.manifest;
};
return KubernetesManifestService.subscribe(app, params, onUpdate);
}

public static subscribe(app: Application, params: IManifestParams, fn: IManifestCallback): () => void {
KubernetesManifestService.updateManifest(params, fn);
return app.onRefresh(null, () => KubernetesManifestService.updateManifest(params, fn));
Expand Down

0 comments on commit 9503258

Please sign in to comment.