From c1790d7cfb610a7da85c8f4678a5631f2227a4ff Mon Sep 17 00:00:00 2001 From: chengyumeng <792400644@qq.com> Date: Fri, 11 Jan 2019 11:48:50 +0800 Subject: [PATCH 001/112] frontend:add {} to if result --- src/frontend/src/app/shared/model/v1/app.ts | 2 +- .../src/app/shared/model/v1/cronjob.ts | 112 +- .../src/app/shared/model/v1/daemonset.ts | 130 +- .../src/app/shared/model/v1/daemonsettpl.ts | 22 +- .../src/app/shared/model/v1/deployment.ts | 112 +- .../shared/model/v1/kubernetes/configmap.ts | 40 - .../app/shared/model/v1/kubernetes/cronjob.ts | 370 +---- .../shared/model/v1/kubernetes/daemonset.ts | 1208 ++++++++-------- .../shared/model/v1/kubernetes/deployment.ts | 8 +- .../shared/model/v1/kubernetes/node-list.ts | 76 +- .../app/shared/model/v1/kubernetes/node.ts | 302 ++-- .../shared/model/v1/kubernetes/statefulset.ts | 1244 ++++++++--------- .../src/app/shared/model/v1/namespace.ts | 30 +- .../src/app/shared/model/v1/permission.ts | 18 +- .../app/shared/model/v1/publish-history.ts | 2 - .../src/app/shared/model/v1/statefulset.ts | 381 ++--- .../src/app/shared/model/v1/statefulsettpl.ts | 197 +-- .../src/app/shared/model/v1/status.ts | 2 +- .../shared/navigation/navigation.component.ts | 37 +- .../src/app/shared/page/page-state.ts | 38 +- .../shared/pipe/relative-time.filter.pipe.ts | 16 +- src/frontend/src/app/shared/tabs/ListStyle.ts | 2 +- .../src/app/shared/tabs/tab/tab.component.ts | 8 +- .../src/app/shared/tabs/tabs.component.ts | 19 +- .../unauthorized/unauthorized.component.ts | 2 +- src/frontend/src/app/shared/utils.ts | 8 +- 26 files changed, 2018 insertions(+), 2368 deletions(-) diff --git a/src/frontend/src/app/shared/model/v1/app.ts b/src/frontend/src/app/shared/model/v1/app.ts index 4ad5cc5e9..2cabc7c3c 100644 --- a/src/frontend/src/app/shared/model/v1/app.ts +++ b/src/frontend/src/app/shared/model/v1/app.ts @@ -16,7 +16,7 @@ export class App { } static emptyObject(): App { - let result = new App(); + const result = new App(); result.namespace = Namespace.emptyObject(); result.createTime = null; return result; diff --git a/src/frontend/src/app/shared/model/v1/cronjob.ts b/src/frontend/src/app/shared/model/v1/cronjob.ts index e60943f8d..a61dfc0df 100644 --- a/src/frontend/src/app/shared/model/v1/cronjob.ts +++ b/src/frontend/src/app/shared/model/v1/cronjob.ts @@ -30,14 +30,14 @@ export class PodAntiAffinity { preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAntiAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): PodAntiAffinity { - let result = new PodAntiAffinity(); + const result = new PodAntiAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -50,14 +50,14 @@ export class WeightedPodAffinityTerm { podAffinityTerm: PodAffinityTerm; constructor(init?: WeightedPodAffinityTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.podAffinityTerm) this.podAffinityTerm = init.podAffinityTerm; + if (!init) { return; } + if (init.weight) { this.weight = init.weight; } + if (init.podAffinityTerm) { this.podAffinityTerm = init.podAffinityTerm; } } static emptyObject(): WeightedPodAffinityTerm { - let result = new WeightedPodAffinityTerm(); + const result = new WeightedPodAffinityTerm(); result.podAffinityTerm = PodAffinityTerm.emptyObject(); return result; } @@ -70,15 +70,15 @@ export class LabelSelectorRequirement { values: string[]; constructor(init?: LabelSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.values) { this.values = init.values; } } static emptyObject(): LabelSelectorRequirement { - let result = new LabelSelectorRequirement(); + const result = new LabelSelectorRequirement(); result.values = []; return result; } @@ -90,14 +90,14 @@ export class LabelSelector { matchExpressions: LabelSelectorRequirement[]; constructor(init?: LabelSelector) { - if (!init) return; - if (init.matchLabels) this.matchLabels = init.matchLabels; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchLabels) { this.matchLabels = init.matchLabels; } + if (init.matchExpressions) { this.matchExpressions = init.matchExpressions; } } static emptyObject(): LabelSelector { - let result = new LabelSelector(); + const result = new LabelSelector(); result.matchLabels = null; result.matchExpressions = []; return result; @@ -111,15 +111,15 @@ export class PodAffinityTerm { topologyKey: string; constructor(init?: PodAffinityTerm) { - if (!init) return; - if (init.labelSelector) this.labelSelector = init.labelSelector; - if (init.namespaces) this.namespaces = init.namespaces; - if (init.topologyKey) this.topologyKey = init.topologyKey; + if (!init) { return; } + if (init.labelSelector) { this.labelSelector = init.labelSelector; } + if (init.namespaces) { this.namespaces = init.namespaces; } + if (init.topologyKey) { this.topologyKey = init.topologyKey; } } static emptyObject(): PodAffinityTerm { - let result = new PodAffinityTerm(); + const result = new PodAffinityTerm(); result.labelSelector = LabelSelector.emptyObject(); result.namespaces = []; return result; @@ -132,14 +132,14 @@ export class PodAffinity { preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): PodAffinity { - let result = new PodAffinity(); + const result = new PodAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -152,14 +152,14 @@ export class PreferredSchedulingTerm { preference: NodeSelectorTerm; constructor(init?: PreferredSchedulingTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.preference) this.preference = init.preference; + if (!init) { return; } + if (init.weight) { this.weight = init.weight; } + if (init.preference) { this.preference = init.preference; } } static emptyObject(): PreferredSchedulingTerm { - let result = new PreferredSchedulingTerm(); + const result = new PreferredSchedulingTerm(); result.preference = NodeSelectorTerm.emptyObject(); return result; } @@ -172,15 +172,15 @@ export class NodeSelectorRequirement { values: string[]; constructor(init?: NodeSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.values) { this.values = init.values; } } static emptyObject(): NodeSelectorRequirement { - let result = new NodeSelectorRequirement(); + const result = new NodeSelectorRequirement(); result.values = []; return result; } @@ -191,13 +191,13 @@ export class NodeSelectorTerm { matchExpressions: NodeSelectorRequirement[]; constructor(init?: NodeSelectorTerm) { - if (!init) return; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchExpressions) { this.matchExpressions = init.matchExpressions; } } static emptyObject(): NodeSelectorTerm { - let result = new NodeSelectorTerm(); + const result = new NodeSelectorTerm(); result.matchExpressions = []; return result; } @@ -208,13 +208,13 @@ export class NodeSelector { nodeSelectorTerms: NodeSelectorTerm[]; constructor(init?: NodeSelector) { - if (!init) return; - if (init.nodeSelectorTerms) this.nodeSelectorTerms = init.nodeSelectorTerms; + if (!init) { return; } + if (init.nodeSelectorTerms) { this.nodeSelectorTerms = init.nodeSelectorTerms; } } static emptyObject(): NodeSelector { - let result = new NodeSelector(); + const result = new NodeSelector(); result.nodeSelectorTerms = []; return result; } @@ -226,14 +226,14 @@ export class NodeAffinity { preferredDuringSchedulingIgnoredDuringExecution: PreferredSchedulingTerm[]; constructor(init?: NodeAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): NodeAffinity { - let result = new NodeAffinity(); + const result = new NodeAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = NodeSelector.emptyObject(); result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -247,15 +247,15 @@ export class Affinity { podAntiAffinity?: PodAntiAffinity; constructor(init?: Affinity) { - if (!init) return; - if (init.nodeAffinity) this.nodeAffinity = init.nodeAffinity; - if (init.podAffinity) this.podAffinity = init.podAffinity; - if (init.podAntiAffinity) this.podAntiAffinity = init.podAntiAffinity; + if (!init) { return; } + if (init.nodeAffinity) { this.nodeAffinity = init.nodeAffinity; } + if (init.podAffinity) { this.podAffinity = init.podAffinity; } + if (init.podAntiAffinity) { this.podAntiAffinity = init.podAntiAffinity; } } static emptyObject(): Affinity { - let result = new Affinity(); + const result = new Affinity(); result.nodeAffinity = NodeAffinity.emptyObject(); result.podAffinity = PodAffinity.emptyObject(); result.podAntiAffinity = PodAntiAffinity.emptyObject(); @@ -271,16 +271,16 @@ export class CronjobMetaData { privileged?: { [key: string]: boolean }; constructor(init?: CronjobMetaData) { - if (!init) return; - if (init.replicas) this.replicas = init.replicas; - if (init.suspends) this.suspends = init.suspends; - if (init.affinity) this.affinity = init.affinity; - if (init.privileged) this.privileged = init.privileged; + if (!init) { return; } + if (init.replicas) { this.replicas = init.replicas; } + if (init.suspends) { this.suspends = init.suspends; } + if (init.affinity) { this.affinity = init.affinity; } + if (init.privileged) { this.privileged = init.privileged; } } static emptyObject(): CronjobMetaData { - let result = new CronjobMetaData(); + const result = new CronjobMetaData(); result.replicas = null; result.suspends = null; result.affinity = Affinity.emptyObject(); diff --git a/src/frontend/src/app/shared/model/v1/daemonset.ts b/src/frontend/src/app/shared/model/v1/daemonset.ts index e3e145d3b..6ab072a91 100644 --- a/src/frontend/src/app/shared/model/v1/daemonset.ts +++ b/src/frontend/src/app/shared/model/v1/daemonset.ts @@ -16,22 +16,22 @@ export class DaemonSet { order: number; constructor(init?: DaemonSet) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.metaData) this.metaData = init.metaData; - if (init.app) this.app = init.app; - if (init.description) this.description = init.description; + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.metaData) { this.metaData = init.metaData; } + if (init.app) { this.app = init.app; } + if (init.description) { this.description = init.description; } if (init.createTime) this.createTime = new Date(init.createTime as any); if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.user) this.user = init.user; - if (init.deleted) this.deleted = init.deleted; - if (init.appId) this.appId = init.appId; + if (init.user) { this.user = init.user; } + if (init.deleted) { this.deleted = init.deleted; } + if (init.appId) { this.appId = init.appId; } } static emptyObject(): DaemonSet { - let result = new DaemonSet(); + const result = new DaemonSet(); result.app = App.emptyObject(); result.createTime = null; result.updateTime = null; @@ -46,14 +46,14 @@ export class PodAntiAffinity { preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAntiAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): PodAntiAffinity { - let result = new PodAntiAffinity(); + const result = new PodAntiAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -66,14 +66,14 @@ export class WeightedPodAffinityTerm { podAffinityTerm: PodAffinityTerm; constructor(init?: WeightedPodAffinityTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.podAffinityTerm) this.podAffinityTerm = init.podAffinityTerm; + if (!init) { return; } + if (init.weight) { this.weight = init.weight; } + if (init.podAffinityTerm) { this.podAffinityTerm = init.podAffinityTerm; } } static emptyObject(): WeightedPodAffinityTerm { - let result = new WeightedPodAffinityTerm(); + const result = new WeightedPodAffinityTerm(); result.podAffinityTerm = PodAffinityTerm.emptyObject(); return result; } @@ -86,15 +86,15 @@ export class LabelSelectorRequirement { values: string[]; constructor(init?: LabelSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.values) { this.values = init.values; } } static emptyObject(): LabelSelectorRequirement { - let result = new LabelSelectorRequirement(); + const result = new LabelSelectorRequirement(); result.values = []; return result; } @@ -106,14 +106,14 @@ export class LabelSelector { matchExpressions: LabelSelectorRequirement[]; constructor(init?: LabelSelector) { - if (!init) return; - if (init.matchLabels) this.matchLabels = init.matchLabels; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchLabels) { this.matchLabels = init.matchLabels; } + if (init.matchExpressions) { this.matchExpressions = init.matchExpressions; } } static emptyObject(): LabelSelector { - let result = new LabelSelector(); + const result = new LabelSelector(); result.matchLabels = null; result.matchExpressions = []; return result; @@ -127,15 +127,15 @@ export class PodAffinityTerm { topologyKey: string; constructor(init?: PodAffinityTerm) { - if (!init) return; - if (init.labelSelector) this.labelSelector = init.labelSelector; - if (init.namespaces) this.namespaces = init.namespaces; - if (init.topologyKey) this.topologyKey = init.topologyKey; + if (!init) { return; } + if (init.labelSelector) { this.labelSelector = init.labelSelector; } + if (init.namespaces) { this.namespaces = init.namespaces; } + if (init.topologyKey) { this.topologyKey = init.topologyKey; } } static emptyObject(): PodAffinityTerm { - let result = new PodAffinityTerm(); + const result = new PodAffinityTerm(); result.labelSelector = LabelSelector.emptyObject(); result.namespaces = []; return result; @@ -148,14 +148,14 @@ export class PodAffinity { preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): PodAffinity { - let result = new PodAffinity(); + const result = new PodAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -168,14 +168,14 @@ export class PreferredSchedulingTerm { preference: NodeSelectorTerm; constructor(init?: PreferredSchedulingTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.preference) this.preference = init.preference; + if (!init) { return; } + if (init.weight) { this.weight = init.weight; } + if (init.preference) { this.preference = init.preference; } } static emptyObject(): PreferredSchedulingTerm { - let result = new PreferredSchedulingTerm(); + const result = new PreferredSchedulingTerm(); result.preference = NodeSelectorTerm.emptyObject(); return result; } @@ -188,15 +188,15 @@ export class NodeSelectorRequirement { values: string[]; constructor(init?: NodeSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.values) { this.values = init.values; } } static emptyObject(): NodeSelectorRequirement { - let result = new NodeSelectorRequirement(); + const result = new NodeSelectorRequirement(); result.values = []; return result; } @@ -207,13 +207,13 @@ export class NodeSelectorTerm { matchExpressions: NodeSelectorRequirement[]; constructor(init?: NodeSelectorTerm) { - if (!init) return; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchExpressions) { this.matchExpressions = init.matchExpressions; } } static emptyObject(): NodeSelectorTerm { - let result = new NodeSelectorTerm(); + const result = new NodeSelectorTerm(); result.matchExpressions = []; return result; } @@ -224,13 +224,13 @@ export class NodeSelector { nodeSelectorTerms: NodeSelectorTerm[]; constructor(init?: NodeSelector) { - if (!init) return; - if (init.nodeSelectorTerms) this.nodeSelectorTerms = init.nodeSelectorTerms; + if (!init) { return; } + if (init.nodeSelectorTerms) { this.nodeSelectorTerms = init.nodeSelectorTerms; } } static emptyObject(): NodeSelector { - let result = new NodeSelector(); + const result = new NodeSelector(); result.nodeSelectorTerms = []; return result; } @@ -242,14 +242,14 @@ export class NodeAffinity { preferredDuringSchedulingIgnoredDuringExecution: PreferredSchedulingTerm[]; constructor(init?: NodeAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): NodeAffinity { - let result = new NodeAffinity(); + const result = new NodeAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = NodeSelector.emptyObject(); result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -263,15 +263,15 @@ export class Affinity { podAntiAffinity?: PodAntiAffinity; constructor(init?: Affinity) { - if (!init) return; - if (init.nodeAffinity) this.nodeAffinity = init.nodeAffinity; - if (init.podAffinity) this.podAffinity = init.podAffinity; - if (init.podAntiAffinity) this.podAntiAffinity = init.podAntiAffinity; + if (!init) { return; } + if (init.nodeAffinity) { this.nodeAffinity = init.nodeAffinity; } + if (init.podAffinity) { this.podAffinity = init.podAffinity; } + if (init.podAntiAffinity) { this.podAntiAffinity = init.podAntiAffinity; } } static emptyObject(): Affinity { - let result = new Affinity(); + const result = new Affinity(); result.nodeAffinity = NodeAffinity.emptyObject(); result.podAffinity = PodAffinity.emptyObject(); result.podAntiAffinity = PodAntiAffinity.emptyObject(); @@ -286,15 +286,15 @@ export class DaemonSetMetaData { privileged?: { [key: string]: boolean }; constructor(init?: DaemonSetMetaData) { - if (!init) return; - if (init.resources) this.resources = init.resources; - if (init.affinity) this.affinity = init.affinity; - if (init.privileged) this.privileged = init.privileged; + if (!init) { return; } + if (init.resources) { this.resources = init.resources; } + if (init.affinity) { this.affinity = init.affinity; } + if (init.privileged) { this.privileged = init.privileged; } } static emptyObject(): DaemonSetMetaData { - let result = new DaemonSetMetaData(); + const result = new DaemonSetMetaData(); result.resources = null; result.affinity = Affinity.emptyObject(); result.privileged = null; diff --git a/src/frontend/src/app/shared/model/v1/daemonsettpl.ts b/src/frontend/src/app/shared/model/v1/daemonsettpl.ts index d4dabcd30..7c348a406 100644 --- a/src/frontend/src/app/shared/model/v1/daemonsettpl.ts +++ b/src/frontend/src/app/shared/model/v1/daemonsettpl.ts @@ -17,23 +17,23 @@ export class DaemonSetTemplate { containerVersions: string[]; constructor(init?: DaemonSetTemplate) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.template) this.template = init.template; - if (init.daemonSet) this.daemonSet = init.daemonSet; - if (init.description) this.description = init.description; + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.template) { this.template = init.template; } + if (init.daemonSet) { this.daemonSet = init.daemonSet; } + if (init.description) { this.description = init.description; } if (init.createTime) this.createTime = new Date(init.createTime as any); if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.user) this.user = init.user; - if (init.deleted) this.deleted = init.deleted; - if (init.daemonSetId) this.daemonSetId = init.daemonSetId; - if (init.status) this.status = init.status; + if (init.user) { this.user = init.user; } + if (init.deleted) { this.deleted = init.deleted; } + if (init.daemonSetId) { this.daemonSetId = init.daemonSetId; } + if (init.status) { this.status = init.status; } } static emptyObject(): DaemonSetTemplate { - let result = new DaemonSetTemplate(); + const result = new DaemonSetTemplate(); result.daemonSet = DaemonSet.emptyObject(); result.createTime = null; result.updateTime = null; diff --git a/src/frontend/src/app/shared/model/v1/deployment.ts b/src/frontend/src/app/shared/model/v1/deployment.ts index 14fcb19dc..6a23b7669 100644 --- a/src/frontend/src/app/shared/model/v1/deployment.ts +++ b/src/frontend/src/app/shared/model/v1/deployment.ts @@ -31,14 +31,14 @@ export class PodAntiAffinity { preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAntiAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): PodAntiAffinity { - let result = new PodAntiAffinity(); + const result = new PodAntiAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -51,14 +51,14 @@ export class WeightedPodAffinityTerm { podAffinityTerm: PodAffinityTerm; constructor(init?: WeightedPodAffinityTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.podAffinityTerm) this.podAffinityTerm = init.podAffinityTerm; + if (!init) { return; } + if (init.weight) { this.weight = init.weight; } + if (init.podAffinityTerm) { this.podAffinityTerm = init.podAffinityTerm; } } static emptyObject(): WeightedPodAffinityTerm { - let result = new WeightedPodAffinityTerm(); + const result = new WeightedPodAffinityTerm(); result.podAffinityTerm = PodAffinityTerm.emptyObject(); return result; } @@ -71,15 +71,15 @@ export class LabelSelectorRequirement { values: string[]; constructor(init?: LabelSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.values) { this.values = init.values; } } static emptyObject(): LabelSelectorRequirement { - let result = new LabelSelectorRequirement(); + const result = new LabelSelectorRequirement(); result.values = []; return result; } @@ -91,14 +91,14 @@ export class LabelSelector { matchExpressions: LabelSelectorRequirement[]; constructor(init?: LabelSelector) { - if (!init) return; - if (init.matchLabels) this.matchLabels = init.matchLabels; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchLabels) { this.matchLabels = init.matchLabels; } + if (init.matchExpressions) { this.matchExpressions = init.matchExpressions; } } static emptyObject(): LabelSelector { - let result = new LabelSelector(); + const result = new LabelSelector(); result.matchLabels = null; result.matchExpressions = []; return result; @@ -112,15 +112,15 @@ export class PodAffinityTerm { topologyKey: string; constructor(init?: PodAffinityTerm) { - if (!init) return; - if (init.labelSelector) this.labelSelector = init.labelSelector; - if (init.namespaces) this.namespaces = init.namespaces; - if (init.topologyKey) this.topologyKey = init.topologyKey; + if (!init) { return; } + if (init.labelSelector) { this.labelSelector = init.labelSelector; } + if (init.namespaces) { this.namespaces = init.namespaces; } + if (init.topologyKey) { this.topologyKey = init.topologyKey; } } static emptyObject(): PodAffinityTerm { - let result = new PodAffinityTerm(); + const result = new PodAffinityTerm(); result.labelSelector = LabelSelector.emptyObject(); result.namespaces = []; return result; @@ -133,14 +133,14 @@ export class PodAffinity { preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): PodAffinity { - let result = new PodAffinity(); + const result = new PodAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -153,14 +153,14 @@ export class PreferredSchedulingTerm { preference: NodeSelectorTerm; constructor(init?: PreferredSchedulingTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.preference) this.preference = init.preference; + if (!init) { return; } + if (init.weight) { this.weight = init.weight; } + if (init.preference) { this.preference = init.preference; } } static emptyObject(): PreferredSchedulingTerm { - let result = new PreferredSchedulingTerm(); + const result = new PreferredSchedulingTerm(); result.preference = NodeSelectorTerm.emptyObject(); return result; } @@ -173,15 +173,15 @@ export class NodeSelectorRequirement { values: string[]; constructor(init?: NodeSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.values) { this.values = init.values; } } static emptyObject(): NodeSelectorRequirement { - let result = new NodeSelectorRequirement(); + const result = new NodeSelectorRequirement(); result.values = []; return result; } @@ -192,13 +192,13 @@ export class NodeSelectorTerm { matchExpressions: NodeSelectorRequirement[]; constructor(init?: NodeSelectorTerm) { - if (!init) return; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchExpressions) { this.matchExpressions = init.matchExpressions; } } static emptyObject(): NodeSelectorTerm { - let result = new NodeSelectorTerm(); + const result = new NodeSelectorTerm(); result.matchExpressions = []; return result; } @@ -209,13 +209,13 @@ export class NodeSelector { nodeSelectorTerms: NodeSelectorTerm[]; constructor(init?: NodeSelector) { - if (!init) return; - if (init.nodeSelectorTerms) this.nodeSelectorTerms = init.nodeSelectorTerms; + if (!init) { return; } + if (init.nodeSelectorTerms) { this.nodeSelectorTerms = init.nodeSelectorTerms; } } static emptyObject(): NodeSelector { - let result = new NodeSelector(); + const result = new NodeSelector(); result.nodeSelectorTerms = []; return result; } @@ -227,14 +227,14 @@ export class NodeAffinity { preferredDuringSchedulingIgnoredDuringExecution: PreferredSchedulingTerm[]; constructor(init?: NodeAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): NodeAffinity { - let result = new NodeAffinity(); + const result = new NodeAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = NodeSelector.emptyObject(); result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -248,15 +248,15 @@ export class Affinity { podAntiAffinity?: PodAntiAffinity; constructor(init?: Affinity) { - if (!init) return; - if (init.nodeAffinity) this.nodeAffinity = init.nodeAffinity; - if (init.podAffinity) this.podAffinity = init.podAffinity; - if (init.podAntiAffinity) this.podAntiAffinity = init.podAntiAffinity; + if (!init) { return; } + if (init.nodeAffinity) { this.nodeAffinity = init.nodeAffinity; } + if (init.podAffinity) { this.podAffinity = init.podAffinity; } + if (init.podAntiAffinity) { this.podAntiAffinity = init.podAntiAffinity; } } static emptyObject(): Affinity { - let result = new Affinity(); + const result = new Affinity(); result.nodeAffinity = NodeAffinity.emptyObject(); result.podAffinity = PodAffinity.emptyObject(); result.podAntiAffinity = PodAntiAffinity.emptyObject(); @@ -272,16 +272,16 @@ export class DeploymentMetaData { privileged?: { [key: string]: boolean }; constructor(init?: DeploymentMetaData) { - if (!init) return; - if (init.replicas) this.replicas = init.replicas; - if (init.resources) this.resources = init.resources; - if (init.affinity) this.affinity = init.affinity; - if (init.privileged) this.privileged = init.privileged; + if (!init) { return; } + if (init.replicas) { this.replicas = init.replicas; } + if (init.resources) { this.resources = init.resources; } + if (init.affinity) { this.affinity = init.affinity; } + if (init.privileged) { this.privileged = init.privileged; } } static emptyObject(): DeploymentMetaData { - let result = new DeploymentMetaData(); + const result = new DeploymentMetaData(); result.replicas = null; result.resources = null; result.affinity = Affinity.emptyObject(); diff --git a/src/frontend/src/app/shared/model/v1/kubernetes/configmap.ts b/src/frontend/src/app/shared/model/v1/kubernetes/configmap.ts index c17198c77..ee683aed7 100644 --- a/src/frontend/src/app/shared/model/v1/kubernetes/configmap.ts +++ b/src/frontend/src/app/shared/model/v1/kubernetes/configmap.ts @@ -5,10 +5,6 @@ export class StatusCause { reason: string; message: string; field: string; - //[StatusCause:] - - - //[end] } export class StatusDetails { @@ -18,19 +14,11 @@ export class StatusDetails { uid: string; causes: StatusCause[]; retryAfterSeconds: number; - //[StatusDetails:] - - - //[end] } export class ListMeta { selfLink: string; resourceVersion: string; - //[ListMeta:] - - - //[end] } export class Status { @@ -42,27 +30,15 @@ export class Status { reason: string; details: StatusDetails; code: number; - //[Status:] - - - //[end] } export class Initializer { name: string; - //[Initializer:] - - - //[end] } export class Initializers { pending: Initializer[]; result: Status; - //[Initializers:] - - - //[end] } export class OwnerReference { @@ -72,17 +48,9 @@ export class OwnerReference { uid: string; controller: boolean; blockOwnerDeletion: boolean; - //[OwnerReference:] - - - //[end] } export class Time { - //[Time:] - - - //[end] } export class ObjectMeta { @@ -102,10 +70,6 @@ export class ObjectMeta { initializers: Initializers; finalizers: string[]; clusterName: string; - //[ObjectMeta:] - - - //[end] } export class KubeConfigMap { @@ -113,8 +77,4 @@ export class KubeConfigMap { apiVersion: string; metadata: ObjectMeta; data: {}; - //[ConfigMap:] - - - //[end] } diff --git a/src/frontend/src/app/shared/model/v1/kubernetes/cronjob.ts b/src/frontend/src/app/shared/model/v1/kubernetes/cronjob.ts index b41035ae3..1d6de5af1 100644 --- a/src/frontend/src/app/shared/model/v1/kubernetes/cronjob.ts +++ b/src/frontend/src/app/shared/model/v1/kubernetes/cronjob.ts @@ -9,28 +9,16 @@ export class ObjectReference { apiVersion: string; resourceVersion: string; fieldPath: string; - //[ObjectReference:] - - - //[end] } export class CronJobStatus { active: ObjectReference[]; lastScheduleTime: Time; - //[CronJobStatus:] - - - //[end] } export class HostAlias { ip: string; hostnames: string[]; - //[HostAlias:] - - - //[end] } export class Toleration { @@ -39,102 +27,58 @@ export class Toleration { value: string; effect: string; tolerationSeconds: number; - //[Toleration:] - - - //[end] } export class PodAntiAffinity { requiredDuringSchedulingIgnoredDuringExecution: PodAffinityTerm[]; preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; - //[PodAntiAffinity:] - - - //[end] } export class WeightedPodAffinityTerm { weight: number; podAffinityTerm: PodAffinityTerm; - //[WeightedPodAffinityTerm:] - - - //[end] } export class PodAffinityTerm { labelSelector: LabelSelector; namespaces: string[]; topologyKey: string; - //[PodAffinityTerm:] - - - //[end] } export class PodAffinity { requiredDuringSchedulingIgnoredDuringExecution: PodAffinityTerm[]; preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; - //[PodAffinity:] - - - //[end] } export class PreferredSchedulingTerm { weight: number; preference: NodeSelectorTerm; - //[PreferredSchedulingTerm:] - - - //[end] } export class NodeSelectorRequirement { key: string; operator: string; values: string[]; - //[NodeSelectorRequirement:] - - - //[end] } export class NodeSelectorTerm { matchExpressions: NodeSelectorRequirement[]; - //[NodeSelectorTerm:] - - - //[end] } export class NodeSelector { nodeSelectorTerms: NodeSelectorTerm[]; - //[NodeSelector:] - - - //[end] } export class NodeAffinity { requiredDuringSchedulingIgnoredDuringExecution: NodeSelector; preferredDuringSchedulingIgnoredDuringExecution: PreferredSchedulingTerm[]; - //[NodeAffinity:] - - - //[end] } export class Affinity { nodeAffinity: NodeAffinity; podAffinity: PodAffinity; podAntiAffinity: PodAntiAffinity; - //[Affinity:] - - - //[end] } @@ -144,10 +88,6 @@ export class PodSecurityContext { runAsNonRoot: boolean; supplementalGroups: number[]; fsGroup: number; - //[PodSecurityContext:] - - - //[end] } export class SELinuxOptions { @@ -155,19 +95,11 @@ export class SELinuxOptions { role: string; type: string; level: string; - //[SELinuxOptions:] - - - //[end] } export class Capabilities { add: string[]; drop: string[]; - //[Capabilities:] - - - //[end] } export class SecurityContext { @@ -177,10 +109,6 @@ export class SecurityContext { runAsUser: number; runAsNonRoot: boolean; readOnlyRootFilesystem: boolean; - //[SecurityContext:] - - - //[end] } @@ -190,45 +118,25 @@ export class Handler { exec: ExecAction; httpGet: HTTPGetAction; tcpSocket: TCPSocketAction; - //[Handler:] - - - //[end] } export class Lifecycle { postStart: Handler; preStop: Handler; - //[Lifecycle:] - - - //[end] } export class TCPSocketAction { port: IntOrString; host: string; - //[TCPSocketAction:] - - - //[end] } export class HTTPHeader { name: string; value: string; - //[HTTPHeader:] - - - //[end] } export class IntOrString { - //[IntOrString:] - - - //[end] } export class HTTPGetAction { @@ -237,18 +145,10 @@ export class HTTPGetAction { host: string; scheme: string; httpHeaders: HTTPHeader[]; - //[HTTPGetAction:] - - - //[end] } export class ExecAction { command: string[]; - //[ExecAction:] - - - //[end] } export class Probe { @@ -260,10 +160,6 @@ export class Probe { periodSeconds: number; successThreshold: number; failureThreshold: number; - //[Probe:] - - - //[end] } export class VolumeMount { @@ -271,10 +167,6 @@ export class VolumeMount { readOnly: boolean; mountPath: string; subPath: string; - //[VolumeMount:] - - - //[end] } export class ResourceRequirements { @@ -282,14 +174,14 @@ export class ResourceRequirements { requests?: { [key: string]: any }; constructor(init?: ResourceRequirements) { - if (!init) return; - if (init.limits) this.limits = init.limits; - if (init.requests) this.requests = init.requests; + if (!init) { return; } + if (init.limits) { this.limits = init.limits; } + if (init.requests) { this.requests = init.requests; } } static emptyObject(): ResourceRequirements { - let result = new ResourceRequirements(); + const result = new ResourceRequirements(); result.limits = null; result.requests = null; return result; @@ -300,20 +192,12 @@ export class SecretKeySelector { name: string; key: string; optional: boolean; - //[SecretKeySelector:] - - - //[end] } export class ConfigMapKeySelector { name: string; key: string; optional: boolean; - //[ConfigMapKeySelector:] - - - //[end] } @@ -322,48 +206,28 @@ export class EnvVarSource { resourceFieldRef: ResourceFieldSelector; configMapKeyRef: ConfigMapKeySelector; secretKeyRef: SecretKeySelector; - //[EnvVarSource:] - - - //[end] } export class EnvVar { name: string; value: string; valueFrom: EnvVarSource; - //[EnvVar:] - - - //[end] } export class SecretEnvSource { name: string; optional: boolean; - //[SecretEnvSource:] - - - //[end] } export class ConfigMapEnvSource { name: string; optional: boolean; - //[ConfigMapEnvSource:] - - - //[end] } export class EnvFromSource { prefix: string; configMapRef: ConfigMapEnvSource; secretRef: SecretEnvSource; - //[EnvFromSource:] - - - //[end] } export class ContainerPort { @@ -372,10 +236,6 @@ export class ContainerPort { containerPort: number; protocol: string; hostIP: string; - //[ContainerPort:] - - - //[end] } export class Container { @@ -399,10 +259,6 @@ export class Container { stdin: boolean; stdinOnce: boolean; tty: boolean; - //[Container:] - - - //[end] } export class StorageOSVolumeSource { @@ -411,10 +267,6 @@ export class StorageOSVolumeSource { fsType: string; readOnly: boolean; secretRef: LocalObjectReference; - //[StorageOSVolumeSource:] - - - //[end] } export class ScaleIOVolumeSource { @@ -428,76 +280,44 @@ export class ScaleIOVolumeSource { volumeName: string; fsType: string; readOnly: boolean; - //[ScaleIOVolumeSource:] - - - //[end] } export class PortworxVolumeSource { volumeID: string; fsType: string; readOnly: boolean; - //[PortworxVolumeSource:] - - - //[end] } export class ConfigMapProjection { name: string; items: KeyToPath[]; optional: boolean; - //[ConfigMapProjection:] - - - //[end] } export class DownwardAPIProjection { items: DownwardAPIVolumeFile[]; - //[DownwardAPIProjection:] - - - //[end] } export class SecretProjection { name: string; items: KeyToPath[]; optional: boolean; - //[SecretProjection:] - - - //[end] } export class VolumeProjection { secret: SecretProjection; downwardAPI: DownwardAPIProjection; configMap: ConfigMapProjection; - //[VolumeProjection:] - - - //[end] } export class ProjectedVolumeSource { sources: VolumeProjection[]; defaultMode: number; - //[ProjectedVolumeSource:] - - - //[end] } export class PhotonPersistentDiskVolumeSource { pdID: string; fsType: string; - //[PhotonPersistentDiskVolumeSource:] - - - //[end] } export class AzureDiskVolumeSource { @@ -507,10 +327,6 @@ export class AzureDiskVolumeSource { fsType: string; readOnly: boolean; kind: string; - //[AzureDiskVolumeSource:] - - - //[end] } export class QuobyteVolumeSource { @@ -519,10 +335,6 @@ export class QuobyteVolumeSource { readOnly: boolean; user: string; group: string; - //[QuobyteVolumeSource:] - - - //[end] } export class VsphereVirtualDiskVolumeSource { @@ -530,10 +342,6 @@ export class VsphereVirtualDiskVolumeSource { fsType: string; storagePolicyName: string; storagePolicyID: string; - //[VsphereVirtualDiskVolumeSource:] - - - //[end] } export class ConfigMapVolumeSource { @@ -541,20 +349,12 @@ export class ConfigMapVolumeSource { items: KeyToPath[]; defaultMode: number; optional: boolean; - //[ConfigMapVolumeSource:] - - - //[end] } export class AzureFileVolumeSource { secretName: string; shareName: string; readOnly: boolean; - //[AzureFileVolumeSource:] - - - //[end] } export class FCVolumeSource { @@ -562,29 +362,17 @@ export class FCVolumeSource { lun: number; fsType: string; readOnly: boolean; - //[FCVolumeSource:] - - - //[end] } export class ResourceFieldSelector { containerName: string; resource: string; divisor: Quantity; - //[ResourceFieldSelector:] - - - //[end] } export class ObjectFieldSelector { apiVersion: string; fieldPath: string; - //[ObjectFieldSelector:] - - - //[end] } export class DownwardAPIVolumeFile { @@ -592,28 +380,16 @@ export class DownwardAPIVolumeFile { fieldRef: ObjectFieldSelector; resourceFieldRef: ResourceFieldSelector; mode: number; - //[DownwardAPIVolumeFile:] - - - //[end] } export class DownwardAPIVolumeSource { items: DownwardAPIVolumeFile[]; defaultMode: number; - //[DownwardAPIVolumeSource:] - - - //[end] } export class FlockerVolumeSource { datasetName: string; datasetUUID: string; - //[FlockerVolumeSource:] - - - //[end] } export class CephFSVolumeSource { @@ -623,20 +399,12 @@ export class CephFSVolumeSource { secretFile: string; secretRef: LocalObjectReference; readOnly: boolean; - //[CephFSVolumeSource:] - - - //[end] } export class CinderVolumeSource { volumeID: string; fsType: string; readOnly: boolean; - //[CinderVolumeSource:] - - - //[end] } export class FlexVolumeSource { @@ -645,10 +413,6 @@ export class FlexVolumeSource { secretRef: LocalObjectReference; readOnly: boolean; options: {}; - //[FlexVolumeSource:] - - - //[end] } export class RBDVolumeSource { @@ -660,37 +424,21 @@ export class RBDVolumeSource { keyring: string; secretRef: LocalObjectReference; readOnly: boolean; - //[RBDVolumeSource:] - - - //[end] } export class PersistentVolumeClaimVolumeSource { claimName: string; readOnly: boolean; - //[PersistentVolumeClaimVolumeSource:] - - - //[end] } export class GlusterfsVolumeSource { endpoints: string; path: string; readOnly: boolean; - //[GlusterfsVolumeSource:] - - - //[end] } export class LocalObjectReference { name: string; - //[LocalObjectReference:] - - - //[end] } export class ISCSIVolumeSource { @@ -704,30 +452,18 @@ export class ISCSIVolumeSource { chapAuthDiscovery: boolean; chapAuthSession: boolean; secretRef: LocalObjectReference; - //[ISCSIVolumeSource:] - - - //[end] } export class NFSVolumeSource { server: string; path: string; readOnly: boolean; - //[NFSVolumeSource:] - - - //[end] } export class KeyToPath { key: string; path: string; mode: number; - //[KeyToPath:] - - - //[end] } export class SecretVolumeSource { @@ -735,20 +471,12 @@ export class SecretVolumeSource { items: KeyToPath[]; defaultMode: number; optional: boolean; - //[SecretVolumeSource:] - - - //[end] } export class GitRepoVolumeSource { repository: string; revision: string; directory: string; - //[GitRepoVolumeSource:] - - - //[end] } export class AWSElasticBlockStoreVolumeSource { @@ -756,10 +484,6 @@ export class AWSElasticBlockStoreVolumeSource { fsType: string; partition: number; readOnly: boolean; - //[AWSElasticBlockStoreVolumeSource:] - - - //[end] } export class GCEPersistentDiskVolumeSource { @@ -767,14 +491,10 @@ export class GCEPersistentDiskVolumeSource { fsType: string; partition: number; readOnly: boolean; - //[GCEPersistentDiskVolumeSource:] - - - //[end] } export class Quantity { - //[Quantity:] + //[end] @@ -783,18 +503,10 @@ export class Quantity { export class EmptyDirVolumeSource { medium: string; sizeLimit: Quantity; - //[EmptyDirVolumeSource:] - - - //[end] } export class HostPathVolumeSource { path: string; - //[HostPathVolumeSource:] - - - //[end] } export class Volume { @@ -826,10 +538,6 @@ export class Volume { portworxVolume: PortworxVolumeSource; scaleIO: ScaleIOVolumeSource; storageos: StorageOSVolumeSource; - //[Volume:] - - - //[end] } export class PodSpec { @@ -856,38 +564,22 @@ export class PodSpec { schedulerName: string; tolerations: Toleration[]; hostAliases: HostAlias[]; - //[PodSpec:] - - - //[end] } export class PodTemplateSpec { metadata: ObjectMeta; spec: PodSpec; - //[PodTemplateSpec:] - - - //[end] } export class LabelSelectorRequirement { key: string; operator: string; values: string[]; - //[LabelSelectorRequirement:] - - - //[end] } export class LabelSelector { matchLabels: {}; matchExpressions: LabelSelectorRequirement[]; - //[LabelSelector:] - - - //[end] } export class JobSpec { @@ -897,19 +589,11 @@ export class JobSpec { selector: LabelSelector; manualSelector: boolean; template: PodTemplateSpec; - //[JobSpec:] - - - //[end] } export class JobTemplateSpec { metadata: ObjectMeta; spec: JobSpec; - //[JobTemplateSpec:] - - - //[end] } export class CronJobSpec { @@ -920,20 +604,12 @@ export class CronJobSpec { jobTemplate: JobTemplateSpec; successfulJobsHistoryLimit: number; failedJobsHistoryLimit: number; - //[CronJobSpec:] - - - //[end] } export class StatusCause { reason: string; message: string; field: string; - //[StatusCause:] - - - //[end] } export class StatusDetails { @@ -943,19 +619,11 @@ export class StatusDetails { uid: string; causes: StatusCause[]; retryAfterSeconds: number; - //[StatusDetails:] - - - //[end] } export class ListMeta { selfLink: string; resourceVersion: string; - //[ListMeta:] - - - //[end] } export class Status { @@ -967,27 +635,15 @@ export class Status { reason: string; details: StatusDetails; code: number; - //[Status:] - - - //[end] } export class Initializer { name: string; - //[Initializer:] - - - //[end] } export class Initializers { pending: Initializer[]; result: Status; - //[Initializers:] - - - //[end] } export class OwnerReference { @@ -997,17 +653,9 @@ export class OwnerReference { uid: string; controller: boolean; blockOwnerDeletion: boolean; - //[OwnerReference:] - - - //[end] } export class Time { - //[Time:] - - - //[end] } export class ObjectMeta { @@ -1027,10 +675,6 @@ export class ObjectMeta { initializers: Initializers; finalizers: string[]; clusterName: string; - //[ObjectMeta:] - - - //[end] } export class KubeCronJob { @@ -1039,8 +683,4 @@ export class KubeCronJob { metadata: ObjectMeta; spec: CronJobSpec; status: CronJobStatus; - //[CronJob:] - - - //[end] } diff --git a/src/frontend/src/app/shared/model/v1/kubernetes/daemonset.ts b/src/frontend/src/app/shared/model/v1/kubernetes/daemonset.ts index fb796611b..ac8f3afa7 100644 --- a/src/frontend/src/app/shared/model/v1/kubernetes/daemonset.ts +++ b/src/frontend/src/app/shared/model/v1/kubernetes/daemonset.ts @@ -9,17 +9,17 @@ export class DaemonSetCondition { message: string; constructor(init?: DaemonSetCondition) { - if (!init) return; - if (init.type) this.type = init.type; - if (init.status) this.status = init.status; - if (init.lastTransitionTime) this.lastTransitionTime = init.lastTransitionTime; - if (init.reason) this.reason = init.reason; - if (init.message) this.message = init.message; + if (!init) { return; } + if (init.type) { this.type = init.type; } + if (init.status) { this.status = init.status; } + if (init.lastTransitionTime) { this.lastTransitionTime = init.lastTransitionTime; } + if (init.reason) { this.reason = init.reason; } + if (init.message) { this.message = init.message; } } static emptyObject(): DaemonSetCondition { - let result = new DaemonSetCondition(); + const result = new DaemonSetCondition(); result.lastTransitionTime = Time.emptyObject(); return result; } @@ -39,22 +39,22 @@ export class DaemonSetStatus { conditions: DaemonSetCondition[]; constructor(init?: DaemonSetStatus) { - if (!init) return; - if (init.currentNumberScheduled) this.currentNumberScheduled = init.currentNumberScheduled; - if (init.numberMisscheduled) this.numberMisscheduled = init.numberMisscheduled; - if (init.desiredNumberScheduled) this.desiredNumberScheduled = init.desiredNumberScheduled; - if (init.numberReady) this.numberReady = init.numberReady; - if (init.observedGeneration) this.observedGeneration = init.observedGeneration; - if (init.updatedNumberScheduled) this.updatedNumberScheduled = init.updatedNumberScheduled; - if (init.numberAvailable) this.numberAvailable = init.numberAvailable; - if (init.numberUnavailable) this.numberUnavailable = init.numberUnavailable; - if (init.collisionCount) this.collisionCount = init.collisionCount; - if (init.conditions) this.conditions = init.conditions; + if (!init) { return; } + if (init.currentNumberScheduled) { this.currentNumberScheduled = init.currentNumberScheduled; } + if (init.numberMisscheduled) { this.numberMisscheduled = init.numberMisscheduled; } + if (init.desiredNumberScheduled) { this.desiredNumberScheduled = init.desiredNumberScheduled; } + if (init.numberReady) { this.numberReady = init.numberReady; } + if (init.observedGeneration) { this.observedGeneration = init.observedGeneration; } + if (init.updatedNumberScheduled) { this.updatedNumberScheduled = init.updatedNumberScheduled; } + if (init.numberAvailable) { this.numberAvailable = init.numberAvailable; } + if (init.numberUnavailable) { this.numberUnavailable = init.numberUnavailable; } + if (init.collisionCount) { this.collisionCount = init.collisionCount; } + if (init.conditions) { this.conditions = init.conditions; } } static emptyObject(): DaemonSetStatus { - let result = new DaemonSetStatus(); + const result = new DaemonSetStatus(); result.conditions = []; return result; } @@ -65,13 +65,13 @@ export class RollingUpdateDaemonSet { maxUnavailable?: IntOrString; constructor(init?: RollingUpdateDaemonSet) { - if (!init) return; - if (init.maxUnavailable) this.maxUnavailable = init.maxUnavailable; + if (!init) { return; } + if (init.maxUnavailable) { this.maxUnavailable = init.maxUnavailable; } } static emptyObject(): RollingUpdateDaemonSet { - let result = new RollingUpdateDaemonSet(); + const result = new RollingUpdateDaemonSet(); result.maxUnavailable = IntOrString.emptyObject(); return result; } @@ -83,14 +83,14 @@ export class DaemonSetUpdateStrategy { rollingUpdate?: RollingUpdateDaemonSet; constructor(init?: DaemonSetUpdateStrategy) { - if (!init) return; - if (init.type) this.type = init.type; - if (init.rollingUpdate) this.rollingUpdate = init.rollingUpdate; + if (!init) { return; } + if (init.type) { this.type = init.type; } + if (init.rollingUpdate) { this.rollingUpdate = init.rollingUpdate; } } static emptyObject(): DaemonSetUpdateStrategy { - let result = new DaemonSetUpdateStrategy(); + const result = new DaemonSetUpdateStrategy(); result.rollingUpdate = RollingUpdateDaemonSet.emptyObject(); return result; } @@ -102,14 +102,14 @@ export class PodDNSConfigOption { value?: string; constructor(init?: PodDNSConfigOption) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.value) this.value = init.value; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.value) { this.value = init.value; } } static emptyObject(): PodDNSConfigOption { - let result = new PodDNSConfigOption(); + const result = new PodDNSConfigOption(); return result; } @@ -121,15 +121,15 @@ export class PodDNSConfig { options: PodDNSConfigOption[]; constructor(init?: PodDNSConfig) { - if (!init) return; - if (init.nameservers) this.nameservers = init.nameservers; - if (init.searches) this.searches = init.searches; - if (init.options) this.options = init.options; + if (!init) { return; } + if (init.nameservers) { this.nameservers = init.nameservers; } + if (init.searches) { this.searches = init.searches; } + if (init.options) { this.options = init.options; } } static emptyObject(): PodDNSConfig { - let result = new PodDNSConfig(); + const result = new PodDNSConfig(); result.nameservers = []; result.searches = []; result.options = []; @@ -143,14 +143,14 @@ export class HostAlias { hostnames: string[]; constructor(init?: HostAlias) { - if (!init) return; - if (init.ip) this.ip = init.ip; - if (init.hostnames) this.hostnames = init.hostnames; + if (!init) { return; } + if (init.ip) { this.ip = init.ip; } + if (init.hostnames) { this.hostnames = init.hostnames; } } static emptyObject(): HostAlias { - let result = new HostAlias(); + const result = new HostAlias(); result.hostnames = []; return result; } @@ -165,17 +165,17 @@ export class Toleration { tolerationSeconds?: number; constructor(init?: Toleration) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.value) this.value = init.value; - if (init.effect) this.effect = init.effect; - if (init.tolerationSeconds) this.tolerationSeconds = init.tolerationSeconds; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.value) { this.value = init.value; } + if (init.effect) { this.effect = init.effect; } + if (init.tolerationSeconds) { this.tolerationSeconds = init.tolerationSeconds; } } static emptyObject(): Toleration { - let result = new Toleration(); + const result = new Toleration(); return result; } @@ -187,14 +187,18 @@ export class PodAntiAffinity { preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAntiAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; + } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + } } static emptyObject(): PodAntiAffinity { - let result = new PodAntiAffinity(); + const result = new PodAntiAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -207,14 +211,14 @@ export class WeightedPodAffinityTerm { podAffinityTerm: PodAffinityTerm; constructor(init?: WeightedPodAffinityTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.podAffinityTerm) this.podAffinityTerm = init.podAffinityTerm; + if (!init) { return; } + if (init.weight) { this.weight = init.weight; } + if (init.podAffinityTerm) { this.podAffinityTerm = init.podAffinityTerm; } } static emptyObject(): WeightedPodAffinityTerm { - let result = new WeightedPodAffinityTerm(); + const result = new WeightedPodAffinityTerm(); result.podAffinityTerm = PodAffinityTerm.emptyObject(); return result; } @@ -227,15 +231,15 @@ export class PodAffinityTerm { topologyKey: string; constructor(init?: PodAffinityTerm) { - if (!init) return; - if (init.labelSelector) this.labelSelector = init.labelSelector; - if (init.namespaces) this.namespaces = init.namespaces; - if (init.topologyKey) this.topologyKey = init.topologyKey; + if (!init) { return; } + if (init.labelSelector) { this.labelSelector = init.labelSelector; } + if (init.namespaces) { this.namespaces = init.namespaces; } + if (init.topologyKey) { this.topologyKey = init.topologyKey; } } static emptyObject(): PodAffinityTerm { - let result = new PodAffinityTerm(); + const result = new PodAffinityTerm(); result.labelSelector = LabelSelector.emptyObject(); result.namespaces = []; return result; @@ -248,14 +252,18 @@ export class PodAffinity { preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; + } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + } } static emptyObject(): PodAffinity { - let result = new PodAffinity(); + const result = new PodAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -268,14 +276,14 @@ export class PreferredSchedulingTerm { preference: NodeSelectorTerm; constructor(init?: PreferredSchedulingTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.preference) this.preference = init.preference; + if (!init) { return; } + if (init.weight) { this.weight = init.weight; } + if (init.preference) { this.preference = init.preference; } } static emptyObject(): PreferredSchedulingTerm { - let result = new PreferredSchedulingTerm(); + const result = new PreferredSchedulingTerm(); result.preference = NodeSelectorTerm.emptyObject(); return result; } @@ -288,15 +296,15 @@ export class NodeSelectorRequirement { values: string[]; constructor(init?: NodeSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.values) { this.values = init.values; } } static emptyObject(): NodeSelectorRequirement { - let result = new NodeSelectorRequirement(); + const result = new NodeSelectorRequirement(); result.values = []; return result; } @@ -307,13 +315,13 @@ export class NodeSelectorTerm { matchExpressions: NodeSelectorRequirement[]; constructor(init?: NodeSelectorTerm) { - if (!init) return; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchExpressions) { this.matchExpressions = init.matchExpressions; } } static emptyObject(): NodeSelectorTerm { - let result = new NodeSelectorTerm(); + const result = new NodeSelectorTerm(); result.matchExpressions = []; return result; } @@ -324,13 +332,13 @@ export class NodeSelector { nodeSelectorTerms: NodeSelectorTerm[]; constructor(init?: NodeSelector) { - if (!init) return; - if (init.nodeSelectorTerms) this.nodeSelectorTerms = init.nodeSelectorTerms; + if (!init) { return; } + if (init.nodeSelectorTerms) { this.nodeSelectorTerms = init.nodeSelectorTerms; } } static emptyObject(): NodeSelector { - let result = new NodeSelector(); + const result = new NodeSelector(); result.nodeSelectorTerms = []; return result; } @@ -342,14 +350,18 @@ export class NodeAffinity { preferredDuringSchedulingIgnoredDuringExecution: PreferredSchedulingTerm[]; constructor(init?: NodeAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; + } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + } } static emptyObject(): NodeAffinity { - let result = new NodeAffinity(); + const result = new NodeAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = NodeSelector.emptyObject(); result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -363,15 +375,15 @@ export class Affinity { podAntiAffinity?: PodAntiAffinity; constructor(init?: Affinity) { - if (!init) return; - if (init.nodeAffinity) this.nodeAffinity = init.nodeAffinity; - if (init.podAffinity) this.podAffinity = init.podAffinity; - if (init.podAntiAffinity) this.podAntiAffinity = init.podAntiAffinity; + if (!init) { return; } + if (init.nodeAffinity) { this.nodeAffinity = init.nodeAffinity; } + if (init.podAffinity) { this.podAffinity = init.podAffinity; } + if (init.podAntiAffinity) { this.podAntiAffinity = init.podAntiAffinity; } } static emptyObject(): Affinity { - let result = new Affinity(); + const result = new Affinity(); result.nodeAffinity = NodeAffinity.emptyObject(); result.podAffinity = PodAffinity.emptyObject(); result.podAntiAffinity = PodAntiAffinity.emptyObject(); @@ -390,18 +402,18 @@ export class PodSecurityContext { fsGroup?: number; constructor(init?: PodSecurityContext) { - if (!init) return; - if (init.seLinuxOptions) this.seLinuxOptions = init.seLinuxOptions; - if (init.runAsUser) this.runAsUser = init.runAsUser; - if (init.runAsGroup) this.runAsGroup = init.runAsGroup; - if (init.runAsNonRoot) this.runAsNonRoot = init.runAsNonRoot; - if (init.supplementalGroups) this.supplementalGroups = init.supplementalGroups; - if (init.fsGroup) this.fsGroup = init.fsGroup; + if (!init) { return; } + if (init.seLinuxOptions) { this.seLinuxOptions = init.seLinuxOptions; } + if (init.runAsUser) { this.runAsUser = init.runAsUser; } + if (init.runAsGroup) { this.runAsGroup = init.runAsGroup; } + if (init.runAsNonRoot) { this.runAsNonRoot = init.runAsNonRoot; } + if (init.supplementalGroups) { this.supplementalGroups = init.supplementalGroups; } + if (init.fsGroup) { this.fsGroup = init.fsGroup; } } static emptyObject(): PodSecurityContext { - let result = new PodSecurityContext(); + const result = new PodSecurityContext(); result.seLinuxOptions = SELinuxOptions.emptyObject(); result.supplementalGroups = []; return result; @@ -416,16 +428,16 @@ export class SELinuxOptions { level: string; constructor(init?: SELinuxOptions) { - if (!init) return; - if (init.user) this.user = init.user; - if (init.role) this.role = init.role; - if (init.type) this.type = init.type; - if (init.level) this.level = init.level; + if (!init) { return; } + if (init.user) { this.user = init.user; } + if (init.role) { this.role = init.role; } + if (init.type) { this.type = init.type; } + if (init.level) { this.level = init.level; } } static emptyObject(): SELinuxOptions { - let result = new SELinuxOptions(); + const result = new SELinuxOptions(); return result; } @@ -436,14 +448,14 @@ export class Capabilities { drop: string[]; constructor(init?: Capabilities) { - if (!init) return; - if (init.add) this.add = init.add; - if (init.drop) this.drop = init.drop; + if (!init) { return; } + if (init.add) { this.add = init.add; } + if (init.drop) { this.drop = init.drop; } } static emptyObject(): Capabilities { - let result = new Capabilities(); + const result = new Capabilities(); result.add = []; result.drop = []; return result; @@ -462,20 +474,20 @@ export class SecurityContext { allowPrivilegeEscalation?: boolean; constructor(init?: SecurityContext) { - if (!init) return; - if (init.capabilities) this.capabilities = init.capabilities; - if (init.privileged) this.privileged = init.privileged; - if (init.seLinuxOptions) this.seLinuxOptions = init.seLinuxOptions; - if (init.runAsUser) this.runAsUser = init.runAsUser; - if (init.runAsGroup) this.runAsGroup = init.runAsGroup; - if (init.runAsNonRoot) this.runAsNonRoot = init.runAsNonRoot; - if (init.readOnlyRootFilesystem) this.readOnlyRootFilesystem = init.readOnlyRootFilesystem; - if (init.allowPrivilegeEscalation) this.allowPrivilegeEscalation = init.allowPrivilegeEscalation; + if (!init) { return; } + if (init.capabilities) { this.capabilities = init.capabilities; } + if (init.privileged) { this.privileged = init.privileged; } + if (init.seLinuxOptions) { this.seLinuxOptions = init.seLinuxOptions; } + if (init.runAsUser) { this.runAsUser = init.runAsUser; } + if (init.runAsGroup) { this.runAsGroup = init.runAsGroup; } + if (init.runAsNonRoot) { this.runAsNonRoot = init.runAsNonRoot; } + if (init.readOnlyRootFilesystem) { this.readOnlyRootFilesystem = init.readOnlyRootFilesystem; } + if (init.allowPrivilegeEscalation) { this.allowPrivilegeEscalation = init.allowPrivilegeEscalation; } } static emptyObject(): SecurityContext { - let result = new SecurityContext(); + const result = new SecurityContext(); result.capabilities = Capabilities.emptyObject(); result.seLinuxOptions = SELinuxOptions.emptyObject(); return result; @@ -492,15 +504,15 @@ export class Handler { tcpSocket?: TCPSocketAction; constructor(init?: Handler) { - if (!init) return; - if (init.exec) this.exec = init.exec; - if (init.httpGet) this.httpGet = init.httpGet; - if (init.tcpSocket) this.tcpSocket = init.tcpSocket; + if (!init) { return; } + if (init.exec) { this.exec = init.exec; } + if (init.httpGet) { this.httpGet = init.httpGet; } + if (init.tcpSocket) { this.tcpSocket = init.tcpSocket; } } static emptyObject(): Handler { - let result = new Handler(); + const result = new Handler(); result.exec = ExecAction.emptyObject(); result.httpGet = HTTPGetAction.emptyObject(); result.tcpSocket = TCPSocketAction.emptyObject(); @@ -514,14 +526,14 @@ export class Lifecycle { preStop?: Handler; constructor(init?: Lifecycle) { - if (!init) return; - if (init.postStart) this.postStart = init.postStart; - if (init.preStop) this.preStop = init.preStop; + if (!init) { return; } + if (init.postStart) { this.postStart = init.postStart; } + if (init.preStop) { this.preStop = init.preStop; } } static emptyObject(): Lifecycle { - let result = new Lifecycle(); + const result = new Lifecycle(); result.postStart = Handler.emptyObject(); result.preStop = Handler.emptyObject(); return result; @@ -535,14 +547,14 @@ export class TCPSocketAction { host: string; constructor(init?: TCPSocketAction) { - if (!init) return; - if (init.port) this.port = init.port; - if (init.host) this.host = init.host; + if (!init) { return; } + if (init.port) { this.port = init.port; } + if (init.host) { this.host = init.host; } } static emptyObject(): TCPSocketAction { - let result = new TCPSocketAction(); + const result = new TCPSocketAction(); result.port = IntOrString.emptyObject(); return result; } @@ -554,14 +566,14 @@ export class HTTPHeader { value: string; constructor(init?: HTTPHeader) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.value) this.value = init.value; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.value) { this.value = init.value; } } static emptyObject(): HTTPHeader { - let result = new HTTPHeader(); + const result = new HTTPHeader(); return result; } @@ -573,15 +585,15 @@ export class IntOrString { StrVal: string; constructor(init?: IntOrString) { - if (!init) return; - if (init.Type) this.Type = init.Type; - if (init.IntVal) this.IntVal = init.IntVal; - if (init.StrVal) this.StrVal = init.StrVal; + if (!init) { return; } + if (init.Type) { this.Type = init.Type; } + if (init.IntVal) { this.IntVal = init.IntVal; } + if (init.StrVal) { this.StrVal = init.StrVal; } } static emptyObject(): IntOrString { - let result = new IntOrString(); + const result = new IntOrString(); return result; } @@ -595,17 +607,17 @@ export class HTTPGetAction { httpHeaders: HTTPHeader[]; constructor(init?: HTTPGetAction) { - if (!init) return; - if (init.path) this.path = init.path; - if (init.port) this.port = init.port; - if (init.host) this.host = init.host; - if (init.scheme) this.scheme = init.scheme; - if (init.httpHeaders) this.httpHeaders = init.httpHeaders; + if (!init) { return; } + if (init.path) { this.path = init.path; } + if (init.port) { this.port = init.port; } + if (init.host) { this.host = init.host; } + if (init.scheme) { this.scheme = init.scheme; } + if (init.httpHeaders) { this.httpHeaders = init.httpHeaders; } } static emptyObject(): HTTPGetAction { - let result = new HTTPGetAction(); + const result = new HTTPGetAction(); result.port = IntOrString.emptyObject(); result.httpHeaders = []; return result; @@ -617,13 +629,13 @@ export class ExecAction { command: string[]; constructor(init?: ExecAction) { - if (!init) return; - if (init.command) this.command = init.command; + if (!init) { return; } + if (init.command) { this.command = init.command; } } static emptyObject(): ExecAction { - let result = new ExecAction(); + const result = new ExecAction(); result.command = []; return result; } @@ -641,20 +653,20 @@ export class Probe { failureThreshold: number; constructor(init?: Probe) { - if (!init) return; - if (init.exec) this.exec = init.exec; - if (init.httpGet) this.httpGet = init.httpGet; - if (init.tcpSocket) this.tcpSocket = init.tcpSocket; - if (init.initialDelaySeconds) this.initialDelaySeconds = init.initialDelaySeconds; - if (init.timeoutSeconds) this.timeoutSeconds = init.timeoutSeconds; - if (init.periodSeconds) this.periodSeconds = init.periodSeconds; - if (init.successThreshold) this.successThreshold = init.successThreshold; - if (init.failureThreshold) this.failureThreshold = init.failureThreshold; + if (!init) { return; } + if (init.exec) { this.exec = init.exec; } + if (init.httpGet) { this.httpGet = init.httpGet; } + if (init.tcpSocket) { this.tcpSocket = init.tcpSocket; } + if (init.initialDelaySeconds) { this.initialDelaySeconds = init.initialDelaySeconds; } + if (init.timeoutSeconds) { this.timeoutSeconds = init.timeoutSeconds; } + if (init.periodSeconds) { this.periodSeconds = init.periodSeconds; } + if (init.successThreshold) { this.successThreshold = init.successThreshold; } + if (init.failureThreshold) { this.failureThreshold = init.failureThreshold; } } static emptyObject(): Probe { - let result = new Probe(); + const result = new Probe(); result.exec = ExecAction.emptyObject(); result.httpGet = HTTPGetAction.emptyObject(); result.tcpSocket = TCPSocketAction.emptyObject(); @@ -668,14 +680,14 @@ export class VolumeDevice { devicePath: string; constructor(init?: VolumeDevice) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.devicePath) this.devicePath = init.devicePath; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.devicePath) { this.devicePath = init.devicePath; } } static emptyObject(): VolumeDevice { - let result = new VolumeDevice(); + const result = new VolumeDevice(); return result; } @@ -689,17 +701,17 @@ export class VolumeMount { mountPropagation?: string; constructor(init?: VolumeMount) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.mountPath) this.mountPath = init.mountPath; - if (init.subPath) this.subPath = init.subPath; - if (init.mountPropagation) this.mountPropagation = init.mountPropagation; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.mountPath) { this.mountPath = init.mountPath; } + if (init.subPath) { this.subPath = init.subPath; } + if (init.mountPropagation) { this.mountPropagation = init.mountPropagation; } } static emptyObject(): VolumeMount { - let result = new VolumeMount(); + const result = new VolumeMount(); return result; } @@ -710,14 +722,14 @@ export class ResourceRequirements { requests?: { [key: string]: any }; constructor(init?: ResourceRequirements) { - if (!init) return; - if (init.limits) this.limits = init.limits; - if (init.requests) this.requests = init.requests; + if (!init) { return; } + if (init.limits) { this.limits = init.limits; } + if (init.requests) { this.requests = init.requests; } } static emptyObject(): ResourceRequirements { - let result = new ResourceRequirements(); + const result = new ResourceRequirements(); result.limits = null; result.requests = null; return result; @@ -731,15 +743,15 @@ export class SecretKeySelector { optional?: boolean; constructor(init?: SecretKeySelector) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.key) this.key = init.key; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.key) { this.key = init.key; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): SecretKeySelector { - let result = new SecretKeySelector(); + const result = new SecretKeySelector(); return result; } @@ -751,15 +763,15 @@ export class ConfigMapKeySelector { optional?: boolean; constructor(init?: ConfigMapKeySelector) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.key) this.key = init.key; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.key) { this.key = init.key; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): ConfigMapKeySelector { - let result = new ConfigMapKeySelector(); + const result = new ConfigMapKeySelector(); return result; } @@ -773,16 +785,16 @@ export class EnvVarSource { secretKeyRef?: SecretKeySelector; constructor(init?: EnvVarSource) { - if (!init) return; - if (init.fieldRef) this.fieldRef = init.fieldRef; - if (init.resourceFieldRef) this.resourceFieldRef = init.resourceFieldRef; - if (init.configMapKeyRef) this.configMapKeyRef = init.configMapKeyRef; - if (init.secretKeyRef) this.secretKeyRef = init.secretKeyRef; + if (!init) { return; } + if (init.fieldRef) { this.fieldRef = init.fieldRef; } + if (init.resourceFieldRef) { this.resourceFieldRef = init.resourceFieldRef; } + if (init.configMapKeyRef) { this.configMapKeyRef = init.configMapKeyRef; } + if (init.secretKeyRef) { this.secretKeyRef = init.secretKeyRef; } } static emptyObject(): EnvVarSource { - let result = new EnvVarSource(); + const result = new EnvVarSource(); result.fieldRef = ObjectFieldSelector.emptyObject(); result.resourceFieldRef = ResourceFieldSelector.emptyObject(); result.configMapKeyRef = ConfigMapKeySelector.emptyObject(); @@ -798,15 +810,15 @@ export class EnvVar { valueFrom?: EnvVarSource; constructor(init?: EnvVar) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.value) this.value = init.value; - if (init.valueFrom) this.valueFrom = init.valueFrom; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.value) { this.value = init.value; } + if (init.valueFrom) { this.valueFrom = init.valueFrom; } } static emptyObject(): EnvVar { - let result = new EnvVar(); + const result = new EnvVar(); result.valueFrom = EnvVarSource.emptyObject(); return result; } @@ -818,14 +830,14 @@ export class SecretEnvSource { optional?: boolean; constructor(init?: SecretEnvSource) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): SecretEnvSource { - let result = new SecretEnvSource(); + const result = new SecretEnvSource(); return result; } @@ -836,14 +848,14 @@ export class ConfigMapEnvSource { optional?: boolean; constructor(init?: ConfigMapEnvSource) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): ConfigMapEnvSource { - let result = new ConfigMapEnvSource(); + const result = new ConfigMapEnvSource(); return result; } @@ -855,15 +867,15 @@ export class EnvFromSource { secretRef?: SecretEnvSource; constructor(init?: EnvFromSource) { - if (!init) return; - if (init.prefix) this.prefix = init.prefix; - if (init.configMapRef) this.configMapRef = init.configMapRef; - if (init.secretRef) this.secretRef = init.secretRef; + if (!init) { return; } + if (init.prefix) { this.prefix = init.prefix; } + if (init.configMapRef) { this.configMapRef = init.configMapRef; } + if (init.secretRef) { this.secretRef = init.secretRef; } } static emptyObject(): EnvFromSource { - let result = new EnvFromSource(); + const result = new EnvFromSource(); result.configMapRef = ConfigMapEnvSource.emptyObject(); result.secretRef = SecretEnvSource.emptyObject(); return result; @@ -879,17 +891,17 @@ export class ContainerPort { hostIP: string; constructor(init?: ContainerPort) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.hostPort) this.hostPort = init.hostPort; - if (init.containerPort) this.containerPort = init.containerPort; - if (init.protocol) this.protocol = init.protocol; - if (init.hostIP) this.hostIP = init.hostIP; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.hostPort) { this.hostPort = init.hostPort; } + if (init.containerPort) { this.containerPort = init.containerPort; } + if (init.protocol) { this.protocol = init.protocol; } + if (init.hostIP) { this.hostIP = init.hostIP; } } static emptyObject(): ContainerPort { - let result = new ContainerPort(); + const result = new ContainerPort(); return result; } @@ -919,33 +931,33 @@ export class Container { tty: boolean; constructor(init?: Container) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.image) this.image = init.image; - if (init.command) this.command = init.command; - if (init.args) this.args = init.args; - if (init.workingDir) this.workingDir = init.workingDir; - if (init.ports) this.ports = init.ports; - if (init.envFrom) this.envFrom = init.envFrom; - if (init.env) this.env = init.env; - if (init.resources) this.resources = init.resources; - if (init.volumeMounts) this.volumeMounts = init.volumeMounts; - if (init.volumeDevices) this.volumeDevices = init.volumeDevices; - if (init.livenessProbe) this.livenessProbe = init.livenessProbe; - if (init.readinessProbe) this.readinessProbe = init.readinessProbe; - if (init.lifecycle) this.lifecycle = init.lifecycle; - if (init.terminationMessagePath) this.terminationMessagePath = init.terminationMessagePath; - if (init.terminationMessagePolicy) this.terminationMessagePolicy = init.terminationMessagePolicy; - if (init.imagePullPolicy) this.imagePullPolicy = init.imagePullPolicy; - if (init.securityContext) this.securityContext = init.securityContext; - if (init.stdin) this.stdin = init.stdin; - if (init.stdinOnce) this.stdinOnce = init.stdinOnce; - if (init.tty) this.tty = init.tty; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.image) { this.image = init.image; } + if (init.command) { this.command = init.command; } + if (init.args) { this.args = init.args; } + if (init.workingDir) { this.workingDir = init.workingDir; } + if (init.ports) { this.ports = init.ports; } + if (init.envFrom) { this.envFrom = init.envFrom; } + if (init.env) { this.env = init.env; } + if (init.resources) { this.resources = init.resources; } + if (init.volumeMounts) { this.volumeMounts = init.volumeMounts; } + if (init.volumeDevices) { this.volumeDevices = init.volumeDevices; } + if (init.livenessProbe) { this.livenessProbe = init.livenessProbe; } + if (init.readinessProbe) { this.readinessProbe = init.readinessProbe; } + if (init.lifecycle) { this.lifecycle = init.lifecycle; } + if (init.terminationMessagePath) { this.terminationMessagePath = init.terminationMessagePath; } + if (init.terminationMessagePolicy) { this.terminationMessagePolicy = init.terminationMessagePolicy; } + if (init.imagePullPolicy) { this.imagePullPolicy = init.imagePullPolicy; } + if (init.securityContext) { this.securityContext = init.securityContext; } + if (init.stdin) { this.stdin = init.stdin; } + if (init.stdinOnce) { this.stdinOnce = init.stdinOnce; } + if (init.tty) { this.tty = init.tty; } } static emptyObject(): Container { - let result = new Container(); + const result = new Container(); result.command = []; result.args = []; result.ports = []; @@ -971,17 +983,17 @@ export class StorageOSVolumeSource { secretRef?: LocalObjectReference; constructor(init?: StorageOSVolumeSource) { - if (!init) return; - if (init.volumeName) this.volumeName = init.volumeName; - if (init.volumeNamespace) this.volumeNamespace = init.volumeNamespace; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.secretRef) this.secretRef = init.secretRef; + if (!init) { return; } + if (init.volumeName) { this.volumeName = init.volumeName; } + if (init.volumeNamespace) { this.volumeNamespace = init.volumeNamespace; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.secretRef) { this.secretRef = init.secretRef; } } static emptyObject(): StorageOSVolumeSource { - let result = new StorageOSVolumeSource(); + const result = new StorageOSVolumeSource(); result.secretRef = LocalObjectReference.emptyObject(); return result; } @@ -1001,22 +1013,22 @@ export class ScaleIOVolumeSource { readOnly: boolean; constructor(init?: ScaleIOVolumeSource) { - if (!init) return; - if (init.gateway) this.gateway = init.gateway; - if (init.system) this.system = init.system; - if (init.secretRef) this.secretRef = init.secretRef; - if (init.sslEnabled) this.sslEnabled = init.sslEnabled; - if (init.protectionDomain) this.protectionDomain = init.protectionDomain; - if (init.storagePool) this.storagePool = init.storagePool; - if (init.storageMode) this.storageMode = init.storageMode; - if (init.volumeName) this.volumeName = init.volumeName; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.gateway) { this.gateway = init.gateway; } + if (init.system) { this.system = init.system; } + if (init.secretRef) { this.secretRef = init.secretRef; } + if (init.sslEnabled) { this.sslEnabled = init.sslEnabled; } + if (init.protectionDomain) { this.protectionDomain = init.protectionDomain; } + if (init.storagePool) { this.storagePool = init.storagePool; } + if (init.storageMode) { this.storageMode = init.storageMode; } + if (init.volumeName) { this.volumeName = init.volumeName; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): ScaleIOVolumeSource { - let result = new ScaleIOVolumeSource(); + const result = new ScaleIOVolumeSource(); result.secretRef = LocalObjectReference.emptyObject(); return result; } @@ -1029,15 +1041,15 @@ export class PortworxVolumeSource { readOnly: boolean; constructor(init?: PortworxVolumeSource) { - if (!init) return; - if (init.volumeID) this.volumeID = init.volumeID; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.volumeID) { this.volumeID = init.volumeID; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): PortworxVolumeSource { - let result = new PortworxVolumeSource(); + const result = new PortworxVolumeSource(); return result; } @@ -1049,15 +1061,15 @@ export class ConfigMapProjection { optional?: boolean; constructor(init?: ConfigMapProjection) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.items) this.items = init.items; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.items) { this.items = init.items; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): ConfigMapProjection { - let result = new ConfigMapProjection(); + const result = new ConfigMapProjection(); result.items = []; return result; } @@ -1068,13 +1080,13 @@ export class DownwardAPIProjection { items: DownwardAPIVolumeFile[]; constructor(init?: DownwardAPIProjection) { - if (!init) return; - if (init.items) this.items = init.items; + if (!init) { return; } + if (init.items) { this.items = init.items; } } static emptyObject(): DownwardAPIProjection { - let result = new DownwardAPIProjection(); + const result = new DownwardAPIProjection(); result.items = []; return result; } @@ -1087,15 +1099,15 @@ export class SecretProjection { optional?: boolean; constructor(init?: SecretProjection) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.items) this.items = init.items; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.items) { this.items = init.items; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): SecretProjection { - let result = new SecretProjection(); + const result = new SecretProjection(); result.items = []; return result; } @@ -1108,15 +1120,15 @@ export class VolumeProjection { configMap?: ConfigMapProjection; constructor(init?: VolumeProjection) { - if (!init) return; - if (init.secret) this.secret = init.secret; - if (init.downwardAPI) this.downwardAPI = init.downwardAPI; - if (init.configMap) this.configMap = init.configMap; + if (!init) { return; } + if (init.secret) { this.secret = init.secret; } + if (init.downwardAPI) { this.downwardAPI = init.downwardAPI; } + if (init.configMap) { this.configMap = init.configMap; } } static emptyObject(): VolumeProjection { - let result = new VolumeProjection(); + const result = new VolumeProjection(); result.secret = SecretProjection.emptyObject(); result.downwardAPI = DownwardAPIProjection.emptyObject(); result.configMap = ConfigMapProjection.emptyObject(); @@ -1130,14 +1142,14 @@ export class ProjectedVolumeSource { defaultMode?: number; constructor(init?: ProjectedVolumeSource) { - if (!init) return; - if (init.sources) this.sources = init.sources; - if (init.defaultMode) this.defaultMode = init.defaultMode; + if (!init) { return; } + if (init.sources) { this.sources = init.sources; } + if (init.defaultMode) { this.defaultMode = init.defaultMode; } } static emptyObject(): ProjectedVolumeSource { - let result = new ProjectedVolumeSource(); + const result = new ProjectedVolumeSource(); result.sources = []; return result; } @@ -1149,14 +1161,14 @@ export class PhotonPersistentDiskVolumeSource { fsType: string; constructor(init?: PhotonPersistentDiskVolumeSource) { - if (!init) return; - if (init.pdID) this.pdID = init.pdID; - if (init.fsType) this.fsType = init.fsType; + if (!init) { return; } + if (init.pdID) { this.pdID = init.pdID; } + if (init.fsType) { this.fsType = init.fsType; } } static emptyObject(): PhotonPersistentDiskVolumeSource { - let result = new PhotonPersistentDiskVolumeSource(); + const result = new PhotonPersistentDiskVolumeSource(); return result; } @@ -1171,18 +1183,18 @@ export class AzureDiskVolumeSource { kind?: string; constructor(init?: AzureDiskVolumeSource) { - if (!init) return; - if (init.diskName) this.diskName = init.diskName; - if (init.diskURI) this.diskURI = init.diskURI; - if (init.cachingMode) this.cachingMode = init.cachingMode; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.kind) this.kind = init.kind; + if (!init) { return; } + if (init.diskName) { this.diskName = init.diskName; } + if (init.diskURI) { this.diskURI = init.diskURI; } + if (init.cachingMode) { this.cachingMode = init.cachingMode; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.kind) { this.kind = init.kind; } } static emptyObject(): AzureDiskVolumeSource { - let result = new AzureDiskVolumeSource(); + const result = new AzureDiskVolumeSource(); return result; } @@ -1196,17 +1208,17 @@ export class QuobyteVolumeSource { group: string; constructor(init?: QuobyteVolumeSource) { - if (!init) return; - if (init.registry) this.registry = init.registry; - if (init.volume) this.volume = init.volume; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.user) this.user = init.user; - if (init.group) this.group = init.group; + if (!init) { return; } + if (init.registry) { this.registry = init.registry; } + if (init.volume) { this.volume = init.volume; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.user) { this.user = init.user; } + if (init.group) { this.group = init.group; } } static emptyObject(): QuobyteVolumeSource { - let result = new QuobyteVolumeSource(); + const result = new QuobyteVolumeSource(); return result; } @@ -1219,16 +1231,16 @@ export class VsphereVirtualDiskVolumeSource { storagePolicyID: string; constructor(init?: VsphereVirtualDiskVolumeSource) { - if (!init) return; - if (init.volumePath) this.volumePath = init.volumePath; - if (init.fsType) this.fsType = init.fsType; - if (init.storagePolicyName) this.storagePolicyName = init.storagePolicyName; - if (init.storagePolicyID) this.storagePolicyID = init.storagePolicyID; + if (!init) { return; } + if (init.volumePath) { this.volumePath = init.volumePath; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.storagePolicyName) { this.storagePolicyName = init.storagePolicyName; } + if (init.storagePolicyID) { this.storagePolicyID = init.storagePolicyID; } } static emptyObject(): VsphereVirtualDiskVolumeSource { - let result = new VsphereVirtualDiskVolumeSource(); + const result = new VsphereVirtualDiskVolumeSource(); return result; } @@ -1241,16 +1253,16 @@ export class ConfigMapVolumeSource { optional?: boolean; constructor(init?: ConfigMapVolumeSource) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.items) this.items = init.items; - if (init.defaultMode) this.defaultMode = init.defaultMode; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.items) { this.items = init.items; } + if (init.defaultMode) { this.defaultMode = init.defaultMode; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): ConfigMapVolumeSource { - let result = new ConfigMapVolumeSource(); + const result = new ConfigMapVolumeSource(); result.items = []; return result; } @@ -1263,15 +1275,15 @@ export class AzureFileVolumeSource { readOnly: boolean; constructor(init?: AzureFileVolumeSource) { - if (!init) return; - if (init.secretName) this.secretName = init.secretName; - if (init.shareName) this.shareName = init.shareName; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.secretName) { this.secretName = init.secretName; } + if (init.shareName) { this.shareName = init.shareName; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): AzureFileVolumeSource { - let result = new AzureFileVolumeSource(); + const result = new AzureFileVolumeSource(); return result; } @@ -1285,17 +1297,17 @@ export class FCVolumeSource { wwids: string[]; constructor(init?: FCVolumeSource) { - if (!init) return; - if (init.targetWWNs) this.targetWWNs = init.targetWWNs; - if (init.lun) this.lun = init.lun; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.wwids) this.wwids = init.wwids; + if (!init) { return; } + if (init.targetWWNs) { this.targetWWNs = init.targetWWNs; } + if (init.lun) { this.lun = init.lun; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.wwids) { this.wwids = init.wwids; } } static emptyObject(): FCVolumeSource { - let result = new FCVolumeSource(); + const result = new FCVolumeSource(); result.targetWWNs = []; result.wwids = []; return result; @@ -1309,15 +1321,15 @@ export class ResourceFieldSelector { divisor: Quantity; constructor(init?: ResourceFieldSelector) { - if (!init) return; - if (init.containerName) this.containerName = init.containerName; - if (init.resource) this.resource = init.resource; - if (init.divisor) this.divisor = init.divisor; + if (!init) { return; } + if (init.containerName) { this.containerName = init.containerName; } + if (init.resource) { this.resource = init.resource; } + if (init.divisor) { this.divisor = init.divisor; } } static emptyObject(): ResourceFieldSelector { - let result = new ResourceFieldSelector(); + const result = new ResourceFieldSelector(); result.divisor = Quantity.emptyObject(); return result; } @@ -1329,14 +1341,14 @@ export class ObjectFieldSelector { fieldPath: string; constructor(init?: ObjectFieldSelector) { - if (!init) return; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.fieldPath) this.fieldPath = init.fieldPath; + if (!init) { return; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.fieldPath) { this.fieldPath = init.fieldPath; } } static emptyObject(): ObjectFieldSelector { - let result = new ObjectFieldSelector(); + const result = new ObjectFieldSelector(); return result; } @@ -1349,16 +1361,16 @@ export class DownwardAPIVolumeFile { mode?: number; constructor(init?: DownwardAPIVolumeFile) { - if (!init) return; - if (init.path) this.path = init.path; - if (init.fieldRef) this.fieldRef = init.fieldRef; - if (init.resourceFieldRef) this.resourceFieldRef = init.resourceFieldRef; - if (init.mode) this.mode = init.mode; + if (!init) { return; } + if (init.path) { this.path = init.path; } + if (init.fieldRef) { this.fieldRef = init.fieldRef; } + if (init.resourceFieldRef) { this.resourceFieldRef = init.resourceFieldRef; } + if (init.mode) { this.mode = init.mode; } } static emptyObject(): DownwardAPIVolumeFile { - let result = new DownwardAPIVolumeFile(); + const result = new DownwardAPIVolumeFile(); result.fieldRef = ObjectFieldSelector.emptyObject(); result.resourceFieldRef = ResourceFieldSelector.emptyObject(); return result; @@ -1371,14 +1383,14 @@ export class DownwardAPIVolumeSource { defaultMode?: number; constructor(init?: DownwardAPIVolumeSource) { - if (!init) return; - if (init.items) this.items = init.items; - if (init.defaultMode) this.defaultMode = init.defaultMode; + if (!init) { return; } + if (init.items) { this.items = init.items; } + if (init.defaultMode) { this.defaultMode = init.defaultMode; } } static emptyObject(): DownwardAPIVolumeSource { - let result = new DownwardAPIVolumeSource(); + const result = new DownwardAPIVolumeSource(); result.items = []; return result; } @@ -1390,14 +1402,14 @@ export class FlockerVolumeSource { datasetUUID: string; constructor(init?: FlockerVolumeSource) { - if (!init) return; - if (init.datasetName) this.datasetName = init.datasetName; - if (init.datasetUUID) this.datasetUUID = init.datasetUUID; + if (!init) { return; } + if (init.datasetName) { this.datasetName = init.datasetName; } + if (init.datasetUUID) { this.datasetUUID = init.datasetUUID; } } static emptyObject(): FlockerVolumeSource { - let result = new FlockerVolumeSource(); + const result = new FlockerVolumeSource(); return result; } @@ -1412,18 +1424,18 @@ export class CephFSVolumeSource { readOnly: boolean; constructor(init?: CephFSVolumeSource) { - if (!init) return; - if (init.monitors) this.monitors = init.monitors; - if (init.path) this.path = init.path; - if (init.user) this.user = init.user; - if (init.secretFile) this.secretFile = init.secretFile; - if (init.secretRef) this.secretRef = init.secretRef; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.monitors) { this.monitors = init.monitors; } + if (init.path) { this.path = init.path; } + if (init.user) { this.user = init.user; } + if (init.secretFile) { this.secretFile = init.secretFile; } + if (init.secretRef) { this.secretRef = init.secretRef; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): CephFSVolumeSource { - let result = new CephFSVolumeSource(); + const result = new CephFSVolumeSource(); result.monitors = []; result.secretRef = LocalObjectReference.emptyObject(); return result; @@ -1437,15 +1449,15 @@ export class CinderVolumeSource { readOnly: boolean; constructor(init?: CinderVolumeSource) { - if (!init) return; - if (init.volumeID) this.volumeID = init.volumeID; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.volumeID) { this.volumeID = init.volumeID; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): CinderVolumeSource { - let result = new CinderVolumeSource(); + const result = new CinderVolumeSource(); return result; } @@ -1459,17 +1471,17 @@ export class FlexVolumeSource { options?: { [key: string]: string }; constructor(init?: FlexVolumeSource) { - if (!init) return; - if (init.driver) this.driver = init.driver; - if (init.fsType) this.fsType = init.fsType; - if (init.secretRef) this.secretRef = init.secretRef; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.options) this.options = init.options; + if (!init) { return; } + if (init.driver) { this.driver = init.driver; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.secretRef) { this.secretRef = init.secretRef; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.options) { this.options = init.options; } } static emptyObject(): FlexVolumeSource { - let result = new FlexVolumeSource(); + const result = new FlexVolumeSource(); result.secretRef = LocalObjectReference.emptyObject(); result.options = null; return result; @@ -1488,20 +1500,20 @@ export class RBDVolumeSource { readOnly: boolean; constructor(init?: RBDVolumeSource) { - if (!init) return; - if (init.monitors) this.monitors = init.monitors; - if (init.image) this.image = init.image; - if (init.fsType) this.fsType = init.fsType; - if (init.pool) this.pool = init.pool; - if (init.user) this.user = init.user; - if (init.keyring) this.keyring = init.keyring; - if (init.secretRef) this.secretRef = init.secretRef; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.monitors) { this.monitors = init.monitors; } + if (init.image) { this.image = init.image; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.pool) { this.pool = init.pool; } + if (init.user) { this.user = init.user; } + if (init.keyring) { this.keyring = init.keyring; } + if (init.secretRef) { this.secretRef = init.secretRef; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): RBDVolumeSource { - let result = new RBDVolumeSource(); + const result = new RBDVolumeSource(); result.monitors = []; result.secretRef = LocalObjectReference.emptyObject(); return result; @@ -1514,14 +1526,14 @@ export class PersistentVolumeClaimVolumeSource { readOnly: boolean; constructor(init?: PersistentVolumeClaimVolumeSource) { - if (!init) return; - if (init.claimName) this.claimName = init.claimName; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.claimName) { this.claimName = init.claimName; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): PersistentVolumeClaimVolumeSource { - let result = new PersistentVolumeClaimVolumeSource(); + const result = new PersistentVolumeClaimVolumeSource(); return result; } @@ -1533,15 +1545,15 @@ export class GlusterfsVolumeSource { readOnly: boolean; constructor(init?: GlusterfsVolumeSource) { - if (!init) return; - if (init.endpoints) this.endpoints = init.endpoints; - if (init.path) this.path = init.path; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.endpoints) { this.endpoints = init.endpoints; } + if (init.path) { this.path = init.path; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): GlusterfsVolumeSource { - let result = new GlusterfsVolumeSource(); + const result = new GlusterfsVolumeSource(); return result; } @@ -1551,13 +1563,13 @@ export class LocalObjectReference { name: string; constructor(init?: LocalObjectReference) { - if (!init) return; - if (init.name) this.name = init.name; + if (!init) { return; } + if (init.name) { this.name = init.name; } } static emptyObject(): LocalObjectReference { - let result = new LocalObjectReference(); + const result = new LocalObjectReference(); return result; } @@ -1577,23 +1589,23 @@ export class ISCSIVolumeSource { initiatorName?: string; constructor(init?: ISCSIVolumeSource) { - if (!init) return; - if (init.targetPortal) this.targetPortal = init.targetPortal; - if (init.iqn) this.iqn = init.iqn; - if (init.lun) this.lun = init.lun; - if (init.iscsiInterface) this.iscsiInterface = init.iscsiInterface; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.portals) this.portals = init.portals; - if (init.chapAuthDiscovery) this.chapAuthDiscovery = init.chapAuthDiscovery; - if (init.chapAuthSession) this.chapAuthSession = init.chapAuthSession; - if (init.secretRef) this.secretRef = init.secretRef; - if (init.initiatorName) this.initiatorName = init.initiatorName; + if (!init) { return; } + if (init.targetPortal) { this.targetPortal = init.targetPortal; } + if (init.iqn) { this.iqn = init.iqn; } + if (init.lun) { this.lun = init.lun; } + if (init.iscsiInterface) { this.iscsiInterface = init.iscsiInterface; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.portals) { this.portals = init.portals; } + if (init.chapAuthDiscovery) { this.chapAuthDiscovery = init.chapAuthDiscovery; } + if (init.chapAuthSession) { this.chapAuthSession = init.chapAuthSession; } + if (init.secretRef) { this.secretRef = init.secretRef; } + if (init.initiatorName) { this.initiatorName = init.initiatorName; } } static emptyObject(): ISCSIVolumeSource { - let result = new ISCSIVolumeSource(); + const result = new ISCSIVolumeSource(); result.portals = []; result.secretRef = LocalObjectReference.emptyObject(); return result; @@ -1607,15 +1619,15 @@ export class NFSVolumeSource { readOnly: boolean; constructor(init?: NFSVolumeSource) { - if (!init) return; - if (init.server) this.server = init.server; - if (init.path) this.path = init.path; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.server) { this.server = init.server; } + if (init.path) { this.path = init.path; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): NFSVolumeSource { - let result = new NFSVolumeSource(); + const result = new NFSVolumeSource(); return result; } @@ -1627,15 +1639,15 @@ export class KeyToPath { mode?: number; constructor(init?: KeyToPath) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.path) this.path = init.path; - if (init.mode) this.mode = init.mode; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.path) { this.path = init.path; } + if (init.mode) { this.mode = init.mode; } } static emptyObject(): KeyToPath { - let result = new KeyToPath(); + const result = new KeyToPath(); return result; } @@ -1648,16 +1660,16 @@ export class SecretVolumeSource { optional?: boolean; constructor(init?: SecretVolumeSource) { - if (!init) return; - if (init.secretName) this.secretName = init.secretName; - if (init.items) this.items = init.items; - if (init.defaultMode) this.defaultMode = init.defaultMode; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.secretName) { this.secretName = init.secretName; } + if (init.items) { this.items = init.items; } + if (init.defaultMode) { this.defaultMode = init.defaultMode; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): SecretVolumeSource { - let result = new SecretVolumeSource(); + const result = new SecretVolumeSource(); result.items = []; return result; } @@ -1670,15 +1682,15 @@ export class GitRepoVolumeSource { directory: string; constructor(init?: GitRepoVolumeSource) { - if (!init) return; - if (init.repository) this.repository = init.repository; - if (init.revision) this.revision = init.revision; - if (init.directory) this.directory = init.directory; + if (!init) { return; } + if (init.repository) { this.repository = init.repository; } + if (init.revision) { this.revision = init.revision; } + if (init.directory) { this.directory = init.directory; } } static emptyObject(): GitRepoVolumeSource { - let result = new GitRepoVolumeSource(); + const result = new GitRepoVolumeSource(); return result; } @@ -1691,16 +1703,16 @@ export class AWSElasticBlockStoreVolumeSource { readOnly: boolean; constructor(init?: AWSElasticBlockStoreVolumeSource) { - if (!init) return; - if (init.volumeID) this.volumeID = init.volumeID; - if (init.fsType) this.fsType = init.fsType; - if (init.partition) this.partition = init.partition; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.volumeID) { this.volumeID = init.volumeID; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.partition) { this.partition = init.partition; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): AWSElasticBlockStoreVolumeSource { - let result = new AWSElasticBlockStoreVolumeSource(); + const result = new AWSElasticBlockStoreVolumeSource(); return result; } @@ -1713,16 +1725,16 @@ export class GCEPersistentDiskVolumeSource { readOnly: boolean; constructor(init?: GCEPersistentDiskVolumeSource) { - if (!init) return; - if (init.pdName) this.pdName = init.pdName; - if (init.fsType) this.fsType = init.fsType; - if (init.partition) this.partition = init.partition; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.pdName) { this.pdName = init.pdName; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.partition) { this.partition = init.partition; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): GCEPersistentDiskVolumeSource { - let result = new GCEPersistentDiskVolumeSource(); + const result = new GCEPersistentDiskVolumeSource(); return result; } @@ -1732,13 +1744,13 @@ export class Quantity { Format: string; constructor(init?: Quantity) { - if (!init) return; - if (init.Format) this.Format = init.Format; + if (!init) { return; } + if (init.Format) { this.Format = init.Format; } } static emptyObject(): Quantity { - let result = new Quantity(); + const result = new Quantity(); return result; } @@ -1749,14 +1761,14 @@ export class EmptyDirVolumeSource { sizeLimit?: Quantity; constructor(init?: EmptyDirVolumeSource) { - if (!init) return; - if (init.medium) this.medium = init.medium; - if (init.sizeLimit) this.sizeLimit = init.sizeLimit; + if (!init) { return; } + if (init.medium) { this.medium = init.medium; } + if (init.sizeLimit) { this.sizeLimit = init.sizeLimit; } } static emptyObject(): EmptyDirVolumeSource { - let result = new EmptyDirVolumeSource(); + const result = new EmptyDirVolumeSource(); result.sizeLimit = Quantity.emptyObject(); return result; } @@ -1768,14 +1780,14 @@ export class HostPathVolumeSource { type?: string; constructor(init?: HostPathVolumeSource) { - if (!init) return; - if (init.path) this.path = init.path; - if (init.type) this.type = init.type; + if (!init) { return; } + if (init.path) { this.path = init.path; } + if (init.type) { this.type = init.type; } } static emptyObject(): HostPathVolumeSource { - let result = new HostPathVolumeSource(); + const result = new HostPathVolumeSource(); return result; } @@ -1812,40 +1824,40 @@ export class Volume { storageos?: StorageOSVolumeSource; constructor(init?: Volume) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.hostPath) this.hostPath = init.hostPath; - if (init.emptyDir) this.emptyDir = init.emptyDir; - if (init.gcePersistentDisk) this.gcePersistentDisk = init.gcePersistentDisk; - if (init.awsElasticBlockStore) this.awsElasticBlockStore = init.awsElasticBlockStore; - if (init.gitRepo) this.gitRepo = init.gitRepo; - if (init.secret) this.secret = init.secret; - if (init.nfs) this.nfs = init.nfs; - if (init.iscsi) this.iscsi = init.iscsi; - if (init.glusterfs) this.glusterfs = init.glusterfs; - if (init.persistentVolumeClaim) this.persistentVolumeClaim = init.persistentVolumeClaim; - if (init.rbd) this.rbd = init.rbd; - if (init.flexVolume) this.flexVolume = init.flexVolume; - if (init.cinder) this.cinder = init.cinder; - if (init.cephfs) this.cephfs = init.cephfs; - if (init.flocker) this.flocker = init.flocker; - if (init.downwardAPI) this.downwardAPI = init.downwardAPI; - if (init.fc) this.fc = init.fc; - if (init.azureFile) this.azureFile = init.azureFile; - if (init.configMap) this.configMap = init.configMap; - if (init.vsphereVolume) this.vsphereVolume = init.vsphereVolume; - if (init.quobyte) this.quobyte = init.quobyte; - if (init.azureDisk) this.azureDisk = init.azureDisk; - if (init.photonPersistentDisk) this.photonPersistentDisk = init.photonPersistentDisk; - if (init.projected) this.projected = init.projected; - if (init.portworxVolume) this.portworxVolume = init.portworxVolume; - if (init.scaleIO) this.scaleIO = init.scaleIO; - if (init.storageos) this.storageos = init.storageos; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.hostPath) { this.hostPath = init.hostPath; } + if (init.emptyDir) { this.emptyDir = init.emptyDir; } + if (init.gcePersistentDisk) { this.gcePersistentDisk = init.gcePersistentDisk; } + if (init.awsElasticBlockStore) { this.awsElasticBlockStore = init.awsElasticBlockStore; } + if (init.gitRepo) { this.gitRepo = init.gitRepo; } + if (init.secret) { this.secret = init.secret; } + if (init.nfs) { this.nfs = init.nfs; } + if (init.iscsi) { this.iscsi = init.iscsi; } + if (init.glusterfs) { this.glusterfs = init.glusterfs; } + if (init.persistentVolumeClaim) { this.persistentVolumeClaim = init.persistentVolumeClaim; } + if (init.rbd) { this.rbd = init.rbd; } + if (init.flexVolume) { this.flexVolume = init.flexVolume; } + if (init.cinder) { this.cinder = init.cinder; } + if (init.cephfs) { this.cephfs = init.cephfs; } + if (init.flocker) { this.flocker = init.flocker; } + if (init.downwardAPI) { this.downwardAPI = init.downwardAPI; } + if (init.fc) { this.fc = init.fc; } + if (init.azureFile) { this.azureFile = init.azureFile; } + if (init.configMap) { this.configMap = init.configMap; } + if (init.vsphereVolume) { this.vsphereVolume = init.vsphereVolume; } + if (init.quobyte) { this.quobyte = init.quobyte; } + if (init.azureDisk) { this.azureDisk = init.azureDisk; } + if (init.photonPersistentDisk) { this.photonPersistentDisk = init.photonPersistentDisk; } + if (init.projected) { this.projected = init.projected; } + if (init.portworxVolume) { this.portworxVolume = init.portworxVolume; } + if (init.scaleIO) { this.scaleIO = init.scaleIO; } + if (init.storageos) { this.storageos = init.storageos; } } static emptyObject(): Volume { - let result = new Volume(); + const result = new Volume(); result.hostPath = HostPathVolumeSource.emptyObject(); result.emptyDir = EmptyDirVolumeSource.emptyObject(); result.gcePersistentDisk = GCEPersistentDiskVolumeSource.emptyObject(); @@ -1908,39 +1920,39 @@ export class PodSpec { dnsConfig?: PodDNSConfig; constructor(init?: PodSpec) { - if (!init) return; - if (init.volumes) this.volumes = init.volumes; - if (init.initContainers) this.initContainers = init.initContainers; - if (init.containers) this.containers = init.containers; - if (init.restartPolicy) this.restartPolicy = init.restartPolicy; - if (init.terminationGracePeriodSeconds) this.terminationGracePeriodSeconds = init.terminationGracePeriodSeconds; - if (init.activeDeadlineSeconds) this.activeDeadlineSeconds = init.activeDeadlineSeconds; - if (init.dnsPolicy) this.dnsPolicy = init.dnsPolicy; - if (init.nodeSelector) this.nodeSelector = init.nodeSelector; - if (init.serviceAccountName) this.serviceAccountName = init.serviceAccountName; - if (init.serviceAccount) this.serviceAccount = init.serviceAccount; - if (init.automountServiceAccountToken) this.automountServiceAccountToken = init.automountServiceAccountToken; - if (init.nodeName) this.nodeName = init.nodeName; - if (init.hostNetwork) this.hostNetwork = init.hostNetwork; - if (init.hostPID) this.hostPID = init.hostPID; - if (init.hostIPC) this.hostIPC = init.hostIPC; - if (init.shareProcessNamespace) this.shareProcessNamespace = init.shareProcessNamespace; - if (init.securityContext) this.securityContext = init.securityContext; - if (init.imagePullSecrets) this.imagePullSecrets = init.imagePullSecrets; - if (init.hostname) this.hostname = init.hostname; - if (init.subdomain) this.subdomain = init.subdomain; - if (init.affinity) this.affinity = init.affinity; - if (init.schedulerName) this.schedulerName = init.schedulerName; - if (init.tolerations) this.tolerations = init.tolerations; - if (init.hostAliases) this.hostAliases = init.hostAliases; - if (init.priorityClassName) this.priorityClassName = init.priorityClassName; - if (init.priority) this.priority = init.priority; - if (init.dnsConfig) this.dnsConfig = init.dnsConfig; + if (!init) { return; } + if (init.volumes) { this.volumes = init.volumes; } + if (init.initContainers) { this.initContainers = init.initContainers; } + if (init.containers) { this.containers = init.containers; } + if (init.restartPolicy) { this.restartPolicy = init.restartPolicy; } + if (init.terminationGracePeriodSeconds) { this.terminationGracePeriodSeconds = init.terminationGracePeriodSeconds; } + if (init.activeDeadlineSeconds) { this.activeDeadlineSeconds = init.activeDeadlineSeconds; } + if (init.dnsPolicy) { this.dnsPolicy = init.dnsPolicy; } + if (init.nodeSelector) { this.nodeSelector = init.nodeSelector; } + if (init.serviceAccountName) { this.serviceAccountName = init.serviceAccountName; } + if (init.serviceAccount) { this.serviceAccount = init.serviceAccount; } + if (init.automountServiceAccountToken) { this.automountServiceAccountToken = init.automountServiceAccountToken; } + if (init.nodeName) { this.nodeName = init.nodeName; } + if (init.hostNetwork) { this.hostNetwork = init.hostNetwork; } + if (init.hostPID) { this.hostPID = init.hostPID; } + if (init.hostIPC) { this.hostIPC = init.hostIPC; } + if (init.shareProcessNamespace) { this.shareProcessNamespace = init.shareProcessNamespace; } + if (init.securityContext) { this.securityContext = init.securityContext; } + if (init.imagePullSecrets) { this.imagePullSecrets = init.imagePullSecrets; } + if (init.hostname) { this.hostname = init.hostname; } + if (init.subdomain) { this.subdomain = init.subdomain; } + if (init.affinity) { this.affinity = init.affinity; } + if (init.schedulerName) { this.schedulerName = init.schedulerName; } + if (init.tolerations) { this.tolerations = init.tolerations; } + if (init.hostAliases) { this.hostAliases = init.hostAliases; } + if (init.priorityClassName) { this.priorityClassName = init.priorityClassName; } + if (init.priority) { this.priority = init.priority; } + if (init.dnsConfig) { this.dnsConfig = init.dnsConfig; } } static emptyObject(): PodSpec { - let result = new PodSpec(); + const result = new PodSpec(); result.volumes = []; result.initContainers = []; result.containers = []; @@ -1961,14 +1973,14 @@ export class PodTemplateSpec { spec: PodSpec; constructor(init?: PodTemplateSpec) { - if (!init) return; - if (init.metadata) this.metadata = init.metadata; - if (init.spec) this.spec = init.spec; + if (!init) { return; } + if (init.metadata) { this.metadata = init.metadata; } + if (init.spec) { this.spec = init.spec; } } static emptyObject(): PodTemplateSpec { - let result = new PodTemplateSpec(); + const result = new PodTemplateSpec(); result.metadata = ObjectMeta.emptyObject(); result.spec = PodSpec.emptyObject(); return result; @@ -1982,15 +1994,15 @@ export class LabelSelectorRequirement { values: string[]; constructor(init?: LabelSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.values) { this.values = init.values; } } static emptyObject(): LabelSelectorRequirement { - let result = new LabelSelectorRequirement(); + const result = new LabelSelectorRequirement(); result.values = []; return result; } @@ -2002,14 +2014,14 @@ export class LabelSelector { matchExpressions: LabelSelectorRequirement[]; constructor(init?: LabelSelector) { - if (!init) return; - if (init.matchLabels) this.matchLabels = init.matchLabels; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchLabels) { this.matchLabels = init.matchLabels; } + if (init.matchExpressions) { this.matchExpressions = init.matchExpressions; } } static emptyObject(): LabelSelector { - let result = new LabelSelector(); + const result = new LabelSelector(); result.matchLabels = null; result.matchExpressions = []; return result; @@ -2026,18 +2038,18 @@ export class DaemonSetSpec { revisionHistoryLimit?: number; constructor(init?: DaemonSetSpec) { - if (!init) return; - if (init.selector) this.selector = init.selector; - if (init.template) this.template = init.template; - if (init.updateStrategy) this.updateStrategy = init.updateStrategy; - if (init.minReadySeconds) this.minReadySeconds = init.minReadySeconds; - if (init.templateGeneration) this.templateGeneration = init.templateGeneration; - if (init.revisionHistoryLimit) this.revisionHistoryLimit = init.revisionHistoryLimit; + if (!init) { return; } + if (init.selector) { this.selector = init.selector; } + if (init.template) { this.template = init.template; } + if (init.updateStrategy) { this.updateStrategy = init.updateStrategy; } + if (init.minReadySeconds) { this.minReadySeconds = init.minReadySeconds; } + if (init.templateGeneration) { this.templateGeneration = init.templateGeneration; } + if (init.revisionHistoryLimit) { this.revisionHistoryLimit = init.revisionHistoryLimit; } } static emptyObject(): DaemonSetSpec { - let result = new DaemonSetSpec(); + const result = new DaemonSetSpec(); result.selector = LabelSelector.emptyObject(); result.template = PodTemplateSpec.emptyObject(); result.updateStrategy = DaemonSetUpdateStrategy.emptyObject(); @@ -2052,15 +2064,15 @@ export class StatusCause { field: string; constructor(init?: StatusCause) { - if (!init) return; - if (init.reason) this.reason = init.reason; - if (init.message) this.message = init.message; - if (init.field) this.field = init.field; + if (!init) { return; } + if (init.reason) { this.reason = init.reason; } + if (init.message) { this.message = init.message; } + if (init.field) { this.field = init.field; } } static emptyObject(): StatusCause { - let result = new StatusCause(); + const result = new StatusCause(); return result; } @@ -2075,18 +2087,18 @@ export class StatusDetails { retryAfterSeconds: number; constructor(init?: StatusDetails) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.group) this.group = init.group; - if (init.kind) this.kind = init.kind; - if (init.uid) this.uid = init.uid; - if (init.causes) this.causes = init.causes; - if (init.retryAfterSeconds) this.retryAfterSeconds = init.retryAfterSeconds; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.group) { this.group = init.group; } + if (init.kind) { this.kind = init.kind; } + if (init.uid) { this.uid = init.uid; } + if (init.causes) { this.causes = init.causes; } + if (init.retryAfterSeconds) { this.retryAfterSeconds = init.retryAfterSeconds; } } static emptyObject(): StatusDetails { - let result = new StatusDetails(); + const result = new StatusDetails(); result.causes = []; return result; } @@ -2099,15 +2111,15 @@ export class ListMeta { continue: string; constructor(init?: ListMeta) { - if (!init) return; - if (init.selfLink) this.selfLink = init.selfLink; - if (init.resourceVersion) this.resourceVersion = init.resourceVersion; - if (init.continue) this.continue = init.continue; + if (!init) { return; } + if (init.selfLink) { this.selfLink = init.selfLink; } + if (init.resourceVersion) { this.resourceVersion = init.resourceVersion; } + if (init.continue) { this.continue = init.continue; } } static emptyObject(): ListMeta { - let result = new ListMeta(); + const result = new ListMeta(); return result; } @@ -2124,20 +2136,20 @@ export class Status { code: number; constructor(init?: Status) { - if (!init) return; - if (init.kind) this.kind = init.kind; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.metadata) this.metadata = init.metadata; - if (init.status) this.status = init.status; - if (init.message) this.message = init.message; - if (init.reason) this.reason = init.reason; - if (init.details) this.details = init.details; - if (init.code) this.code = init.code; + if (!init) { return; } + if (init.kind) { this.kind = init.kind; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.metadata) { this.metadata = init.metadata; } + if (init.status) { this.status = init.status; } + if (init.message) { this.message = init.message; } + if (init.reason) { this.reason = init.reason; } + if (init.details) { this.details = init.details; } + if (init.code) { this.code = init.code; } } static emptyObject(): Status { - let result = new Status(); + const result = new Status(); result.metadata = ListMeta.emptyObject(); result.details = StatusDetails.emptyObject(); return result; @@ -2149,13 +2161,13 @@ export class Initializer { name: string; constructor(init?: Initializer) { - if (!init) return; - if (init.name) this.name = init.name; + if (!init) { return; } + if (init.name) { this.name = init.name; } } static emptyObject(): Initializer { - let result = new Initializer(); + const result = new Initializer(); return result; } @@ -2166,14 +2178,14 @@ export class Initializers { result?: Status; constructor(init?: Initializers) { - if (!init) return; - if (init.pending) this.pending = init.pending; - if (init.result) this.result = init.result; + if (!init) { return; } + if (init.pending) { this.pending = init.pending; } + if (init.result) { this.result = init.result; } } static emptyObject(): Initializers { - let result = new Initializers(); + const result = new Initializers(); result.pending = []; result.result = Status.emptyObject(); return result; @@ -2190,18 +2202,18 @@ export class OwnerReference { blockOwnerDeletion?: boolean; constructor(init?: OwnerReference) { - if (!init) return; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.kind) this.kind = init.kind; - if (init.name) this.name = init.name; - if (init.uid) this.uid = init.uid; - if (init.controller) this.controller = init.controller; - if (init.blockOwnerDeletion) this.blockOwnerDeletion = init.blockOwnerDeletion; + if (!init) { return; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.kind) { this.kind = init.kind; } + if (init.name) { this.name = init.name; } + if (init.uid) { this.uid = init.uid; } + if (init.controller) { this.controller = init.controller; } + if (init.blockOwnerDeletion) { this.blockOwnerDeletion = init.blockOwnerDeletion; } } static emptyObject(): OwnerReference { - let result = new OwnerReference(); + const result = new OwnerReference(); return result; } @@ -2212,13 +2224,13 @@ export class Time { Time: Date; constructor(init?: Time) { - if (!init) return; - if (init.Time) this.Time = new Date(init.Time as any); + if (!init) { return; } + if (init.Time) { this.Time = new Date(init.Time as any); } } static emptyObject(): Time { - let result = new Time(); + const result = new Time(); result.Time = null; return result; } @@ -2244,28 +2256,28 @@ export class ObjectMeta { clusterName: string; constructor(init?: ObjectMeta) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.generateName) this.generateName = init.generateName; - if (init.namespace) this.namespace = init.namespace; - if (init.selfLink) this.selfLink = init.selfLink; - if (init.uid) this.uid = init.uid; - if (init.resourceVersion) this.resourceVersion = init.resourceVersion; - if (init.generation) this.generation = init.generation; - if (init.creationTimestamp) this.creationTimestamp = init.creationTimestamp; - if (init.deletionTimestamp) this.deletionTimestamp = init.deletionTimestamp; - if (init.deletionGracePeriodSeconds) this.deletionGracePeriodSeconds = init.deletionGracePeriodSeconds; - if (init.labels) this.labels = init.labels; - if (init.annotations) this.annotations = init.annotations; - if (init.ownerReferences) this.ownerReferences = init.ownerReferences; - if (init.initializers) this.initializers = init.initializers; - if (init.finalizers) this.finalizers = init.finalizers; - if (init.clusterName) this.clusterName = init.clusterName; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.generateName) { this.generateName = init.generateName; } + if (init.namespace) { this.namespace = init.namespace; } + if (init.selfLink) { this.selfLink = init.selfLink; } + if (init.uid) { this.uid = init.uid; } + if (init.resourceVersion) { this.resourceVersion = init.resourceVersion; } + if (init.generation) { this.generation = init.generation; } + if (init.creationTimestamp) { this.creationTimestamp = init.creationTimestamp; } + if (init.deletionTimestamp) { this.deletionTimestamp = init.deletionTimestamp; } + if (init.deletionGracePeriodSeconds) { this.deletionGracePeriodSeconds = init.deletionGracePeriodSeconds; } + if (init.labels) { this.labels = init.labels; } + if (init.annotations) { this.annotations = init.annotations; } + if (init.ownerReferences) { this.ownerReferences = init.ownerReferences; } + if (init.initializers) { this.initializers = init.initializers; } + if (init.finalizers) { this.finalizers = init.finalizers; } + if (init.clusterName) { this.clusterName = init.clusterName; } } static emptyObject(): ObjectMeta { - let result = new ObjectMeta(); + const result = new ObjectMeta(); result.creationTimestamp = Time.emptyObject(); result.deletionTimestamp = Time.emptyObject(); result.labels = null; @@ -2286,17 +2298,17 @@ export class KubeDaemonSet { status: DaemonSetStatus; constructor(init?: KubeDaemonSet) { - if (!init) return; - if (init.kind) this.kind = init.kind; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.metadata) this.metadata = init.metadata; - if (init.spec) this.spec = init.spec; - if (init.status) this.status = init.status; + if (!init) { return; } + if (init.kind) { this.kind = init.kind; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.metadata) { this.metadata = init.metadata; } + if (init.spec) { this.spec = init.spec; } + if (init.status) { this.status = init.status; } } static emptyObject(): KubeDaemonSet { - let result = new KubeDaemonSet(); + const result = new KubeDaemonSet(); result.metadata = ObjectMeta.emptyObject(); result.spec = DaemonSetSpec.emptyObject(); result.status = DaemonSetStatus.emptyObject(); diff --git a/src/frontend/src/app/shared/model/v1/kubernetes/deployment.ts b/src/frontend/src/app/shared/model/v1/kubernetes/deployment.ts index 272fad64a..93f33b13a 100644 --- a/src/frontend/src/app/shared/model/v1/kubernetes/deployment.ts +++ b/src/frontend/src/app/shared/model/v1/kubernetes/deployment.ts @@ -318,13 +318,13 @@ export class ResourceRequirements { //[ResourceRequirements:] constructor(init?: ResourceRequirements) { - if (!init) return; - if (init.limits) this.limits = init.limits; - if (init.requests) this.requests = init.requests; + if (!init) { return; } + if (init.limits) { this.limits = init.limits; } + if (init.requests) { this.requests = init.requests; } } static emptyObject(): ResourceRequirements { - let result = new ResourceRequirements(); + const result = new ResourceRequirements(); result.limits = null; result.requests = null; return result; diff --git a/src/frontend/src/app/shared/model/v1/kubernetes/node-list.ts b/src/frontend/src/app/shared/model/v1/kubernetes/node-list.ts index 6192b0b92..72ef610fb 100644 --- a/src/frontend/src/app/shared/model/v1/kubernetes/node-list.ts +++ b/src/frontend/src/app/shared/model/v1/kubernetes/node-list.ts @@ -14,22 +14,22 @@ export class NodeSystemInfo { architecture: string; constructor(init?: NodeSystemInfo) { - if (!init) return; - if (init.machineID) this.machineID = init.machineID; - if (init.systemUUID) this.systemUUID = init.systemUUID; - if (init.bootID) this.bootID = init.bootID; - if (init.kernelVersion) this.kernelVersion = init.kernelVersion; - if (init.osImage) this.osImage = init.osImage; - if (init.containerRuntimeVersion) this.containerRuntimeVersion = init.containerRuntimeVersion; - if (init.kubeletVersion) this.kubeletVersion = init.kubeletVersion; - if (init.kubeProxyVersion) this.kubeProxyVersion = init.kubeProxyVersion; - if (init.operatingSystem) this.operatingSystem = init.operatingSystem; - if (init.architecture) this.architecture = init.architecture; + if (!init) { return; } + if (init.machineID) { this.machineID = init.machineID; } + if (init.systemUUID) { this.systemUUID = init.systemUUID; } + if (init.bootID) { this.bootID = init.bootID; } + if (init.kernelVersion) { this.kernelVersion = init.kernelVersion; } + if (init.osImage) { this.osImage = init.osImage; } + if (init.containerRuntimeVersion) { this.containerRuntimeVersion = init.containerRuntimeVersion; } + if (init.kubeletVersion) { this.kubeletVersion = init.kubeletVersion; } + if (init.kubeProxyVersion) { this.kubeProxyVersion = init.kubeProxyVersion; } + if (init.operatingSystem) { this.operatingSystem = init.operatingSystem; } + if (init.architecture) { this.architecture = init.architecture; } } static emptyObject(): NodeSystemInfo { - let result = new NodeSystemInfo(); + const result = new NodeSystemInfo(); return result; } @@ -39,13 +39,13 @@ export class Quantity { Format: string; constructor(init?: Quantity) { - if (!init) return; - if (init.Format) this.Format = init.Format; + if (!init) { return; } + if (init.Format) { this.Format = init.Format; } } static emptyObject(): Quantity { - let result = new Quantity(); + const result = new Quantity(); return result; } @@ -56,14 +56,14 @@ export class NodeStatus { nodeInfo: NodeSystemInfo; constructor(init?: NodeStatus) { - if (!init) return; - if (init.capacity) this.capacity = init.capacity; - if (init.nodeInfo) this.nodeInfo = init.nodeInfo; + if (!init) { return; } + if (init.capacity) { this.capacity = init.capacity; } + if (init.nodeInfo) { this.nodeInfo = init.nodeInfo; } } static emptyObject(): NodeStatus { - let result = new NodeStatus(); + const result = new NodeStatus(); result.capacity = null; result.nodeInfo = NodeSystemInfo.emptyObject(); return result; @@ -75,13 +75,13 @@ export class Time { Time: Date; constructor(init?: Time) { - if (!init) return; + if (!init) { return; } if (init.Time) this.Time = new Date(init.Time as any); } static emptyObject(): Time { - let result = new Time(); + const result = new Time(); result.Time = null; return result; } @@ -95,16 +95,16 @@ export class Taint { timeAdded?: Time; constructor(init?: Taint) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.value) this.value = init.value; - if (init.effect) this.effect = init.effect; - if (init.timeAdded) this.timeAdded = init.timeAdded; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.value) { this.value = init.value; } + if (init.effect) { this.effect = init.effect; } + if (init.timeAdded) { this.timeAdded = init.timeAdded; } } static emptyObject(): Taint { - let result = new Taint(); + const result = new Taint(); result.timeAdded = Time.emptyObject(); return result; } @@ -117,15 +117,15 @@ export class NodeSpec { ready: string; constructor(init?: NodeSpec) { - if (!init) return; - if (init.unschedulable) this.unschedulable = init.unschedulable; - if (init.taints) this.taints = init.taints; - if (init.ready) this.ready = init.ready; + if (!init) { return; } + if (init.unschedulable) { this.unschedulable = init.unschedulable; } + if (init.taints) { this.taints = init.taints; } + if (init.ready) { this.ready = init.ready; } } static emptyObject(): NodeSpec { - let result = new NodeSpec(); + const result = new NodeSpec(); result.taints = []; return result; } @@ -139,16 +139,16 @@ export class Node { status: NodeStatus; constructor(init?: Node) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.labels) this.labels = init.labels; - if (init.spec) this.spec = init.spec; - if (init.status) this.status = init.status; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.labels) { this.labels = init.labels; } + if (init.spec) { this.spec = init.spec; } + if (init.status) { this.status = init.status; } } static emptyObject(): Node { - let result = new Node(); + const result = new Node(); result.labels = null; result.spec = NodeSpec.emptyObject(); result.status = NodeStatus.emptyObject(); diff --git a/src/frontend/src/app/shared/model/v1/kubernetes/node.ts b/src/frontend/src/app/shared/model/v1/kubernetes/node.ts index 7a38b70f1..64d17aaa3 100644 --- a/src/frontend/src/app/shared/model/v1/kubernetes/node.ts +++ b/src/frontend/src/app/shared/model/v1/kubernetes/node.ts @@ -6,14 +6,14 @@ export class AttachedVolume { devicePath: string; constructor(init?: AttachedVolume) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.devicePath) this.devicePath = init.devicePath; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.devicePath) { this.devicePath = init.devicePath; } } static emptyObject(): AttachedVolume { - let result = new AttachedVolume(); + const result = new AttachedVolume(); return result; } @@ -24,14 +24,14 @@ export class ContainerImage { sizeBytes: number; constructor(init?: ContainerImage) { - if (!init) return; - if (init.names) this.names = init.names; - if (init.sizeBytes) this.sizeBytes = init.sizeBytes; + if (!init) { return; } + if (init.names) { this.names = init.names; } + if (init.sizeBytes) { this.sizeBytes = init.sizeBytes; } } static emptyObject(): ContainerImage { - let result = new ContainerImage(); + const result = new ContainerImage(); result.names = []; return result; } @@ -51,22 +51,22 @@ export class NodeSystemInfo { architecture: string; constructor(init?: NodeSystemInfo) { - if (!init) return; - if (init.machineID) this.machineID = init.machineID; - if (init.systemUUID) this.systemUUID = init.systemUUID; - if (init.bootID) this.bootID = init.bootID; - if (init.kernelVersion) this.kernelVersion = init.kernelVersion; - if (init.osImage) this.osImage = init.osImage; - if (init.containerRuntimeVersion) this.containerRuntimeVersion = init.containerRuntimeVersion; - if (init.kubeletVersion) this.kubeletVersion = init.kubeletVersion; - if (init.kubeProxyVersion) this.kubeProxyVersion = init.kubeProxyVersion; - if (init.operatingSystem) this.operatingSystem = init.operatingSystem; - if (init.architecture) this.architecture = init.architecture; + if (!init) { return; } + if (init.machineID) { this.machineID = init.machineID; } + if (init.systemUUID) { this.systemUUID = init.systemUUID; } + if (init.bootID) { this.bootID = init.bootID; } + if (init.kernelVersion) { this.kernelVersion = init.kernelVersion; } + if (init.osImage) { this.osImage = init.osImage; } + if (init.containerRuntimeVersion) { this.containerRuntimeVersion = init.containerRuntimeVersion; } + if (init.kubeletVersion) { this.kubeletVersion = init.kubeletVersion; } + if (init.kubeProxyVersion) { this.kubeProxyVersion = init.kubeProxyVersion; } + if (init.operatingSystem) { this.operatingSystem = init.operatingSystem; } + if (init.architecture) { this.architecture = init.architecture; } } static emptyObject(): NodeSystemInfo { - let result = new NodeSystemInfo(); + const result = new NodeSystemInfo(); return result; } @@ -76,13 +76,13 @@ export class DaemonEndpoint { Port: number; constructor(init?: DaemonEndpoint) { - if (!init) return; - if (init.Port) this.Port = init.Port; + if (!init) { return; } + if (init.port) { this.port = init.port; } } static emptyObject(): DaemonEndpoint { - let result = new DaemonEndpoint(); + const result = new DaemonEndpoint(); return result; } @@ -92,13 +92,13 @@ export class NodeDaemonEndpoints { kubeletEndpoint: DaemonEndpoint; constructor(init?: NodeDaemonEndpoints) { - if (!init) return; - if (init.kubeletEndpoint) this.kubeletEndpoint = init.kubeletEndpoint; + if (!init) { return; } + if (init.kubeletEndpoint) { this.kubeletEndpoint = init.kubeletEndpoint; } } static emptyObject(): NodeDaemonEndpoints { - let result = new NodeDaemonEndpoints(); + const result = new NodeDaemonEndpoints(); result.kubeletEndpoint = DaemonEndpoint.emptyObject(); return result; } @@ -110,14 +110,14 @@ export class NodeAddress { address: string; constructor(init?: NodeAddress) { - if (!init) return; - if (init.type) this.type = init.type; - if (init.address) this.address = init.address; + if (!init) { return; } + if (init.type) { this.type = init.type; } + if (init.address) { this.address = init.address; } } static emptyObject(): NodeAddress { - let result = new NodeAddress(); + const result = new NodeAddress(); return result; } @@ -133,18 +133,18 @@ export class NodeCondition { message: string; constructor(init?: NodeCondition) { - if (!init) return; - if (init.type) this.type = init.type; - if (init.status) this.status = init.status; - if (init.lastHeartbeatTime) this.lastHeartbeatTime = init.lastHeartbeatTime; - if (init.lastTransitionTime) this.lastTransitionTime = init.lastTransitionTime; - if (init.reason) this.reason = init.reason; - if (init.message) this.message = init.message; + if (!init) { return; } + if (init.type) { this.type = init.type; } + if (init.status) { this.status = init.status; } + if (init.lastHeartbeatTime) { this.lastHeartbeatTime = init.lastHeartbeatTime; } + if (init.lastTransitionTime) { this.lastTransitionTime = init.lastTransitionTime; } + if (init.reason) { this.reason = init.reason; } + if (init.message) { this.message = init.message; } } static emptyObject(): NodeCondition { - let result = new NodeCondition(); + const result = new NodeCondition(); result.lastHeartbeatTime = Time.emptyObject(); result.lastTransitionTime = Time.emptyObject(); return result; @@ -156,13 +156,13 @@ export class Quantity { Format: string; constructor(init?: Quantity) { - if (!init) return; - if (init.Format) this.Format = init.Format; + if (!init) { return; } + if (init.Format) { this.Format = init.Format; } } static emptyObject(): Quantity { - let result = new Quantity(); + const result = new Quantity(); return result; } @@ -181,22 +181,22 @@ export class NodeStatus { volumesAttached: AttachedVolume[]; constructor(init?: NodeStatus) { - if (!init) return; - if (init.capacity) this.capacity = init.capacity; - if (init.allocatable) this.allocatable = init.allocatable; - if (init.phase) this.phase = init.phase; - if (init.conditions) this.conditions = init.conditions; - if (init.addresses) this.addresses = init.addresses; - if (init.daemonEndpoints) this.daemonEndpoints = init.daemonEndpoints; - if (init.nodeInfo) this.nodeInfo = init.nodeInfo; - if (init.images) this.images = init.images; - if (init.volumesInUse) this.volumesInUse = init.volumesInUse; - if (init.volumesAttached) this.volumesAttached = init.volumesAttached; + if (!init) { return; } + if (init.capacity) { this.capacity = init.capacity; } + if (init.allocatable) { this.allocatable = init.allocatable; } + if (init.phase) { this.phase = init.phase; } + if (init.conditions) { this.conditions = init.conditions; } + if (init.addresses) { this.addresses = init.addresses; } + if (init.daemonEndpoints) { this.daemonEndpoints = init.daemonEndpoints; } + if (init.nodeInfo) { this.nodeInfo = init.nodeInfo; } + if (init.images) { this.images = init.images; } + if (init.volumesInUse) { this.volumesInUse = init.volumesInUse; } + if (init.volumesAttached) { this.volumesAttached = init.volumesAttached; } } static emptyObject(): NodeStatus { - let result = new NodeStatus(); + const result = new NodeStatus(); result.capacity = null; result.allocatable = null; result.conditions = []; @@ -221,19 +221,19 @@ export class ObjectReference { fieldPath: string; constructor(init?: ObjectReference) { - if (!init) return; - if (init.kind) this.kind = init.kind; - if (init.namespace) this.namespace = init.namespace; - if (init.name) this.name = init.name; - if (init.uid) this.uid = init.uid; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.resourceVersion) this.resourceVersion = init.resourceVersion; - if (init.fieldPath) this.fieldPath = init.fieldPath; + if (!init) { return; } + if (init.kind) { this.kind = init.kind; } + if (init.namespace) { this.namespace = init.namespace; } + if (init.name) { this.name = init.name; } + if (init.uid) { this.uid = init.uid; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.resourceVersion) { this.resourceVersion = init.resourceVersion; } + if (init.fieldPath) { this.fieldPath = init.fieldPath; } } static emptyObject(): ObjectReference { - let result = new ObjectReference(); + const result = new ObjectReference(); return result; } @@ -245,15 +245,15 @@ export class NodeConfigSource { configMapRef?: ObjectReference; constructor(init?: NodeConfigSource) { - if (!init) return; - if (init.kind) this.kind = init.kind; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.configMapRef) this.configMapRef = init.configMapRef; + if (!init) { return; } + if (init.kind) { this.kind = init.kind; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.configMapRef) { this.configMapRef = init.configMapRef; } } static emptyObject(): NodeConfigSource { - let result = new NodeConfigSource(); + const result = new NodeConfigSource(); result.configMapRef = ObjectReference.emptyObject(); return result; } @@ -267,16 +267,16 @@ export class Taint { timeAdded?: Time; constructor(init?: Taint) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.value) this.value = init.value; - if (init.effect) this.effect = init.effect; - if (init.timeAdded) this.timeAdded = init.timeAdded; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.value) { this.value = init.value; } + if (init.effect) { this.effect = init.effect; } + if (init.timeAdded) { this.timeAdded = init.timeAdded; } } static emptyObject(): Taint { - let result = new Taint(); + const result = new Taint(); result.timeAdded = Time.emptyObject(); return result; } @@ -292,18 +292,18 @@ export class NodeSpec { configSource?: NodeConfigSource; constructor(init?: NodeSpec) { - if (!init) return; - if (init.podCIDR) this.podCIDR = init.podCIDR; - if (init.externalID) this.externalID = init.externalID; - if (init.providerID) this.providerID = init.providerID; - if (init.unschedulable) this.unschedulable = init.unschedulable; - if (init.taints) this.taints = init.taints; - if (init.configSource) this.configSource = init.configSource; + if (!init) { return; } + if (init.podCIDR) { this.podCIDR = init.podCIDR; } + if (init.externalID) { this.externalID = init.externalID; } + if (init.providerID) { this.providerID = init.providerID; } + if (init.unschedulable) { this.unschedulable = init.unschedulable; } + if (init.taints) { this.taints = init.taints; } + if (init.configSource) { this.configSource = init.configSource; } } static emptyObject(): NodeSpec { - let result = new NodeSpec(); + const result = new NodeSpec(); result.taints = []; result.configSource = NodeConfigSource.emptyObject(); return result; @@ -317,15 +317,15 @@ export class StatusCause { field: string; constructor(init?: StatusCause) { - if (!init) return; - if (init.reason) this.reason = init.reason; - if (init.message) this.message = init.message; - if (init.field) this.field = init.field; + if (!init) { return; } + if (init.reason) { this.reason = init.reason; } + if (init.message) { this.message = init.message; } + if (init.field) { this.field = init.field; } } static emptyObject(): StatusCause { - let result = new StatusCause(); + const result = new StatusCause(); return result; } @@ -340,18 +340,18 @@ export class StatusDetails { retryAfterSeconds: number; constructor(init?: StatusDetails) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.group) this.group = init.group; - if (init.kind) this.kind = init.kind; - if (init.uid) this.uid = init.uid; - if (init.causes) this.causes = init.causes; - if (init.retryAfterSeconds) this.retryAfterSeconds = init.retryAfterSeconds; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.group) { this.group = init.group; } + if (init.kind) { this.kind = init.kind; } + if (init.uid) { this.uid = init.uid; } + if (init.causes) { this.causes = init.causes; } + if (init.retryAfterSeconds) { this.retryAfterSeconds = init.retryAfterSeconds; } } static emptyObject(): StatusDetails { - let result = new StatusDetails(); + const result = new StatusDetails(); result.causes = []; return result; } @@ -364,15 +364,15 @@ export class ListMeta { continue: string; constructor(init?: ListMeta) { - if (!init) return; - if (init.selfLink) this.selfLink = init.selfLink; - if (init.resourceVersion) this.resourceVersion = init.resourceVersion; - if (init.continue) this.continue = init.continue; + if (!init) { return; } + if (init.selfLink) { this.selfLink = init.selfLink; } + if (init.resourceVersion) { this.resourceVersion = init.resourceVersion; } + if (init.continue) { this.continue = init.continue; } } static emptyObject(): ListMeta { - let result = new ListMeta(); + const result = new ListMeta(); return result; } @@ -389,20 +389,20 @@ export class Status { code: number; constructor(init?: Status) { - if (!init) return; - if (init.kind) this.kind = init.kind; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.metadata) this.metadata = init.metadata; - if (init.status) this.status = init.status; - if (init.message) this.message = init.message; - if (init.reason) this.reason = init.reason; - if (init.details) this.details = init.details; - if (init.code) this.code = init.code; + if (!init) { return; } + if (init.kind) { this.kind = init.kind; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.metadata) { this.metadata = init.metadata; } + if (init.status) { this.status = init.status; } + if (init.message) { this.message = init.message; } + if (init.reason) { this.reason = init.reason; } + if (init.details) { this.details = init.details; } + if (init.code) { this.code = init.code; } } static emptyObject(): Status { - let result = new Status(); + const result = new Status(); result.metadata = ListMeta.emptyObject(); result.details = StatusDetails.emptyObject(); return result; @@ -414,13 +414,13 @@ export class Initializer { name: string; constructor(init?: Initializer) { - if (!init) return; - if (init.name) this.name = init.name; + if (!init) { return; } + if (init.name) { this.name = init.name; } } static emptyObject(): Initializer { - let result = new Initializer(); + const result = new Initializer(); return result; } @@ -431,14 +431,14 @@ export class Initializers { result?: Status; constructor(init?: Initializers) { - if (!init) return; - if (init.pending) this.pending = init.pending; - if (init.result) this.result = init.result; + if (!init) { return; } + if (init.pending) { this.pending = init.pending; } + if (init.result) { this.result = init.result; } } static emptyObject(): Initializers { - let result = new Initializers(); + const result = new Initializers(); result.pending = []; result.result = Status.emptyObject(); return result; @@ -455,18 +455,18 @@ export class OwnerReference { blockOwnerDeletion?: boolean; constructor(init?: OwnerReference) { - if (!init) return; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.kind) this.kind = init.kind; - if (init.name) this.name = init.name; - if (init.uid) this.uid = init.uid; - if (init.controller) this.controller = init.controller; - if (init.blockOwnerDeletion) this.blockOwnerDeletion = init.blockOwnerDeletion; + if (!init) { return; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.kind) { this.kind = init.kind; } + if (init.name) { this.name = init.name; } + if (init.uid) { this.uid = init.uid; } + if (init.controller) { this.controller = init.controller; } + if (init.blockOwnerDeletion) { this.blockOwnerDeletion = init.blockOwnerDeletion; } } static emptyObject(): OwnerReference { - let result = new OwnerReference(); + const result = new OwnerReference(); return result; } @@ -477,13 +477,13 @@ export class Time { Time: Date; constructor(init?: Time) { - if (!init) return; + if (!init) { return; } if (init.Time) this.Time = new Date(init.Time as any); } static emptyObject(): Time { - let result = new Time(); + const result = new Time(); result.Time = null; return result; } @@ -509,28 +509,28 @@ export class ObjectMeta { clusterName: string; constructor(init?: ObjectMeta) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.generateName) this.generateName = init.generateName; - if (init.namespace) this.namespace = init.namespace; - if (init.selfLink) this.selfLink = init.selfLink; - if (init.uid) this.uid = init.uid; - if (init.resourceVersion) this.resourceVersion = init.resourceVersion; - if (init.generation) this.generation = init.generation; - if (init.creationTimestamp) this.creationTimestamp = init.creationTimestamp; - if (init.deletionTimestamp) this.deletionTimestamp = init.deletionTimestamp; - if (init.deletionGracePeriodSeconds) this.deletionGracePeriodSeconds = init.deletionGracePeriodSeconds; - if (init.labels) this.labels = init.labels; - if (init.annotations) this.annotations = init.annotations; - if (init.ownerReferences) this.ownerReferences = init.ownerReferences; - if (init.initializers) this.initializers = init.initializers; - if (init.finalizers) this.finalizers = init.finalizers; - if (init.clusterName) this.clusterName = init.clusterName; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.generateName) { this.generateName = init.generateName; } + if (init.namespace) { this.namespace = init.namespace; } + if (init.selfLink) { this.selfLink = init.selfLink; } + if (init.uid) { this.uid = init.uid; } + if (init.resourceVersion) { this.resourceVersion = init.resourceVersion; } + if (init.generation) { this.generation = init.generation; } + if (init.creationTimestamp) { this.creationTimestamp = init.creationTimestamp; } + if (init.deletionTimestamp) { this.deletionTimestamp = init.deletionTimestamp; } + if (init.deletionGracePeriodSeconds) { this.deletionGracePeriodSeconds = init.deletionGracePeriodSeconds; } + if (init.labels) { this.labels = init.labels; } + if (init.annotations) { this.annotations = init.annotations; } + if (init.ownerReferences) { this.ownerReferences = init.ownerReferences; } + if (init.initializers) { this.initializers = init.initializers; } + if (init.finalizers) { this.finalizers = init.finalizers; } + if (init.clusterName) { this.clusterName = init.clusterName; } } static emptyObject(): ObjectMeta { - let result = new ObjectMeta(); + const result = new ObjectMeta(); result.creationTimestamp = Time.emptyObject(); result.deletionTimestamp = Time.emptyObject(); result.labels = null; @@ -551,17 +551,17 @@ export class KubeNode { status: NodeStatus; constructor(init?: KubeNode) { - if (!init) return; - if (init.kind) this.kind = init.kind; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.metadata) this.metadata = init.metadata; - if (init.spec) this.spec = init.spec; - if (init.status) this.status = init.status; + if (!init) { return; } + if (init.kind) { this.kind = init.kind; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.metadata) { this.metadata = init.metadata; } + if (init.spec) { this.spec = init.spec; } + if (init.status) { this.status = init.status; } } static emptyObject(): KubeNode { - let result = new KubeNode(); + const result = new KubeNode(); result.metadata = ObjectMeta.emptyObject(); result.spec = NodeSpec.emptyObject(); result.status = NodeStatus.emptyObject(); diff --git a/src/frontend/src/app/shared/model/v1/kubernetes/statefulset.ts b/src/frontend/src/app/shared/model/v1/kubernetes/statefulset.ts index d6f23ad4d..decc1c375 100644 --- a/src/frontend/src/app/shared/model/v1/kubernetes/statefulset.ts +++ b/src/frontend/src/app/shared/model/v1/kubernetes/statefulset.ts @@ -9,17 +9,17 @@ export class StatefulSetCondition { message: string; constructor(init?: StatefulSetCondition) { - if (!init) return; - if (init.type) this.type = init.type; - if (init.status) this.status = init.status; - if (init.lastTransitionTime) this.lastTransitionTime = init.lastTransitionTime; - if (init.reason) this.reason = init.reason; - if (init.message) this.message = init.message; + if (!init) { return; } + if (init.type) { this.type = init.type; } + if (init.status) { this.status = init.status; } + if (init.lastTransitionTime) { this.lastTransitionTime = init.lastTransitionTime; } + if (init.reason) { this.reason = init.reason; } + if (init.message) { this.message = init.message; } } static emptyObject(): StatefulSetCondition { - let result = new StatefulSetCondition(); + const result = new StatefulSetCondition(); result.lastTransitionTime = null; return result; } @@ -38,21 +38,21 @@ export class StatefulSetStatus { conditions: StatefulSetCondition[]; constructor(init?: StatefulSetStatus) { - if (!init) return; - if (init.observedGeneration) this.observedGeneration = init.observedGeneration; - if (init.replicas) this.replicas = init.replicas; - if (init.readyReplicas) this.readyReplicas = init.readyReplicas; - if (init.currentReplicas) this.currentReplicas = init.currentReplicas; - if (init.updatedReplicas) this.updatedReplicas = init.updatedReplicas; - if (init.currentRevision) this.currentRevision = init.currentRevision; - if (init.updateRevision) this.updateRevision = init.updateRevision; - if (init.collisionCount) this.collisionCount = init.collisionCount; - if (init.conditions) this.conditions = init.conditions; + if (!init) { return; } + if (init.observedGeneration) { this.observedGeneration = init.observedGeneration; } + if (init.replicas) { this.replicas = init.replicas; } + if (init.readyReplicas) { this.readyReplicas = init.readyReplicas; } + if (init.currentReplicas) { this.currentReplicas = init.currentReplicas; } + if (init.updatedReplicas) { this.updatedReplicas = init.updatedReplicas; } + if (init.currentRevision) { this.currentRevision = init.currentRevision; } + if (init.updateRevision) { this.updateRevision = init.updateRevision; } + if (init.collisionCount) { this.collisionCount = init.collisionCount; } + if (init.conditions) { this.conditions = init.conditions; } } static emptyObject(): StatefulSetStatus { - let result = new StatefulSetStatus(); + const result = new StatefulSetStatus(); result.conditions = []; return result; } @@ -63,13 +63,13 @@ export class RollingUpdateStatefulSetStrategy { partition?: number; constructor(init?: RollingUpdateStatefulSetStrategy) { - if (!init) return; - if (init.partition) this.partition = init.partition; + if (!init) { return; } + if (init.partition) { this.partition = init.partition; } } static emptyObject(): RollingUpdateStatefulSetStrategy { - let result = new RollingUpdateStatefulSetStrategy(); + const result = new RollingUpdateStatefulSetStrategy(); return result; } @@ -80,14 +80,14 @@ export class StatefulSetUpdateStrategy { rollingUpdate?: RollingUpdateStatefulSetStrategy; constructor(init?: StatefulSetUpdateStrategy) { - if (!init) return; - if (init.type) this.type = init.type; - if (init.rollingUpdate) this.rollingUpdate = init.rollingUpdate; + if (!init) { return; } + if (init.type) { this.type = init.type; } + if (init.rollingUpdate) { this.rollingUpdate = init.rollingUpdate; } } static emptyObject(): StatefulSetUpdateStrategy { - let result = new StatefulSetUpdateStrategy(); + const result = new StatefulSetUpdateStrategy(); result.rollingUpdate = RollingUpdateStatefulSetStrategy.emptyObject(); return result; } @@ -103,18 +103,18 @@ export class PersistentVolumeClaimCondition { message: string; constructor(init?: PersistentVolumeClaimCondition) { - if (!init) return; - if (init.type) this.type = init.type; - if (init.status) this.status = init.status; - if (init.lastProbeTime) this.lastProbeTime = init.lastProbeTime; - if (init.lastTransitionTime) this.lastTransitionTime = init.lastTransitionTime; - if (init.reason) this.reason = init.reason; - if (init.message) this.message = init.message; + if (!init) { return; } + if (init.type) { this.type = init.type; } + if (init.status) { this.status = init.status; } + if (init.lastProbeTime) { this.lastProbeTime = init.lastProbeTime; } + if (init.lastTransitionTime) { this.lastTransitionTime = init.lastTransitionTime; } + if (init.reason) { this.reason = init.reason; } + if (init.message) { this.message = init.message; } } static emptyObject(): PersistentVolumeClaimCondition { - let result = new PersistentVolumeClaimCondition(); + const result = new PersistentVolumeClaimCondition(); result.lastProbeTime = null; result.lastTransitionTime = null; return result; @@ -129,16 +129,16 @@ export class PersistentVolumeClaimStatus { conditions: PersistentVolumeClaimCondition[]; constructor(init?: PersistentVolumeClaimStatus) { - if (!init) return; - if (init.phase) this.phase = init.phase; - if (init.accessModes) this.accessModes = init.accessModes; - if (init.capacity) this.capacity = init.capacity; - if (init.conditions) this.conditions = init.conditions; + if (!init) { return; } + if (init.phase) { this.phase = init.phase; } + if (init.accessModes) { this.accessModes = init.accessModes; } + if (init.capacity) { this.capacity = init.capacity; } + if (init.conditions) { this.conditions = init.conditions; } } static emptyObject(): PersistentVolumeClaimStatus { - let result = new PersistentVolumeClaimStatus(); + const result = new PersistentVolumeClaimStatus(); result.accessModes = []; result.capacity = null; result.conditions = []; @@ -157,18 +157,18 @@ export class PersistentVolumeClaimSpec { volumeMode?: string; constructor(init?: PersistentVolumeClaimSpec) { - if (!init) return; - if (init.accessModes) this.accessModes = init.accessModes; - if (init.selector) this.selector = init.selector; - if (init.resources) this.resources = init.resources; - if (init.volumeName) this.volumeName = init.volumeName; - if (init.storageClassName) this.storageClassName = init.storageClassName; - if (init.volumeMode) this.volumeMode = init.volumeMode; + if (!init) { return; } + if (init.accessModes) { this.accessModes = init.accessModes; } + if (init.selector) { this.selector = init.selector; } + if (init.resources) { this.resources = init.resources; } + if (init.volumeName) { this.volumeName = init.volumeName; } + if (init.storageClassName) { this.storageClassName = init.storageClassName; } + if (init.volumeMode) { this.volumeMode = init.volumeMode; } } static emptyObject(): PersistentVolumeClaimSpec { - let result = new PersistentVolumeClaimSpec(); + const result = new PersistentVolumeClaimSpec(); result.accessModes = []; result.selector = LabelSelector.emptyObject(); result.resources = ResourceRequirements.emptyObject(); @@ -185,17 +185,17 @@ export class PersistentVolumeClaim { status: PersistentVolumeClaimStatus; constructor(init?: PersistentVolumeClaim) { - if (!init) return; - if (init.kind) this.kind = init.kind; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.metadata) this.metadata = init.metadata; - if (init.spec) this.spec = init.spec; - if (init.status) this.status = init.status; + if (!init) { return; } + if (init.kind) { this.kind = init.kind; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.metadata) { this.metadata = init.metadata; } + if (init.spec) { this.spec = init.spec; } + if (init.status) { this.status = init.status; } } static emptyObject(): PersistentVolumeClaim { - let result = new PersistentVolumeClaim(); + const result = new PersistentVolumeClaim(); result.metadata = ObjectMeta.emptyObject(); result.spec = PersistentVolumeClaimSpec.emptyObject(); result.status = PersistentVolumeClaimStatus.emptyObject(); @@ -209,14 +209,14 @@ export class PodDNSConfigOption { value?: string; constructor(init?: PodDNSConfigOption) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.value) this.value = init.value; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.value) { this.value = init.value; } } static emptyObject(): PodDNSConfigOption { - let result = new PodDNSConfigOption(); + const result = new PodDNSConfigOption(); return result; } @@ -228,15 +228,15 @@ export class PodDNSConfig { options: PodDNSConfigOption[]; constructor(init?: PodDNSConfig) { - if (!init) return; - if (init.nameservers) this.nameservers = init.nameservers; - if (init.searches) this.searches = init.searches; - if (init.options) this.options = init.options; + if (!init) { return; } + if (init.nameservers) { this.nameservers = init.nameservers; } + if (init.searches) { this.searches = init.searches; } + if (init.options) { this.options = init.options; } } static emptyObject(): PodDNSConfig { - let result = new PodDNSConfig(); + const result = new PodDNSConfig(); result.nameservers = []; result.searches = []; result.options = []; @@ -250,14 +250,14 @@ export class HostAlias { hostnames: string[]; constructor(init?: HostAlias) { - if (!init) return; - if (init.ip) this.ip = init.ip; - if (init.hostnames) this.hostnames = init.hostnames; + if (!init) { return; } + if (init.ip) { this.ip = init.ip; } + if (init.hostnames) { this.hostnames = init.hostnames; } } static emptyObject(): HostAlias { - let result = new HostAlias(); + const result = new HostAlias(); result.hostnames = []; return result; } @@ -272,17 +272,17 @@ export class Toleration { tolerationSeconds?: number; constructor(init?: Toleration) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.value) this.value = init.value; - if (init.effect) this.effect = init.effect; - if (init.tolerationSeconds) this.tolerationSeconds = init.tolerationSeconds; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.value) { this.value = init.value; } + if (init.effect) { this.effect = init.effect; } + if (init.tolerationSeconds) { this.tolerationSeconds = init.tolerationSeconds; } } static emptyObject(): Toleration { - let result = new Toleration(); + const result = new Toleration(); return result; } @@ -294,14 +294,14 @@ export class PodAntiAffinity { preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAntiAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): PodAntiAffinity { - let result = new PodAntiAffinity(); + const result = new PodAntiAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -314,14 +314,14 @@ export class WeightedPodAffinityTerm { podAffinityTerm: PodAffinityTerm; constructor(init?: WeightedPodAffinityTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.podAffinityTerm) this.podAffinityTerm = init.podAffinityTerm; + if (!init) { return; } + if (init.weight) { this.weight = init.weight; } + if (init.podAffinityTerm) { this.podAffinityTerm = init.podAffinityTerm; } } static emptyObject(): WeightedPodAffinityTerm { - let result = new WeightedPodAffinityTerm(); + const result = new WeightedPodAffinityTerm(); result.podAffinityTerm = PodAffinityTerm.emptyObject(); return result; } @@ -334,15 +334,15 @@ export class PodAffinityTerm { topologyKey: string; constructor(init?: PodAffinityTerm) { - if (!init) return; - if (init.labelSelector) this.labelSelector = init.labelSelector; - if (init.namespaces) this.namespaces = init.namespaces; - if (init.topologyKey) this.topologyKey = init.topologyKey; + if (!init) { return; } + if (init.labelSelector) { this.labelSelector = init.labelSelector; } + if (init.namespaces) { this.namespaces = init.namespaces; } + if (init.topologyKey) { this.topologyKey = init.topologyKey; } } static emptyObject(): PodAffinityTerm { - let result = new PodAffinityTerm(); + const result = new PodAffinityTerm(); result.labelSelector = LabelSelector.emptyObject(); result.namespaces = []; return result; @@ -355,14 +355,14 @@ export class PodAffinity { preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): PodAffinity { - let result = new PodAffinity(); + const result = new PodAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -375,14 +375,14 @@ export class PreferredSchedulingTerm { preference: NodeSelectorTerm; constructor(init?: PreferredSchedulingTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.preference) this.preference = init.preference; + if (!init) { return; } + if (init.weight) { this.weight = init.weight; } + if (init.preference) { this.preference = init.preference; } } static emptyObject(): PreferredSchedulingTerm { - let result = new PreferredSchedulingTerm(); + const result = new PreferredSchedulingTerm(); result.preference = NodeSelectorTerm.emptyObject(); return result; } @@ -395,15 +395,15 @@ export class NodeSelectorRequirement { values: string[]; constructor(init?: NodeSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.values) { this.values = init.values; } } static emptyObject(): NodeSelectorRequirement { - let result = new NodeSelectorRequirement(); + const result = new NodeSelectorRequirement(); result.values = []; return result; } @@ -414,13 +414,13 @@ export class NodeSelectorTerm { matchExpressions: NodeSelectorRequirement[]; constructor(init?: NodeSelectorTerm) { - if (!init) return; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchExpressions) { this.matchExpressions = init.matchExpressions; } } static emptyObject(): NodeSelectorTerm { - let result = new NodeSelectorTerm(); + const result = new NodeSelectorTerm(); result.matchExpressions = []; return result; } @@ -431,13 +431,13 @@ export class NodeSelector { nodeSelectorTerms: NodeSelectorTerm[]; constructor(init?: NodeSelector) { - if (!init) return; - if (init.nodeSelectorTerms) this.nodeSelectorTerms = init.nodeSelectorTerms; + if (!init) { return; } + if (init.nodeSelectorTerms) { this.nodeSelectorTerms = init.nodeSelectorTerms; } } static emptyObject(): NodeSelector { - let result = new NodeSelector(); + const result = new NodeSelector(); result.nodeSelectorTerms = []; return result; } @@ -449,14 +449,14 @@ export class NodeAffinity { preferredDuringSchedulingIgnoredDuringExecution: PreferredSchedulingTerm[]; constructor(init?: NodeAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; } } static emptyObject(): NodeAffinity { - let result = new NodeAffinity(); + const result = new NodeAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = NodeSelector.emptyObject(); result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -470,15 +470,15 @@ export class Affinity { podAntiAffinity?: PodAntiAffinity; constructor(init?: Affinity) { - if (!init) return; - if (init.nodeAffinity) this.nodeAffinity = init.nodeAffinity; - if (init.podAffinity) this.podAffinity = init.podAffinity; - if (init.podAntiAffinity) this.podAntiAffinity = init.podAntiAffinity; + if (!init) { return; } + if (init.nodeAffinity) { this.nodeAffinity = init.nodeAffinity; } + if (init.podAffinity) { this.podAffinity = init.podAffinity; } + if (init.podAntiAffinity) { this.podAntiAffinity = init.podAntiAffinity; } } static emptyObject(): Affinity { - let result = new Affinity(); + const result = new Affinity(); result.nodeAffinity = NodeAffinity.emptyObject(); result.podAffinity = PodAffinity.emptyObject(); result.podAntiAffinity = PodAntiAffinity.emptyObject(); @@ -497,18 +497,18 @@ export class PodSecurityContext { fsGroup?: number; constructor(init?: PodSecurityContext) { - if (!init) return; - if (init.seLinuxOptions) this.seLinuxOptions = init.seLinuxOptions; - if (init.runAsUser) this.runAsUser = init.runAsUser; - if (init.runAsGroup) this.runAsGroup = init.runAsGroup; - if (init.runAsNonRoot) this.runAsNonRoot = init.runAsNonRoot; - if (init.supplementalGroups) this.supplementalGroups = init.supplementalGroups; - if (init.fsGroup) this.fsGroup = init.fsGroup; + if (!init) { return; } + if (init.seLinuxOptions) { this.seLinuxOptions = init.seLinuxOptions; } + if (init.runAsUser) { this.runAsUser = init.runAsUser; } + if (init.runAsGroup) { this.runAsGroup = init.runAsGroup; } + if (init.runAsNonRoot) { this.runAsNonRoot = init.runAsNonRoot; } + if (init.supplementalGroups) { this.supplementalGroups = init.supplementalGroups; } + if (init.fsGroup) { this.fsGroup = init.fsGroup; } } static emptyObject(): PodSecurityContext { - let result = new PodSecurityContext(); + const result = new PodSecurityContext(); result.seLinuxOptions = SELinuxOptions.emptyObject(); result.supplementalGroups = []; return result; @@ -523,16 +523,16 @@ export class SELinuxOptions { level: string; constructor(init?: SELinuxOptions) { - if (!init) return; - if (init.user) this.user = init.user; - if (init.role) this.role = init.role; - if (init.type) this.type = init.type; - if (init.level) this.level = init.level; + if (!init) { return; } + if (init.user) { this.user = init.user; } + if (init.role) { this.role = init.role; } + if (init.type) { this.type = init.type; } + if (init.level) { this.level = init.level; } } static emptyObject(): SELinuxOptions { - let result = new SELinuxOptions(); + const result = new SELinuxOptions(); return result; } @@ -543,14 +543,14 @@ export class Capabilities { drop: string[]; constructor(init?: Capabilities) { - if (!init) return; - if (init.add) this.add = init.add; - if (init.drop) this.drop = init.drop; + if (!init) { return; } + if (init.add) { this.add = init.add; } + if (init.drop) { this.drop = init.drop; } } static emptyObject(): Capabilities { - let result = new Capabilities(); + const result = new Capabilities(); result.add = []; result.drop = []; return result; @@ -569,20 +569,20 @@ export class SecurityContext { allowPrivilegeEscalation?: boolean; constructor(init?: SecurityContext) { - if (!init) return; - if (init.capabilities) this.capabilities = init.capabilities; - if (init.privileged) this.privileged = init.privileged; - if (init.seLinuxOptions) this.seLinuxOptions = init.seLinuxOptions; - if (init.runAsUser) this.runAsUser = init.runAsUser; - if (init.runAsGroup) this.runAsGroup = init.runAsGroup; - if (init.runAsNonRoot) this.runAsNonRoot = init.runAsNonRoot; - if (init.readOnlyRootFilesystem) this.readOnlyRootFilesystem = init.readOnlyRootFilesystem; - if (init.allowPrivilegeEscalation) this.allowPrivilegeEscalation = init.allowPrivilegeEscalation; + if (!init) { return; } + if (init.capabilities) { this.capabilities = init.capabilities; } + if (init.privileged) { this.privileged = init.privileged; } + if (init.seLinuxOptions) { this.seLinuxOptions = init.seLinuxOptions; } + if (init.runAsUser) { this.runAsUser = init.runAsUser; } + if (init.runAsGroup) { this.runAsGroup = init.runAsGroup; } + if (init.runAsNonRoot) { this.runAsNonRoot = init.runAsNonRoot; } + if (init.readOnlyRootFilesystem) { this.readOnlyRootFilesystem = init.readOnlyRootFilesystem; } + if (init.allowPrivilegeEscalation) { this.allowPrivilegeEscalation = init.allowPrivilegeEscalation; } } static emptyObject(): SecurityContext { - let result = new SecurityContext(); + const result = new SecurityContext(); result.capabilities = Capabilities.emptyObject(); result.seLinuxOptions = SELinuxOptions.emptyObject(); return result; @@ -599,15 +599,15 @@ export class Handler { tcpSocket?: TCPSocketAction; constructor(init?: Handler) { - if (!init) return; - if (init.exec) this.exec = init.exec; - if (init.httpGet) this.httpGet = init.httpGet; - if (init.tcpSocket) this.tcpSocket = init.tcpSocket; + if (!init) { return; } + if (init.exec) { this.exec = init.exec; } + if (init.httpGet) { this.httpGet = init.httpGet; } + if (init.tcpSocket) { this.tcpSocket = init.tcpSocket; } } static emptyObject(): Handler { - let result = new Handler(); + const result = new Handler(); result.exec = ExecAction.emptyObject(); result.httpGet = HTTPGetAction.emptyObject(); result.tcpSocket = TCPSocketAction.emptyObject(); @@ -621,14 +621,14 @@ export class Lifecycle { preStop?: Handler; constructor(init?: Lifecycle) { - if (!init) return; - if (init.postStart) this.postStart = init.postStart; - if (init.preStop) this.preStop = init.preStop; + if (!init) { return; } + if (init.postStart) { this.postStart = init.postStart; } + if (init.preStop) { this.preStop = init.preStop; } } static emptyObject(): Lifecycle { - let result = new Lifecycle(); + const result = new Lifecycle(); result.postStart = Handler.emptyObject(); result.preStop = Handler.emptyObject(); return result; @@ -642,14 +642,14 @@ export class TCPSocketAction { host: string; constructor(init?: TCPSocketAction) { - if (!init) return; - if (init.port) this.port = init.port; - if (init.host) this.host = init.host; + if (!init) { return; } + if (init.port) { this.port = init.port; } + if (init.host) { this.host = init.host; } } static emptyObject(): TCPSocketAction { - let result = new TCPSocketAction(); + const result = new TCPSocketAction(); result.port = IntOrString.emptyObject(); return result; } @@ -661,14 +661,14 @@ export class HTTPHeader { value: string; constructor(init?: HTTPHeader) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.value) this.value = init.value; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.value) { this.value = init.value; } } static emptyObject(): HTTPHeader { - let result = new HTTPHeader(); + const result = new HTTPHeader(); return result; } @@ -680,15 +680,15 @@ export class IntOrString { StrVal: string; constructor(init?: IntOrString) { - if (!init) return; - if (init.Type) this.Type = init.Type; - if (init.IntVal) this.IntVal = init.IntVal; - if (init.StrVal) this.StrVal = init.StrVal; + if (!init) { return; } + if (init.type) { this.type = init.type; } + if (init.IntVal) { this.IntVal = init.IntVal; } + if (init.StrVal) { this.StrVal = init.StrVal; } } static emptyObject(): IntOrString { - let result = new IntOrString(); + const result = new IntOrString(); return result; } @@ -702,17 +702,17 @@ export class HTTPGetAction { httpHeaders: HTTPHeader[]; constructor(init?: HTTPGetAction) { - if (!init) return; - if (init.path) this.path = init.path; - if (init.port) this.port = init.port; - if (init.host) this.host = init.host; - if (init.scheme) this.scheme = init.scheme; - if (init.httpHeaders) this.httpHeaders = init.httpHeaders; + if (!init) { return; } + if (init.path) { this.path = init.path; } + if (init.port) { this.port = init.port; } + if (init.host) { this.host = init.host; } + if (init.scheme) { this.scheme = init.scheme; } + if (init.httpHeaders) { this.httpHeaders = init.httpHeaders; } } static emptyObject(): HTTPGetAction { - let result = new HTTPGetAction(); + const result = new HTTPGetAction(); result.port = IntOrString.emptyObject(); result.httpHeaders = []; return result; @@ -724,13 +724,13 @@ export class ExecAction { command: string[]; constructor(init?: ExecAction) { - if (!init) return; - if (init.command) this.command = init.command; + if (!init) { return; } + if (init.command) { this.command = init.command; } } static emptyObject(): ExecAction { - let result = new ExecAction(); + const result = new ExecAction(); result.command = []; return result; } @@ -748,20 +748,20 @@ export class Probe { failureThreshold: number; constructor(init?: Probe) { - if (!init) return; - if (init.exec) this.exec = init.exec; - if (init.httpGet) this.httpGet = init.httpGet; - if (init.tcpSocket) this.tcpSocket = init.tcpSocket; - if (init.initialDelaySeconds) this.initialDelaySeconds = init.initialDelaySeconds; - if (init.timeoutSeconds) this.timeoutSeconds = init.timeoutSeconds; - if (init.periodSeconds) this.periodSeconds = init.periodSeconds; - if (init.successThreshold) this.successThreshold = init.successThreshold; - if (init.failureThreshold) this.failureThreshold = init.failureThreshold; + if (!init) { return; } + if (init.exec) { this.exec = init.exec; } + if (init.httpGet) { this.httpGet = init.httpGet; } + if (init.tcpSocket) { this.tcpSocket = init.tcpSocket; } + if (init.initialDelaySeconds) { this.initialDelaySeconds = init.initialDelaySeconds; } + if (init.timeoutSeconds) { this.timeoutSeconds = init.timeoutSeconds; } + if (init.periodSeconds) { this.periodSeconds = init.periodSeconds; } + if (init.successThreshold) { this.successThreshold = init.successThreshold; } + if (init.failureThreshold) { this.failureThreshold = init.failureThreshold; } } static emptyObject(): Probe { - let result = new Probe(); + const result = new Probe(); result.exec = ExecAction.emptyObject(); result.httpGet = HTTPGetAction.emptyObject(); result.tcpSocket = TCPSocketAction.emptyObject(); @@ -775,14 +775,14 @@ export class VolumeDevice { devicePath: string; constructor(init?: VolumeDevice) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.devicePath) this.devicePath = init.devicePath; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.devicePath) { this.devicePath = init.devicePath; } } static emptyObject(): VolumeDevice { - let result = new VolumeDevice(); + const result = new VolumeDevice(); return result; } @@ -796,17 +796,17 @@ export class VolumeMount { mountPropagation?: string; constructor(init?: VolumeMount) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.mountPath) this.mountPath = init.mountPath; - if (init.subPath) this.subPath = init.subPath; - if (init.mountPropagation) this.mountPropagation = init.mountPropagation; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.mountPath) { this.mountPath = init.mountPath; } + if (init.subPath) { this.subPath = init.subPath; } + if (init.mountPropagation) { this.mountPropagation = init.mountPropagation; } } static emptyObject(): VolumeMount { - let result = new VolumeMount(); + const result = new VolumeMount(); return result; } @@ -817,14 +817,14 @@ export class ResourceRequirements { requests?: { [key: string]: any }; constructor(init?: ResourceRequirements) { - if (!init) return; - if (init.limits) this.limits = init.limits; - if (init.requests) this.requests = init.requests; + if (!init) { return; } + if (init.limits) { this.limits = init.limits; } + if (init.requests) { this.requests = init.requests; } } static emptyObject(): ResourceRequirements { - let result = new ResourceRequirements(); + const result = new ResourceRequirements(); result.limits = null; result.requests = null; return result; @@ -838,15 +838,15 @@ export class SecretKeySelector { optional?: boolean; constructor(init?: SecretKeySelector) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.key) this.key = init.key; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.key) { this.key = init.key; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): SecretKeySelector { - let result = new SecretKeySelector(); + const result = new SecretKeySelector(); return result; } @@ -858,15 +858,15 @@ export class ConfigMapKeySelector { optional?: boolean; constructor(init?: ConfigMapKeySelector) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.key) this.key = init.key; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.key) { this.key = init.key; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): ConfigMapKeySelector { - let result = new ConfigMapKeySelector(); + const result = new ConfigMapKeySelector(); return result; } @@ -880,16 +880,16 @@ export class EnvVarSource { secretKeyRef?: SecretKeySelector; constructor(init?: EnvVarSource) { - if (!init) return; - if (init.fieldRef) this.fieldRef = init.fieldRef; - if (init.resourceFieldRef) this.resourceFieldRef = init.resourceFieldRef; - if (init.configMapKeyRef) this.configMapKeyRef = init.configMapKeyRef; - if (init.secretKeyRef) this.secretKeyRef = init.secretKeyRef; + if (!init) { return; } + if (init.fieldRef) { this.fieldRef = init.fieldRef; } + if (init.resourceFieldRef) { this.resourceFieldRef = init.resourceFieldRef; } + if (init.configMapKeyRef) { this.configMapKeyRef = init.configMapKeyRef; } + if (init.secretKeyRef) { this.secretKeyRef = init.secretKeyRef; } } static emptyObject(): EnvVarSource { - let result = new EnvVarSource(); + const result = new EnvVarSource(); result.fieldRef = ObjectFieldSelector.emptyObject(); result.resourceFieldRef = ResourceFieldSelector.emptyObject(); result.configMapKeyRef = ConfigMapKeySelector.emptyObject(); @@ -905,15 +905,15 @@ export class EnvVar { valueFrom?: EnvVarSource; constructor(init?: EnvVar) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.value) this.value = init.value; - if (init.valueFrom) this.valueFrom = init.valueFrom; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.value) { this.value = init.value; } + if (init.valueFrom) { this.valueFrom = init.valueFrom; } } static emptyObject(): EnvVar { - let result = new EnvVar(); + const result = new EnvVar(); result.valueFrom = EnvVarSource.emptyObject(); return result; } @@ -925,14 +925,14 @@ export class SecretEnvSource { optional?: boolean; constructor(init?: SecretEnvSource) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): SecretEnvSource { - let result = new SecretEnvSource(); + const result = new SecretEnvSource(); return result; } @@ -943,14 +943,14 @@ export class ConfigMapEnvSource { optional?: boolean; constructor(init?: ConfigMapEnvSource) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): ConfigMapEnvSource { - let result = new ConfigMapEnvSource(); + const result = new ConfigMapEnvSource(); return result; } @@ -962,15 +962,15 @@ export class EnvFromSource { secretRef?: SecretEnvSource; constructor(init?: EnvFromSource) { - if (!init) return; - if (init.prefix) this.prefix = init.prefix; - if (init.configMapRef) this.configMapRef = init.configMapRef; - if (init.secretRef) this.secretRef = init.secretRef; + if (!init) { return; } + if (init.prefix) { this.prefix = init.prefix; } + if (init.configMapRef) { this.configMapRef = init.configMapRef; } + if (init.secretRef) { this.secretRef = init.secretRef; } } static emptyObject(): EnvFromSource { - let result = new EnvFromSource(); + const result = new EnvFromSource(); result.configMapRef = ConfigMapEnvSource.emptyObject(); result.secretRef = SecretEnvSource.emptyObject(); return result; @@ -986,17 +986,17 @@ export class ContainerPort { hostIP: string; constructor(init?: ContainerPort) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.hostPort) this.hostPort = init.hostPort; - if (init.containerPort) this.containerPort = init.containerPort; - if (init.protocol) this.protocol = init.protocol; - if (init.hostIP) this.hostIP = init.hostIP; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.hostPort) { this.hostPort = init.hostPort; } + if (init.containerPort) { this.containerPort = init.containerPort; } + if (init.protocol) { this.protocol = init.protocol; } + if (init.hostIP) { this.hostIP = init.hostIP; } } static emptyObject(): ContainerPort { - let result = new ContainerPort(); + const result = new ContainerPort(); return result; } @@ -1026,33 +1026,33 @@ export class Container { tty: boolean; constructor(init?: Container) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.image) this.image = init.image; - if (init.command) this.command = init.command; - if (init.args) this.args = init.args; - if (init.workingDir) this.workingDir = init.workingDir; - if (init.ports) this.ports = init.ports; - if (init.envFrom) this.envFrom = init.envFrom; - if (init.env) this.env = init.env; - if (init.resources) this.resources = init.resources; - if (init.volumeMounts) this.volumeMounts = init.volumeMounts; - if (init.volumeDevices) this.volumeDevices = init.volumeDevices; - if (init.livenessProbe) this.livenessProbe = init.livenessProbe; - if (init.readinessProbe) this.readinessProbe = init.readinessProbe; - if (init.lifecycle) this.lifecycle = init.lifecycle; - if (init.terminationMessagePath) this.terminationMessagePath = init.terminationMessagePath; - if (init.terminationMessagePolicy) this.terminationMessagePolicy = init.terminationMessagePolicy; - if (init.imagePullPolicy) this.imagePullPolicy = init.imagePullPolicy; - if (init.securityContext) this.securityContext = init.securityContext; - if (init.stdin) this.stdin = init.stdin; - if (init.stdinOnce) this.stdinOnce = init.stdinOnce; - if (init.tty) this.tty = init.tty; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.image) { this.image = init.image; } + if (init.command) { this.command = init.command; } + if (init.args) { this.args = init.args; } + if (init.workingDir) { this.workingDir = init.workingDir; } + if (init.ports) { this.ports = init.ports; } + if (init.envFrom) { this.envFrom = init.envFrom; } + if (init.env) { this.env = init.env; } + if (init.resources) { this.resources = init.resources; } + if (init.volumeMounts) { this.volumeMounts = init.volumeMounts; } + if (init.volumeDevices) { this.volumeDevices = init.volumeDevices; } + if (init.livenessProbe) { this.livenessProbe = init.livenessProbe; } + if (init.readinessProbe) { this.readinessProbe = init.readinessProbe; } + if (init.lifecycle) { this.lifecycle = init.lifecycle; } + if (init.terminationMessagePath) { this.terminationMessagePath = init.terminationMessagePath; } + if (init.terminationMessagePolicy) { this.terminationMessagePolicy = init.terminationMessagePolicy; } + if (init.imagePullPolicy) { this.imagePullPolicy = init.imagePullPolicy; } + if (init.securityContext) { this.securityContext = init.securityContext; } + if (init.stdin) { this.stdin = init.stdin; } + if (init.stdinOnce) { this.stdinOnce = init.stdinOnce; } + if (init.tty) { this.tty = init.tty; } } static emptyObject(): Container { - let result = new Container(); + const result = new Container(); result.command = []; result.args = []; result.ports = []; @@ -1078,17 +1078,17 @@ export class StorageOSVolumeSource { secretRef?: LocalObjectReference; constructor(init?: StorageOSVolumeSource) { - if (!init) return; - if (init.volumeName) this.volumeName = init.volumeName; - if (init.volumeNamespace) this.volumeNamespace = init.volumeNamespace; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.secretRef) this.secretRef = init.secretRef; + if (!init) { return; } + if (init.volumeName) { this.volumeName = init.volumeName; } + if (init.volumeNamespace) { this.volumeNamespace = init.volumeNamespace; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.secretRef) { this.secretRef = init.secretRef; } } static emptyObject(): StorageOSVolumeSource { - let result = new StorageOSVolumeSource(); + const result = new StorageOSVolumeSource(); result.secretRef = LocalObjectReference.emptyObject(); return result; } @@ -1108,22 +1108,22 @@ export class ScaleIOVolumeSource { readOnly: boolean; constructor(init?: ScaleIOVolumeSource) { - if (!init) return; - if (init.gateway) this.gateway = init.gateway; - if (init.system) this.system = init.system; - if (init.secretRef) this.secretRef = init.secretRef; - if (init.sslEnabled) this.sslEnabled = init.sslEnabled; - if (init.protectionDomain) this.protectionDomain = init.protectionDomain; - if (init.storagePool) this.storagePool = init.storagePool; - if (init.storageMode) this.storageMode = init.storageMode; - if (init.volumeName) this.volumeName = init.volumeName; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.gateway) { this.gateway = init.gateway; } + if (init.system) { this.system = init.system; } + if (init.secretRef) { this.secretRef = init.secretRef; } + if (init.sslEnabled) { this.sslEnabled = init.sslEnabled; } + if (init.protectionDomain) { this.protectionDomain = init.protectionDomain; } + if (init.storagePool) { this.storagePool = init.storagePool; } + if (init.storageMode) { this.storageMode = init.storageMode; } + if (init.volumeName) { this.volumeName = init.volumeName; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): ScaleIOVolumeSource { - let result = new ScaleIOVolumeSource(); + const result = new ScaleIOVolumeSource(); result.secretRef = LocalObjectReference.emptyObject(); return result; } @@ -1136,15 +1136,15 @@ export class PortworxVolumeSource { readOnly: boolean; constructor(init?: PortworxVolumeSource) { - if (!init) return; - if (init.volumeID) this.volumeID = init.volumeID; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.volumeID) { this.volumeID = init.volumeID; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): PortworxVolumeSource { - let result = new PortworxVolumeSource(); + const result = new PortworxVolumeSource(); return result; } @@ -1156,15 +1156,15 @@ export class ConfigMapProjection { optional?: boolean; constructor(init?: ConfigMapProjection) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.items) this.items = init.items; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.items) { this.items = init.items; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): ConfigMapProjection { - let result = new ConfigMapProjection(); + const result = new ConfigMapProjection(); result.items = []; return result; } @@ -1175,13 +1175,13 @@ export class DownwardAPIProjection { items: DownwardAPIVolumeFile[]; constructor(init?: DownwardAPIProjection) { - if (!init) return; - if (init.items) this.items = init.items; + if (!init) { return; } + if (init.items) { this.items = init.items; } } static emptyObject(): DownwardAPIProjection { - let result = new DownwardAPIProjection(); + const result = new DownwardAPIProjection(); result.items = []; return result; } @@ -1194,15 +1194,15 @@ export class SecretProjection { optional?: boolean; constructor(init?: SecretProjection) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.items) this.items = init.items; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.items) { this.items = init.items; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): SecretProjection { - let result = new SecretProjection(); + const result = new SecretProjection(); result.items = []; return result; } @@ -1215,15 +1215,15 @@ export class VolumeProjection { configMap?: ConfigMapProjection; constructor(init?: VolumeProjection) { - if (!init) return; - if (init.secret) this.secret = init.secret; - if (init.downwardAPI) this.downwardAPI = init.downwardAPI; - if (init.configMap) this.configMap = init.configMap; + if (!init) { return; } + if (init.secret) { this.secret = init.secret; } + if (init.downwardAPI) { this.downwardAPI = init.downwardAPI; } + if (init.configMap) { this.configMap = init.configMap; } } static emptyObject(): VolumeProjection { - let result = new VolumeProjection(); + const result = new VolumeProjection(); result.secret = SecretProjection.emptyObject(); result.downwardAPI = DownwardAPIProjection.emptyObject(); result.configMap = ConfigMapProjection.emptyObject(); @@ -1237,14 +1237,14 @@ export class ProjectedVolumeSource { defaultMode?: number; constructor(init?: ProjectedVolumeSource) { - if (!init) return; - if (init.sources) this.sources = init.sources; - if (init.defaultMode) this.defaultMode = init.defaultMode; + if (!init) { return; } + if (init.sources) { this.sources = init.sources; } + if (init.defaultMode) { this.defaultMode = init.defaultMode; } } static emptyObject(): ProjectedVolumeSource { - let result = new ProjectedVolumeSource(); + const result = new ProjectedVolumeSource(); result.sources = []; return result; } @@ -1256,14 +1256,14 @@ export class PhotonPersistentDiskVolumeSource { fsType: string; constructor(init?: PhotonPersistentDiskVolumeSource) { - if (!init) return; - if (init.pdID) this.pdID = init.pdID; - if (init.fsType) this.fsType = init.fsType; + if (!init) { return; } + if (init.pdID) { this.pdID = init.pdID; } + if (init.fsType) { this.fsType = init.fsType; } } static emptyObject(): PhotonPersistentDiskVolumeSource { - let result = new PhotonPersistentDiskVolumeSource(); + const result = new PhotonPersistentDiskVolumeSource(); return result; } @@ -1278,18 +1278,18 @@ export class AzureDiskVolumeSource { kind?: string; constructor(init?: AzureDiskVolumeSource) { - if (!init) return; - if (init.diskName) this.diskName = init.diskName; - if (init.diskURI) this.diskURI = init.diskURI; - if (init.cachingMode) this.cachingMode = init.cachingMode; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.kind) this.kind = init.kind; + if (!init) { return; } + if (init.diskName) { this.diskName = init.diskName; } + if (init.diskURI) { this.diskURI = init.diskURI; } + if (init.cachingMode) { this.cachingMode = init.cachingMode; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.kind) { this.kind = init.kind; } } static emptyObject(): AzureDiskVolumeSource { - let result = new AzureDiskVolumeSource(); + const result = new AzureDiskVolumeSource(); return result; } @@ -1303,17 +1303,17 @@ export class QuobyteVolumeSource { group: string; constructor(init?: QuobyteVolumeSource) { - if (!init) return; - if (init.registry) this.registry = init.registry; - if (init.volume) this.volume = init.volume; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.user) this.user = init.user; - if (init.group) this.group = init.group; + if (!init) { return; } + if (init.registry) { this.registry = init.registry; } + if (init.volume) { this.volume = init.volume; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.user) { this.user = init.user; } + if (init.group) { this.group = init.group; } } static emptyObject(): QuobyteVolumeSource { - let result = new QuobyteVolumeSource(); + const result = new QuobyteVolumeSource(); return result; } @@ -1326,16 +1326,16 @@ export class VsphereVirtualDiskVolumeSource { storagePolicyID: string; constructor(init?: VsphereVirtualDiskVolumeSource) { - if (!init) return; - if (init.volumePath) this.volumePath = init.volumePath; - if (init.fsType) this.fsType = init.fsType; - if (init.storagePolicyName) this.storagePolicyName = init.storagePolicyName; - if (init.storagePolicyID) this.storagePolicyID = init.storagePolicyID; + if (!init) { return; } + if (init.volumePath) { this.volumePath = init.volumePath; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.storagePolicyName) { this.storagePolicyName = init.storagePolicyName; } + if (init.storagePolicyID) { this.storagePolicyID = init.storagePolicyID; } } static emptyObject(): VsphereVirtualDiskVolumeSource { - let result = new VsphereVirtualDiskVolumeSource(); + const result = new VsphereVirtualDiskVolumeSource(); return result; } @@ -1348,16 +1348,16 @@ export class ConfigMapVolumeSource { optional?: boolean; constructor(init?: ConfigMapVolumeSource) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.items) this.items = init.items; - if (init.defaultMode) this.defaultMode = init.defaultMode; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.items) { this.items = init.items; } + if (init.defaultMode) { this.defaultMode = init.defaultMode; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): ConfigMapVolumeSource { - let result = new ConfigMapVolumeSource(); + const result = new ConfigMapVolumeSource(); result.items = []; return result; } @@ -1370,15 +1370,15 @@ export class AzureFileVolumeSource { readOnly: boolean; constructor(init?: AzureFileVolumeSource) { - if (!init) return; - if (init.secretName) this.secretName = init.secretName; - if (init.shareName) this.shareName = init.shareName; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.secretName) { this.secretName = init.secretName; } + if (init.shareName) { this.shareName = init.shareName; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): AzureFileVolumeSource { - let result = new AzureFileVolumeSource(); + const result = new AzureFileVolumeSource(); return result; } @@ -1392,17 +1392,17 @@ export class FCVolumeSource { wwids: string[]; constructor(init?: FCVolumeSource) { - if (!init) return; - if (init.targetWWNs) this.targetWWNs = init.targetWWNs; - if (init.lun) this.lun = init.lun; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.wwids) this.wwids = init.wwids; + if (!init) { return; } + if (init.targetWWNs) { this.targetWWNs = init.targetWWNs; } + if (init.lun) { this.lun = init.lun; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.wwids) { this.wwids = init.wwids; } } static emptyObject(): FCVolumeSource { - let result = new FCVolumeSource(); + const result = new FCVolumeSource(); result.targetWWNs = []; result.wwids = []; return result; @@ -1416,15 +1416,15 @@ export class ResourceFieldSelector { divisor: string; constructor(init?: ResourceFieldSelector) { - if (!init) return; - if (init.containerName) this.containerName = init.containerName; - if (init.resource) this.resource = init.resource; - if (init.divisor) this.divisor = init.divisor; + if (!init) { return; } + if (init.containerName) { this.containerName = init.containerName; } + if (init.resource) { this.resource = init.resource; } + if (init.divisor) { this.divisor = init.divisor; } } static emptyObject(): ResourceFieldSelector { - let result = new ResourceFieldSelector(); + const result = new ResourceFieldSelector(); result.divisor = null; return result; } @@ -1436,14 +1436,14 @@ export class ObjectFieldSelector { fieldPath: string; constructor(init?: ObjectFieldSelector) { - if (!init) return; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.fieldPath) this.fieldPath = init.fieldPath; + if (!init) { return; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.fieldPath) { this.fieldPath = init.fieldPath; } } static emptyObject(): ObjectFieldSelector { - let result = new ObjectFieldSelector(); + const result = new ObjectFieldSelector(); return result; } @@ -1456,16 +1456,16 @@ export class DownwardAPIVolumeFile { mode?: number; constructor(init?: DownwardAPIVolumeFile) { - if (!init) return; - if (init.path) this.path = init.path; - if (init.fieldRef) this.fieldRef = init.fieldRef; - if (init.resourceFieldRef) this.resourceFieldRef = init.resourceFieldRef; - if (init.mode) this.mode = init.mode; + if (!init) { return; } + if (init.path) { this.path = init.path; } + if (init.fieldRef) { this.fieldRef = init.fieldRef; } + if (init.resourceFieldRef) { this.resourceFieldRef = init.resourceFieldRef; } + if (init.mode) { this.mode = init.mode; } } static emptyObject(): DownwardAPIVolumeFile { - let result = new DownwardAPIVolumeFile(); + const result = new DownwardAPIVolumeFile(); result.fieldRef = ObjectFieldSelector.emptyObject(); result.resourceFieldRef = ResourceFieldSelector.emptyObject(); return result; @@ -1478,14 +1478,14 @@ export class DownwardAPIVolumeSource { defaultMode?: number; constructor(init?: DownwardAPIVolumeSource) { - if (!init) return; - if (init.items) this.items = init.items; - if (init.defaultMode) this.defaultMode = init.defaultMode; + if (!init) { return; } + if (init.items) { this.items = init.items; } + if (init.defaultMode) { this.defaultMode = init.defaultMode; } } static emptyObject(): DownwardAPIVolumeSource { - let result = new DownwardAPIVolumeSource(); + const result = new DownwardAPIVolumeSource(); result.items = []; return result; } @@ -1497,14 +1497,14 @@ export class FlockerVolumeSource { datasetUUID: string; constructor(init?: FlockerVolumeSource) { - if (!init) return; - if (init.datasetName) this.datasetName = init.datasetName; - if (init.datasetUUID) this.datasetUUID = init.datasetUUID; + if (!init) { return; } + if (init.datasetName) { this.datasetName = init.datasetName; } + if (init.datasetUUID) { this.datasetUUID = init.datasetUUID; } } static emptyObject(): FlockerVolumeSource { - let result = new FlockerVolumeSource(); + const result = new FlockerVolumeSource(); return result; } @@ -1519,18 +1519,18 @@ export class CephFSVolumeSource { readOnly: boolean; constructor(init?: CephFSVolumeSource) { - if (!init) return; - if (init.monitors) this.monitors = init.monitors; - if (init.path) this.path = init.path; - if (init.user) this.user = init.user; - if (init.secretFile) this.secretFile = init.secretFile; - if (init.secretRef) this.secretRef = init.secretRef; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.monitors) { this.monitors = init.monitors; } + if (init.path) { this.path = init.path; } + if (init.user) { this.user = init.user; } + if (init.secretFile) { this.secretFile = init.secretFile; } + if (init.secretRef) { this.secretRef = init.secretRef; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): CephFSVolumeSource { - let result = new CephFSVolumeSource(); + const result = new CephFSVolumeSource(); result.monitors = []; result.secretRef = LocalObjectReference.emptyObject(); return result; @@ -1544,15 +1544,15 @@ export class CinderVolumeSource { readOnly: boolean; constructor(init?: CinderVolumeSource) { - if (!init) return; - if (init.volumeID) this.volumeID = init.volumeID; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.volumeID) { this.volumeID = init.volumeID; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): CinderVolumeSource { - let result = new CinderVolumeSource(); + const result = new CinderVolumeSource(); return result; } @@ -1566,17 +1566,17 @@ export class FlexVolumeSource { options?: { [key: string]: string }; constructor(init?: FlexVolumeSource) { - if (!init) return; - if (init.driver) this.driver = init.driver; - if (init.fsType) this.fsType = init.fsType; - if (init.secretRef) this.secretRef = init.secretRef; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.options) this.options = init.options; + if (!init) { return; } + if (init.driver) { this.driver = init.driver; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.secretRef) { this.secretRef = init.secretRef; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.options) { this.options = init.options; } } static emptyObject(): FlexVolumeSource { - let result = new FlexVolumeSource(); + const result = new FlexVolumeSource(); result.secretRef = LocalObjectReference.emptyObject(); result.options = null; return result; @@ -1595,20 +1595,20 @@ export class RBDVolumeSource { readOnly: boolean; constructor(init?: RBDVolumeSource) { - if (!init) return; - if (init.monitors) this.monitors = init.monitors; - if (init.image) this.image = init.image; - if (init.fsType) this.fsType = init.fsType; - if (init.pool) this.pool = init.pool; - if (init.user) this.user = init.user; - if (init.keyring) this.keyring = init.keyring; - if (init.secretRef) this.secretRef = init.secretRef; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.monitors) { this.monitors = init.monitors; } + if (init.image) { this.image = init.image; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.pool) { this.pool = init.pool; } + if (init.user) { this.user = init.user; } + if (init.keyring) { this.keyring = init.keyring; } + if (init.secretRef) { this.secretRef = init.secretRef; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): RBDVolumeSource { - let result = new RBDVolumeSource(); + const result = new RBDVolumeSource(); result.monitors = []; result.secretRef = LocalObjectReference.emptyObject(); return result; @@ -1621,14 +1621,14 @@ export class PersistentVolumeClaimVolumeSource { readOnly: boolean; constructor(init?: PersistentVolumeClaimVolumeSource) { - if (!init) return; - if (init.claimName) this.claimName = init.claimName; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.claimName) { this.claimName = init.claimName; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): PersistentVolumeClaimVolumeSource { - let result = new PersistentVolumeClaimVolumeSource(); + const result = new PersistentVolumeClaimVolumeSource(); return result; } @@ -1640,15 +1640,15 @@ export class GlusterfsVolumeSource { readOnly: boolean; constructor(init?: GlusterfsVolumeSource) { - if (!init) return; - if (init.endpoints) this.endpoints = init.endpoints; - if (init.path) this.path = init.path; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.endpoints) { this.endpoints = init.endpoints; } + if (init.path) { this.path = init.path; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): GlusterfsVolumeSource { - let result = new GlusterfsVolumeSource(); + const result = new GlusterfsVolumeSource(); return result; } @@ -1658,13 +1658,13 @@ export class LocalObjectReference { name: string; constructor(init?: LocalObjectReference) { - if (!init) return; - if (init.name) this.name = init.name; + if (!init) { return; } + if (init.name) { this.name = init.name; } } static emptyObject(): LocalObjectReference { - let result = new LocalObjectReference(); + const result = new LocalObjectReference(); return result; } @@ -1684,23 +1684,23 @@ export class ISCSIVolumeSource { initiatorName?: string; constructor(init?: ISCSIVolumeSource) { - if (!init) return; - if (init.targetPortal) this.targetPortal = init.targetPortal; - if (init.iqn) this.iqn = init.iqn; - if (init.lun) this.lun = init.lun; - if (init.iscsiInterface) this.iscsiInterface = init.iscsiInterface; - if (init.fsType) this.fsType = init.fsType; - if (init.readOnly) this.readOnly = init.readOnly; - if (init.portals) this.portals = init.portals; - if (init.chapAuthDiscovery) this.chapAuthDiscovery = init.chapAuthDiscovery; - if (init.chapAuthSession) this.chapAuthSession = init.chapAuthSession; - if (init.secretRef) this.secretRef = init.secretRef; - if (init.initiatorName) this.initiatorName = init.initiatorName; + if (!init) { return; } + if (init.targetPortal) { this.targetPortal = init.targetPortal; } + if (init.iqn) { this.iqn = init.iqn; } + if (init.lun) { this.lun = init.lun; } + if (init.iscsiInterface) { this.iscsiInterface = init.iscsiInterface; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.readOnly) { this.readOnly = init.readOnly; } + if (init.portals) { this.portals = init.portals; } + if (init.chapAuthDiscovery) { this.chapAuthDiscovery = init.chapAuthDiscovery; } + if (init.chapAuthSession) { this.chapAuthSession = init.chapAuthSession; } + if (init.secretRef) { this.secretRef = init.secretRef; } + if (init.initiatorName) { this.initiatorName = init.initiatorName; } } static emptyObject(): ISCSIVolumeSource { - let result = new ISCSIVolumeSource(); + const result = new ISCSIVolumeSource(); result.portals = []; result.secretRef = LocalObjectReference.emptyObject(); return result; @@ -1714,15 +1714,15 @@ export class NFSVolumeSource { readOnly: boolean; constructor(init?: NFSVolumeSource) { - if (!init) return; - if (init.server) this.server = init.server; - if (init.path) this.path = init.path; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.server) { this.server = init.server; } + if (init.path) { this.path = init.path; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): NFSVolumeSource { - let result = new NFSVolumeSource(); + const result = new NFSVolumeSource(); return result; } @@ -1734,15 +1734,15 @@ export class KeyToPath { mode?: number; constructor(init?: KeyToPath) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.path) this.path = init.path; - if (init.mode) this.mode = init.mode; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.path) { this.path = init.path; } + if (init.mode) { this.mode = init.mode; } } static emptyObject(): KeyToPath { - let result = new KeyToPath(); + const result = new KeyToPath(); return result; } @@ -1755,16 +1755,16 @@ export class SecretVolumeSource { optional?: boolean; constructor(init?: SecretVolumeSource) { - if (!init) return; - if (init.secretName) this.secretName = init.secretName; - if (init.items) this.items = init.items; - if (init.defaultMode) this.defaultMode = init.defaultMode; - if (init.optional) this.optional = init.optional; + if (!init) { return; } + if (init.secretName) { this.secretName = init.secretName; } + if (init.items) { this.items = init.items; } + if (init.defaultMode) { this.defaultMode = init.defaultMode; } + if (init.optional) { this.optional = init.optional; } } static emptyObject(): SecretVolumeSource { - let result = new SecretVolumeSource(); + const result = new SecretVolumeSource(); result.items = []; return result; } @@ -1777,15 +1777,15 @@ export class GitRepoVolumeSource { directory: string; constructor(init?: GitRepoVolumeSource) { - if (!init) return; - if (init.repository) this.repository = init.repository; - if (init.revision) this.revision = init.revision; - if (init.directory) this.directory = init.directory; + if (!init) { return; } + if (init.repository) { this.repository = init.repository; } + if (init.revision) { this.revision = init.revision; } + if (init.directory) { this.directory = init.directory; } } static emptyObject(): GitRepoVolumeSource { - let result = new GitRepoVolumeSource(); + const result = new GitRepoVolumeSource(); return result; } @@ -1798,16 +1798,16 @@ export class AWSElasticBlockStoreVolumeSource { readOnly: boolean; constructor(init?: AWSElasticBlockStoreVolumeSource) { - if (!init) return; - if (init.volumeID) this.volumeID = init.volumeID; - if (init.fsType) this.fsType = init.fsType; - if (init.partition) this.partition = init.partition; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.volumeID) { this.volumeID = init.volumeID; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.partition) { this.partition = init.partition; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): AWSElasticBlockStoreVolumeSource { - let result = new AWSElasticBlockStoreVolumeSource(); + const result = new AWSElasticBlockStoreVolumeSource(); return result; } @@ -1820,16 +1820,16 @@ export class GCEPersistentDiskVolumeSource { readOnly: boolean; constructor(init?: GCEPersistentDiskVolumeSource) { - if (!init) return; - if (init.pdName) this.pdName = init.pdName; - if (init.fsType) this.fsType = init.fsType; - if (init.partition) this.partition = init.partition; - if (init.readOnly) this.readOnly = init.readOnly; + if (!init) { return; } + if (init.pdName) { this.pdName = init.pdName; } + if (init.fsType) { this.fsType = init.fsType; } + if (init.partition) { this.partition = init.partition; } + if (init.readOnly) { this.readOnly = init.readOnly; } } static emptyObject(): GCEPersistentDiskVolumeSource { - let result = new GCEPersistentDiskVolumeSource(); + const result = new GCEPersistentDiskVolumeSource(); return result; } @@ -1840,14 +1840,14 @@ export class EmptyDirVolumeSource { sizeLimit: string; constructor(init?: EmptyDirVolumeSource) { - if (!init) return; - if (init.medium) this.medium = init.medium; - if (init.sizeLimit) this.sizeLimit = init.sizeLimit; + if (!init) { return; } + if (init.medium) { this.medium = init.medium; } + if (init.sizeLimit) { this.sizeLimit = init.sizeLimit; } } static emptyObject(): EmptyDirVolumeSource { - let result = new EmptyDirVolumeSource(); + const result = new EmptyDirVolumeSource(); result.sizeLimit = null; return result; } @@ -1859,14 +1859,14 @@ export class HostPathVolumeSource { type?: string; constructor(init?: HostPathVolumeSource) { - if (!init) return; - if (init.path) this.path = init.path; - if (init.type) this.type = init.type; + if (!init) { return; } + if (init.path) { this.path = init.path; } + if (init.type) { this.type = init.type; } } static emptyObject(): HostPathVolumeSource { - let result = new HostPathVolumeSource(); + const result = new HostPathVolumeSource(); return result; } @@ -1903,40 +1903,40 @@ export class Volume { storageos?: StorageOSVolumeSource; constructor(init?: Volume) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.hostPath) this.hostPath = init.hostPath; - if (init.emptyDir) this.emptyDir = init.emptyDir; - if (init.gcePersistentDisk) this.gcePersistentDisk = init.gcePersistentDisk; - if (init.awsElasticBlockStore) this.awsElasticBlockStore = init.awsElasticBlockStore; - if (init.gitRepo) this.gitRepo = init.gitRepo; - if (init.secret) this.secret = init.secret; - if (init.nfs) this.nfs = init.nfs; - if (init.iscsi) this.iscsi = init.iscsi; - if (init.glusterfs) this.glusterfs = init.glusterfs; - if (init.persistentVolumeClaim) this.persistentVolumeClaim = init.persistentVolumeClaim; - if (init.rbd) this.rbd = init.rbd; - if (init.flexVolume) this.flexVolume = init.flexVolume; - if (init.cinder) this.cinder = init.cinder; - if (init.cephfs) this.cephfs = init.cephfs; - if (init.flocker) this.flocker = init.flocker; - if (init.downwardAPI) this.downwardAPI = init.downwardAPI; - if (init.fc) this.fc = init.fc; - if (init.azureFile) this.azureFile = init.azureFile; - if (init.configMap) this.configMap = init.configMap; - if (init.vsphereVolume) this.vsphereVolume = init.vsphereVolume; - if (init.quobyte) this.quobyte = init.quobyte; - if (init.azureDisk) this.azureDisk = init.azureDisk; - if (init.photonPersistentDisk) this.photonPersistentDisk = init.photonPersistentDisk; - if (init.projected) this.projected = init.projected; - if (init.portworxVolume) this.portworxVolume = init.portworxVolume; - if (init.scaleIO) this.scaleIO = init.scaleIO; - if (init.storageos) this.storageos = init.storageos; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.hostPath) { this.hostPath = init.hostPath; } + if (init.emptyDir) { this.emptyDir = init.emptyDir; } + if (init.gcePersistentDisk) { this.gcePersistentDisk = init.gcePersistentDisk; } + if (init.awsElasticBlockStore) { this.awsElasticBlockStore = init.awsElasticBlockStore; } + if (init.gitRepo) { this.gitRepo = init.gitRepo; } + if (init.secret) { this.secret = init.secret; } + if (init.nfs) { this.nfs = init.nfs; } + if (init.iscsi) { this.iscsi = init.iscsi; } + if (init.glusterfs) { this.glusterfs = init.glusterfs; } + if (init.persistentVolumeClaim) { this.persistentVolumeClaim = init.persistentVolumeClaim; } + if (init.rbd) { this.rbd = init.rbd; } + if (init.flexVolume) { this.flexVolume = init.flexVolume; } + if (init.cinder) { this.cinder = init.cinder; } + if (init.cephfs) { this.cephfs = init.cephfs; } + if (init.flocker) { this.flocker = init.flocker; } + if (init.downwardAPI) { this.downwardAPI = init.downwardAPI; } + if (init.fc) { this.fc = init.fc; } + if (init.azureFile) { this.azureFile = init.azureFile; } + if (init.configMap) { this.configMap = init.configMap; } + if (init.vsphereVolume) { this.vsphereVolume = init.vsphereVolume; } + if (init.quobyte) { this.quobyte = init.quobyte; } + if (init.azureDisk) { this.azureDisk = init.azureDisk; } + if (init.photonPersistentDisk) { this.photonPersistentDisk = init.photonPersistentDisk; } + if (init.projected) { this.projected = init.projected; } + if (init.portworxVolume) { this.portworxVolume = init.portworxVolume; } + if (init.scaleIO) { this.scaleIO = init.scaleIO; } + if (init.storageos) { this.storageos = init.storageos; } } static emptyObject(): Volume { - let result = new Volume(); + const result = new Volume(); result.hostPath = HostPathVolumeSource.emptyObject(); result.emptyDir = EmptyDirVolumeSource.emptyObject(); result.gcePersistentDisk = GCEPersistentDiskVolumeSource.emptyObject(); @@ -1999,39 +1999,39 @@ export class PodSpec { dnsConfig?: PodDNSConfig; constructor(init?: PodSpec) { - if (!init) return; - if (init.volumes) this.volumes = init.volumes; - if (init.initContainers) this.initContainers = init.initContainers; - if (init.containers) this.containers = init.containers; - if (init.restartPolicy) this.restartPolicy = init.restartPolicy; - if (init.terminationGracePeriodSeconds) this.terminationGracePeriodSeconds = init.terminationGracePeriodSeconds; - if (init.activeDeadlineSeconds) this.activeDeadlineSeconds = init.activeDeadlineSeconds; - if (init.dnsPolicy) this.dnsPolicy = init.dnsPolicy; - if (init.nodeSelector) this.nodeSelector = init.nodeSelector; - if (init.serviceAccountName) this.serviceAccountName = init.serviceAccountName; - if (init.serviceAccount) this.serviceAccount = init.serviceAccount; - if (init.automountServiceAccountToken) this.automountServiceAccountToken = init.automountServiceAccountToken; - if (init.nodeName) this.nodeName = init.nodeName; - if (init.hostNetwork) this.hostNetwork = init.hostNetwork; - if (init.hostPID) this.hostPID = init.hostPID; - if (init.hostIPC) this.hostIPC = init.hostIPC; - if (init.shareProcessNamespace) this.shareProcessNamespace = init.shareProcessNamespace; - if (init.securityContext) this.securityContext = init.securityContext; - if (init.imagePullSecrets) this.imagePullSecrets = init.imagePullSecrets; - if (init.hostname) this.hostname = init.hostname; - if (init.subdomain) this.subdomain = init.subdomain; - if (init.affinity) this.affinity = init.affinity; - if (init.schedulerName) this.schedulerName = init.schedulerName; - if (init.tolerations) this.tolerations = init.tolerations; - if (init.hostAliases) this.hostAliases = init.hostAliases; - if (init.priorityClassName) this.priorityClassName = init.priorityClassName; - if (init.priority) this.priority = init.priority; - if (init.dnsConfig) this.dnsConfig = init.dnsConfig; + if (!init) { return; } + if (init.volumes) { this.volumes = init.volumes; } + if (init.initContainers) { this.initContainers = init.initContainers; } + if (init.containers) { this.containers = init.containers; } + if (init.restartPolicy) { this.restartPolicy = init.restartPolicy; } + if (init.terminationGracePeriodSeconds) { this.terminationGracePeriodSeconds = init.terminationGracePeriodSeconds; } + if (init.activeDeadlineSeconds) { this.activeDeadlineSeconds = init.activeDeadlineSeconds; } + if (init.dnsPolicy) { this.dnsPolicy = init.dnsPolicy; } + if (init.nodeSelector) { this.nodeSelector = init.nodeSelector; } + if (init.serviceAccountName) { this.serviceAccountName = init.serviceAccountName; } + if (init.serviceAccount) { this.serviceAccount = init.serviceAccount; } + if (init.automountServiceAccountToken) { this.automountServiceAccountToken = init.automountServiceAccountToken; } + if (init.nodeName) { this.nodeName = init.nodeName; } + if (init.hostNetwork) { this.hostNetwork = init.hostNetwork; } + if (init.hostPID) { this.hostPID = init.hostPID; } + if (init.hostIPC) { this.hostIPC = init.hostIPC; } + if (init.shareProcessNamespace) { this.shareProcessNamespace = init.shareProcessNamespace; } + if (init.securityContext) { this.securityContext = init.securityContext; } + if (init.imagePullSecrets) { this.imagePullSecrets = init.imagePullSecrets; } + if (init.hostname) { this.hostname = init.hostname; } + if (init.subdomain) { this.subdomain = init.subdomain; } + if (init.affinity) { this.affinity = init.affinity; } + if (init.schedulerName) { this.schedulerName = init.schedulerName; } + if (init.tolerations) { this.tolerations = init.tolerations; } + if (init.hostAliases) { this.hostAliases = init.hostAliases; } + if (init.priorityClassName) { this.priorityClassName = init.priorityClassName; } + if (init.priority) { this.priority = init.priority; } + if (init.dnsConfig) { this.dnsConfig = init.dnsConfig; } } static emptyObject(): PodSpec { - let result = new PodSpec(); + const result = new PodSpec(); result.volumes = []; result.initContainers = []; result.containers = []; @@ -2052,14 +2052,14 @@ export class PodTemplateSpec { spec: PodSpec; constructor(init?: PodTemplateSpec) { - if (!init) return; - if (init.metadata) this.metadata = init.metadata; - if (init.spec) this.spec = init.spec; + if (!init) { return; } + if (init.metadata) { this.metadata = init.metadata; } + if (init.spec) { this.spec = init.spec; } } static emptyObject(): PodTemplateSpec { - let result = new PodTemplateSpec(); + const result = new PodTemplateSpec(); result.metadata = ObjectMeta.emptyObject(); result.spec = PodSpec.emptyObject(); return result; @@ -2073,15 +2073,15 @@ export class LabelSelectorRequirement { values: string[]; constructor(init?: LabelSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { this.key = init.key; } + if (init.operator) { this.operator = init.operator; } + if (init.values) { this.values = init.values; } } static emptyObject(): LabelSelectorRequirement { - let result = new LabelSelectorRequirement(); + const result = new LabelSelectorRequirement(); result.values = []; return result; } @@ -2093,14 +2093,14 @@ export class LabelSelector { matchExpressions: LabelSelectorRequirement[]; constructor(init?: LabelSelector) { - if (!init) return; - if (init.matchLabels) this.matchLabels = init.matchLabels; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchLabels) { this.matchLabels = init.matchLabels; } + if (init.matchExpressions) { this.matchExpressions = init.matchExpressions; } } static emptyObject(): LabelSelector { - let result = new LabelSelector(); + const result = new LabelSelector(); result.matchLabels = null; result.matchExpressions = []; return result; @@ -2119,20 +2119,20 @@ export class StatefulSetSpec { revisionHistoryLimit?: number; constructor(init?: StatefulSetSpec) { - if (!init) return; - if (init.replicas) this.replicas = init.replicas; - if (init.selector) this.selector = init.selector; - if (init.template) this.template = init.template; - if (init.volumeClaimTemplates) this.volumeClaimTemplates = init.volumeClaimTemplates; - if (init.serviceName) this.serviceName = init.serviceName; - if (init.podManagementPolicy) this.podManagementPolicy = init.podManagementPolicy; - if (init.updateStrategy) this.updateStrategy = init.updateStrategy; - if (init.revisionHistoryLimit) this.revisionHistoryLimit = init.revisionHistoryLimit; + if (!init) { return; } + if (init.replicas) { this.replicas = init.replicas; } + if (init.selector) { this.selector = init.selector; } + if (init.template) { this.template = init.template; } + if (init.volumeClaimTemplates) { this.volumeClaimTemplates = init.volumeClaimTemplates; } + if (init.serviceName) { this.serviceName = init.serviceName; } + if (init.podManagementPolicy) { this.podManagementPolicy = init.podManagementPolicy; } + if (init.updateStrategy) { this.updateStrategy = init.updateStrategy; } + if (init.revisionHistoryLimit) { this.revisionHistoryLimit = init.revisionHistoryLimit; } } static emptyObject(): StatefulSetSpec { - let result = new StatefulSetSpec(); + const result = new StatefulSetSpec(); result.selector = LabelSelector.emptyObject(); result.template = PodTemplateSpec.emptyObject(); result.volumeClaimTemplates = []; @@ -2148,15 +2148,15 @@ export class StatusCause { field: string; constructor(init?: StatusCause) { - if (!init) return; - if (init.reason) this.reason = init.reason; - if (init.message) this.message = init.message; - if (init.field) this.field = init.field; + if (!init) { return; } + if (init.reason) { this.reason = init.reason; } + if (init.message) { this.message = init.message; } + if (init.field) { this.field = init.field; } } static emptyObject(): StatusCause { - let result = new StatusCause(); + const result = new StatusCause(); return result; } @@ -2171,18 +2171,18 @@ export class StatusDetails { retryAfterSeconds: number; constructor(init?: StatusDetails) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.group) this.group = init.group; - if (init.kind) this.kind = init.kind; - if (init.uid) this.uid = init.uid; - if (init.causes) this.causes = init.causes; - if (init.retryAfterSeconds) this.retryAfterSeconds = init.retryAfterSeconds; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.group) { this.group = init.group; } + if (init.kind) { this.kind = init.kind; } + if (init.uid) { this.uid = init.uid; } + if (init.causes) { this.causes = init.causes; } + if (init.retryAfterSeconds) { this.retryAfterSeconds = init.retryAfterSeconds; } } static emptyObject(): StatusDetails { - let result = new StatusDetails(); + const result = new StatusDetails(); result.causes = []; return result; } @@ -2195,15 +2195,15 @@ export class ListMeta { continue: string; constructor(init?: ListMeta) { - if (!init) return; - if (init.selfLink) this.selfLink = init.selfLink; - if (init.resourceVersion) this.resourceVersion = init.resourceVersion; - if (init.continue) this.continue = init.continue; + if (!init) { return; } + if (init.selfLink) { this.selfLink = init.selfLink; } + if (init.resourceVersion) { this.resourceVersion = init.resourceVersion; } + if (init.continue) { this.continue = init.continue; } } static emptyObject(): ListMeta { - let result = new ListMeta(); + const result = new ListMeta(); return result; } @@ -2220,20 +2220,20 @@ export class Status { code: number; constructor(init?: Status) { - if (!init) return; - if (init.kind) this.kind = init.kind; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.metadata) this.metadata = init.metadata; - if (init.status) this.status = init.status; - if (init.message) this.message = init.message; - if (init.reason) this.reason = init.reason; - if (init.details) this.details = init.details; - if (init.code) this.code = init.code; + if (!init) { return; } + if (init.kind) { this.kind = init.kind; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.metadata) { this.metadata = init.metadata; } + if (init.status) { this.status = init.status; } + if (init.message) { this.message = init.message; } + if (init.reason) { this.reason = init.reason; } + if (init.details) { this.details = init.details; } + if (init.code) { this.code = init.code; } } static emptyObject(): Status { - let result = new Status(); + const result = new Status(); result.metadata = ListMeta.emptyObject(); result.details = StatusDetails.emptyObject(); return result; @@ -2245,13 +2245,13 @@ export class Initializer { name: string; constructor(init?: Initializer) { - if (!init) return; - if (init.name) this.name = init.name; + if (!init) { return; } + if (init.name) { this.name = init.name; } } static emptyObject(): Initializer { - let result = new Initializer(); + const result = new Initializer(); return result; } @@ -2262,14 +2262,14 @@ export class Initializers { result?: Status; constructor(init?: Initializers) { - if (!init) return; - if (init.pending) this.pending = init.pending; - if (init.result) this.result = init.result; + if (!init) { return; } + if (init.pending) { this.pending = init.pending; } + if (init.result) { this.result = init.result; } } static emptyObject(): Initializers { - let result = new Initializers(); + const result = new Initializers(); result.pending = []; result.result = Status.emptyObject(); return result; @@ -2286,18 +2286,18 @@ export class OwnerReference { blockOwnerDeletion?: boolean; constructor(init?: OwnerReference) { - if (!init) return; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.kind) this.kind = init.kind; - if (init.name) this.name = init.name; - if (init.uid) this.uid = init.uid; - if (init.controller) this.controller = init.controller; - if (init.blockOwnerDeletion) this.blockOwnerDeletion = init.blockOwnerDeletion; + if (!init) { return; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.kind) { this.kind = init.kind; } + if (init.name) { this.name = init.name; } + if (init.uid) { this.uid = init.uid; } + if (init.controller) { this.controller = init.controller; } + if (init.blockOwnerDeletion) { this.blockOwnerDeletion = init.blockOwnerDeletion; } } static emptyObject(): OwnerReference { - let result = new OwnerReference(); + const result = new OwnerReference(); return result; } @@ -2322,28 +2322,28 @@ export class ObjectMeta { clusterName: string; constructor(init?: ObjectMeta) { - if (!init) return; - if (init.name) this.name = init.name; - if (init.generateName) this.generateName = init.generateName; - if (init.namespace) this.namespace = init.namespace; - if (init.selfLink) this.selfLink = init.selfLink; - if (init.uid) this.uid = init.uid; - if (init.resourceVersion) this.resourceVersion = init.resourceVersion; - if (init.generation) this.generation = init.generation; - if (init.creationTimestamp) this.creationTimestamp = init.creationTimestamp; - if (init.deletionTimestamp) this.deletionTimestamp = init.deletionTimestamp; - if (init.deletionGracePeriodSeconds) this.deletionGracePeriodSeconds = init.deletionGracePeriodSeconds; - if (init.labels) this.labels = init.labels; - if (init.annotations) this.annotations = init.annotations; - if (init.ownerReferences) this.ownerReferences = init.ownerReferences; - if (init.initializers) this.initializers = init.initializers; - if (init.finalizers) this.finalizers = init.finalizers; - if (init.clusterName) this.clusterName = init.clusterName; + if (!init) { return; } + if (init.name) { this.name = init.name; } + if (init.generateName) { this.generateName = init.generateName; } + if (init.namespace) { this.namespace = init.namespace; } + if (init.selfLink) { this.selfLink = init.selfLink; } + if (init.uid) { this.uid = init.uid; } + if (init.resourceVersion) { this.resourceVersion = init.resourceVersion; } + if (init.generation) { this.generation = init.generation; } + if (init.creationTimestamp) { this.creationTimestamp = init.creationTimestamp; } + if (init.deletionTimestamp) { this.deletionTimestamp = init.deletionTimestamp; } + if (init.deletionGracePeriodSeconds) { this.deletionGracePeriodSeconds = init.deletionGracePeriodSeconds; } + if (init.labels) { this.labels = init.labels; } + if (init.annotations) { this.annotations = init.annotations; } + if (init.ownerReferences) { this.ownerReferences = init.ownerReferences; } + if (init.initializers) { this.initializers = init.initializers; } + if (init.finalizers) { this.finalizers = init.finalizers; } + if (init.clusterName) { this.clusterName = init.clusterName; } } static emptyObject(): ObjectMeta { - let result = new ObjectMeta(); + const result = new ObjectMeta(); result.creationTimestamp = null; result.deletionTimestamp = null; result.labels = null; @@ -2364,17 +2364,17 @@ export class KubeStatefulSet { status: StatefulSetStatus; constructor(init?: KubeStatefulSet) { - if (!init) return; - if (init.kind) this.kind = init.kind; - if (init.apiVersion) this.apiVersion = init.apiVersion; - if (init.metadata) this.metadata = init.metadata; - if (init.spec) this.spec = init.spec; - if (init.status) this.status = init.status; + if (!init) { return; } + if (init.kind) { this.kind = init.kind; } + if (init.apiVersion) { this.apiVersion = init.apiVersion; } + if (init.metadata) { this.metadata = init.metadata; } + if (init.spec) { this.spec = init.spec; } + if (init.status) { this.status = init.status; } } static emptyObject(): KubeStatefulSet { - let result = new KubeStatefulSet(); + const result = new KubeStatefulSet(); result.metadata = ObjectMeta.emptyObject(); result.spec = StatefulSetSpec.emptyObject(); result.status = StatefulSetStatus.emptyObject(); diff --git a/src/frontend/src/app/shared/model/v1/namespace.ts b/src/frontend/src/app/shared/model/v1/namespace.ts index 39d5e3e72..790ee73e9 100644 --- a/src/frontend/src/app/shared/model/v1/namespace.ts +++ b/src/frontend/src/app/shared/model/v1/namespace.ts @@ -1,10 +1,19 @@ export class Namespace { + id: number; + name: string; + deleted: boolean; + metaData: string; + metaDataObj: NamespaceMetaData; + user: string; + createTime: Date; + updateTime: Date; + constructor() { this.metaDataObj = new NamespaceMetaData(); } static ParseNamespaceMetaData(obj: any) { - let namespaceMetaData = new NamespaceMetaData(); + const namespaceMetaData = new NamespaceMetaData(); const metaDataObj = JSON.parse(obj); Object.getOwnPropertyNames(metaDataObj).forEach(name => { namespaceMetaData[name] = metaDataObj[name]; @@ -13,33 +22,21 @@ export class Namespace { } static emptyObject(): Namespace { - let result = new Namespace(); + const result = new Namespace(); result.createTime = null; result.updateTime = null; return result; } - - id: number; - name: string; - deleted: boolean; - metaData: string; - metaDataObj: NamespaceMetaData; - user: string; - createTime: Date; - updateTime: Date; } export class ResourcesLimit { cpu: number; memory: number; - //[NamespaceMetaDataResources:] constructor() { this.cpu = 0; this.memory = 0; } - - //[end] } export class ClusterMeta { @@ -61,11 +58,6 @@ export class NamespaceMetaData { this.env = []; this.clusterMeta = {}; } - - //[NamespaceMetaData:] - - - //[end] } export class EnvVar { diff --git a/src/frontend/src/app/shared/model/v1/permission.ts b/src/frontend/src/app/shared/model/v1/permission.ts index 9b2fde717..90fdebaf6 100644 --- a/src/frontend/src/app/shared/model/v1/permission.ts +++ b/src/frontend/src/app/shared/model/v1/permission.ts @@ -5,6 +5,15 @@ export class Permission { type: string; } +export class ActionPermission { + read = false; + create = false; + update = false; + delete = false; + deploy = false; + offline = false; +} + export class TypePermission { app: ActionPermission = new ActionPermission(); appUser: ActionPermission = new ActionPermission(); @@ -40,12 +49,3 @@ export class TypePermission { this.daemonSet = input.daemonSet ? input.daemonSet : this.daemonSet; } } - -export class ActionPermission { - read = false; - create = false; - update = false; - delete = false; - deploy = false; - offline = false; -} diff --git a/src/frontend/src/app/shared/model/v1/publish-history.ts b/src/frontend/src/app/shared/model/v1/publish-history.ts index 783c93dbd..ce069b20c 100644 --- a/src/frontend/src/app/shared/model/v1/publish-history.ts +++ b/src/frontend/src/app/shared/model/v1/publish-history.ts @@ -8,6 +8,4 @@ export class PublishHistory { message: string; user: string; createTime: Date; - //[PublishHistory:] - //[end] } diff --git a/src/frontend/src/app/shared/model/v1/statefulset.ts b/src/frontend/src/app/shared/model/v1/statefulset.ts index 898fe850d..ae75797ba 100644 --- a/src/frontend/src/app/shared/model/v1/statefulset.ts +++ b/src/frontend/src/app/shared/model/v1/statefulset.ts @@ -1,5 +1,39 @@ /* Do not change, this code is generated from Golang structs */ +export class Namespace { + id: number; + name: string; + metaData: string; + createTime?: Date; + updateTime?: Date; + user: string; + deleted: boolean; + + constructor(init?: Namespace) { + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.metaData) { this.metaData = init.metaData; } + if (init.createTime) { this.createTime = new Date(init.createTime as any); } + if (init.updateTime) { this.updateTime = new Date(init.updateTime as any); } + if (init.user) { this.user = init.user; } + if (init.deleted) { this.deleted = init.deleted; } + } + + + static emptyObject(): Namespace { + const result = new Namespace(); + result.id = 0; + result.name = ''; + result.metaData = ''; + result.createTime = null; + result.updateTime = null; + result.user = ''; + result.deleted = false; + return result; + } + +} export class User { id: number; @@ -17,25 +51,25 @@ export class User { namespaces: Namespace[]; constructor(init?: User) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.email) this.email = init.email; - if (init.display) this.display = init.display; - if (init.comment) this.comment = init.comment; - if (init.type) this.type = init.type; - if (init.enabled) this.enabled = init.enabled; - if (init.admin) this.admin = init.admin; - if (init.lastLogin) this.lastLogin = new Date(init.lastLogin as any); - if (init.lastIp) this.lastIp = init.lastIp; - if (init.createTime) this.createTime = new Date(init.createTime as any); - if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.namespaces) this.namespaces = init.namespaces; + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.email) { this.email = init.email; } + if (init.display) { this.display = init.display; } + if (init.comment) { this.comment = init.comment; } + if (init.type) { this.type = init.type; } + if (init.enabled) { this.enabled = init.enabled; } + if (init.admin) { this.admin = init.admin; } + if (init.lastLogin) { this.lastLogin = new Date(init.lastLogin as any); } + if (init.lastIp) { this.lastIp = init.lastIp; } + if (init.createTime) { this.createTime = new Date(init.createTime as any); } + if (init.updateTime) { this.updateTime = new Date(init.updateTime as any); } + if (init.namespaces) { this.namespaces = init.namespaces; } } static emptyObject(): User { - let result = new User(); + const result = new User(); result.id = 0; result.name = ''; result.email = ''; @@ -54,103 +88,68 @@ export class User { } -export class AppStarred { - id: number; - app?: App; - user?: User; - - constructor(init?: AppStarred) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.app) this.app = init.app; - if (init.user) this.user = init.user; - } - - - static emptyObject(): AppStarred { - let result = new AppStarred(); - result.id = 0; - result.app = App.emptyObject(); - result.user = User.emptyObject(); - return result; - } - -} - -export class Namespace { +export class App { id: number; name: string; + namespace?: Namespace; metaData: string; + description: string; createTime?: Date; updateTime?: Date; user: string; deleted: boolean; + AppStars: AppStarred[]; - constructor(init?: Namespace) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.metaData) this.metaData = init.metaData; - if (init.createTime) this.createTime = new Date(init.createTime as any); - if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.user) this.user = init.user; - if (init.deleted) this.deleted = init.deleted; + constructor(init?: App) { + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.namespace) { this.namespace = init.namespace; } + if (init.metaData) { this.metaData = init.metaData; } + if (init.description) { this.description = init.description; } + if (init.createTime) { this.createTime = new Date(init.createTime as any); } + if (init.updateTime) { this.updateTime = new Date(init.updateTime as any); } + if (init.user) { this.user = init.user; } + if (init.deleted) { this.deleted = init.deleted; } + if (init.AppStars) { this.AppStars = init.AppStars; } } - static emptyObject(): Namespace { - let result = new Namespace(); + static emptyObject(): App { + const result = new App(); result.id = 0; result.name = ''; + result.namespace = Namespace.emptyObject(); result.metaData = ''; + result.description = ''; result.createTime = null; result.updateTime = null; result.user = ''; result.deleted = false; + result.AppStars = []; return result; } } -export class App { +export class AppStarred { id: number; - name: string; - namespace?: Namespace; - metaData: string; - description: string; - createTime?: Date; - updateTime?: Date; - user: string; - deleted: boolean; - AppStars: AppStarred[]; + app?: App; + user?: User; - constructor(init?: App) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.namespace) this.namespace = init.namespace; - if (init.metaData) this.metaData = init.metaData; - if (init.description) this.description = init.description; - if (init.createTime) this.createTime = new Date(init.createTime as any); - if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.user) this.user = init.user; - if (init.deleted) this.deleted = init.deleted; - if (init.AppStars) this.AppStars = init.AppStars; + constructor(init?: AppStarred) { + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.app) { this.app = init.app; } + if (init.user) { this.user = init.user; } } - static emptyObject(): App { - let result = new App(); + static emptyObject(): AppStarred { + const result = new AppStarred(); result.id = 0; - result.name = ''; - result.namespace = Namespace.emptyObject(); - result.metaData = ''; - result.description = ''; - result.createTime = null; - result.updateTime = null; - result.user = ''; - result.deleted = false; - result.AppStars = []; + result.app = App.emptyObject(); + result.user = User.emptyObject(); return result; } @@ -171,22 +170,22 @@ export class Statefulset { appId: number; constructor(init?: Statefulset) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.metaData) this.metaData = init.metaData; - if (init.app) this.app = init.app; - if (init.description) this.description = init.description; - if (init.createTime) this.createTime = new Date(init.createTime as any); - if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.user) this.user = init.user; - if (init.deleted) this.deleted = init.deleted; - if (init.appId) this.appId = init.appId; + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.metaData) { this.metaData = init.metaData; } + if (init.app) { this.app = init.app; } + if (init.description) { this.description = init.description; } + if (init.createTime) { this.createTime = new Date(init.createTime as any); } + if (init.updateTime) { this.updateTime = new Date(init.updateTime as any); } + if (init.user) { this.user = init.user; } + if (init.deleted) { this.deleted = init.deleted; } + if (init.appId) { this.appId = init.appId; } } static emptyObject(): Statefulset { - let result = new Statefulset(); + const result = new Statefulset(); result.id = 0; result.name = ''; result.metaData = ''; @@ -202,19 +201,51 @@ export class Statefulset { } +export class PodAffinityTerm { + labelSelector?: LabelSelector; + namespaces: string[]; + topologyKey: string; + + constructor(init?: PodAffinityTerm) { + if (!init) { return; } + if (init.labelSelector) { + this.labelSelector = init.labelSelector; + } + if (init.namespaces) { + this.namespaces = init.namespaces; + } + if (init.topologyKey) { + this.topologyKey = init.topologyKey; + } + } + + + static emptyObject(): PodAffinityTerm { + const result = new PodAffinityTerm(); + result.labelSelector = LabelSelector.emptyObject(); + result.namespaces = []; + return result; + } + +} + export class PodAntiAffinity { requiredDuringSchedulingIgnoredDuringExecution: PodAffinityTerm[]; preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAntiAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; + } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + } } static emptyObject(): PodAntiAffinity { - let result = new PodAntiAffinity(); + const result = new PodAntiAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -227,14 +258,18 @@ export class WeightedPodAffinityTerm { podAffinityTerm: PodAffinityTerm; constructor(init?: WeightedPodAffinityTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.podAffinityTerm) this.podAffinityTerm = init.podAffinityTerm; + if (!init) { return; } + if (init.weight) { + this.weight = init.weight; + } + if (init.podAffinityTerm) { + this.podAffinityTerm = init.podAffinityTerm; + } } static emptyObject(): WeightedPodAffinityTerm { - let result = new WeightedPodAffinityTerm(); + const result = new WeightedPodAffinityTerm(); result.podAffinityTerm = PodAffinityTerm.emptyObject(); return result; } @@ -247,15 +282,21 @@ export class LabelSelectorRequirement { values: string[]; constructor(init?: LabelSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { + this.key = init.key; + } + if (init.operator) { + this.operator = init.operator; + } + if (init.values) { + this.values = init.values; + } } static emptyObject(): LabelSelectorRequirement { - let result = new LabelSelectorRequirement(); + const result = new LabelSelectorRequirement(); result.values = []; return result; } @@ -267,14 +308,18 @@ export class LabelSelector { matchExpressions: LabelSelectorRequirement[]; constructor(init?: LabelSelector) { - if (!init) return; - if (init.matchLabels) this.matchLabels = init.matchLabels; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchLabels) { + this.matchLabels = init.matchLabels; + } + if (init.matchExpressions) { + this.matchExpressions = init.matchExpressions; + } } static emptyObject(): LabelSelector { - let result = new LabelSelector(); + const result = new LabelSelector(); result.matchLabels = null; result.matchExpressions = []; return result; @@ -282,41 +327,23 @@ export class LabelSelector { } -export class PodAffinityTerm { - labelSelector?: LabelSelector; - namespaces: string[]; - topologyKey: string; - - constructor(init?: PodAffinityTerm) { - if (!init) return; - if (init.labelSelector) this.labelSelector = init.labelSelector; - if (init.namespaces) this.namespaces = init.namespaces; - if (init.topologyKey) this.topologyKey = init.topologyKey; - } - - - static emptyObject(): PodAffinityTerm { - let result = new PodAffinityTerm(); - result.labelSelector = LabelSelector.emptyObject(); - result.namespaces = []; - return result; - } - -} - export class PodAffinity { requiredDuringSchedulingIgnoredDuringExecution: PodAffinityTerm[]; preferredDuringSchedulingIgnoredDuringExecution: WeightedPodAffinityTerm[]; constructor(init?: PodAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; + } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + } } static emptyObject(): PodAffinity { - let result = new PodAffinity(); + const result = new PodAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = []; result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -329,14 +356,18 @@ export class PreferredSchedulingTerm { preference: NodeSelectorTerm; constructor(init?: PreferredSchedulingTerm) { - if (!init) return; - if (init.weight) this.weight = init.weight; - if (init.preference) this.preference = init.preference; + if (!init) { return; } + if (init.weight) { + this.weight = init.weight; + } + if (init.preference) { + this.preference = init.preference; + } } static emptyObject(): PreferredSchedulingTerm { - let result = new PreferredSchedulingTerm(); + const result = new PreferredSchedulingTerm(); result.preference = NodeSelectorTerm.emptyObject(); return result; } @@ -349,15 +380,21 @@ export class NodeSelectorRequirement { values: string[]; constructor(init?: NodeSelectorRequirement) { - if (!init) return; - if (init.key) this.key = init.key; - if (init.operator) this.operator = init.operator; - if (init.values) this.values = init.values; + if (!init) { return; } + if (init.key) { + this.key = init.key; + } + if (init.operator) { + this.operator = init.operator; + } + if (init.values) { + this.values = init.values; + } } static emptyObject(): NodeSelectorRequirement { - let result = new NodeSelectorRequirement(); + const result = new NodeSelectorRequirement(); result.values = []; return result; } @@ -368,13 +405,15 @@ export class NodeSelectorTerm { matchExpressions: NodeSelectorRequirement[]; constructor(init?: NodeSelectorTerm) { - if (!init) return; - if (init.matchExpressions) this.matchExpressions = init.matchExpressions; + if (!init) { return; } + if (init.matchExpressions) { + this.matchExpressions = init.matchExpressions; + } } static emptyObject(): NodeSelectorTerm { - let result = new NodeSelectorTerm(); + const result = new NodeSelectorTerm(); result.matchExpressions = []; return result; } @@ -385,13 +424,15 @@ export class NodeSelector { nodeSelectorTerms: NodeSelectorTerm[]; constructor(init?: NodeSelector) { - if (!init) return; - if (init.nodeSelectorTerms) this.nodeSelectorTerms = init.nodeSelectorTerms; + if (!init) { return; } + if (init.nodeSelectorTerms) { + this.nodeSelectorTerms = init.nodeSelectorTerms; + } } static emptyObject(): NodeSelector { - let result = new NodeSelector(); + const result = new NodeSelector(); result.nodeSelectorTerms = []; return result; } @@ -403,14 +444,18 @@ export class NodeAffinity { preferredDuringSchedulingIgnoredDuringExecution: PreferredSchedulingTerm[]; constructor(init?: NodeAffinity) { - if (!init) return; - if (init.requiredDuringSchedulingIgnoredDuringExecution) this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; - if (init.preferredDuringSchedulingIgnoredDuringExecution) this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + if (!init) { return; } + if (init.requiredDuringSchedulingIgnoredDuringExecution) { + this.requiredDuringSchedulingIgnoredDuringExecution = init.requiredDuringSchedulingIgnoredDuringExecution; + } + if (init.preferredDuringSchedulingIgnoredDuringExecution) { + this.preferredDuringSchedulingIgnoredDuringExecution = init.preferredDuringSchedulingIgnoredDuringExecution; + } } static emptyObject(): NodeAffinity { - let result = new NodeAffinity(); + const result = new NodeAffinity(); result.requiredDuringSchedulingIgnoredDuringExecution = NodeSelector.emptyObject(); result.preferredDuringSchedulingIgnoredDuringExecution = []; return result; @@ -424,15 +469,15 @@ export class Affinity { podAntiAffinity?: PodAntiAffinity; constructor(init?: Affinity) { - if (!init) return; - if (init.nodeAffinity) this.nodeAffinity = init.nodeAffinity; - if (init.podAffinity) this.podAffinity = init.podAffinity; - if (init.podAntiAffinity) this.podAntiAffinity = init.podAntiAffinity; + if (!init) { return; } + if (init.nodeAffinity) { this.nodeAffinity = init.nodeAffinity; } + if (init.podAffinity) { this.podAffinity = init.podAffinity; } + if (init.podAntiAffinity) { this.podAntiAffinity = init.podAntiAffinity; } } static emptyObject(): Affinity { - let result = new Affinity(); + const result = new Affinity(); result.nodeAffinity = NodeAffinity.emptyObject(); result.podAffinity = PodAffinity.emptyObject(); result.podAntiAffinity = PodAntiAffinity.emptyObject(); @@ -448,16 +493,16 @@ export class StatefulsetMetaData { privileged?: { [key: string]: boolean }; constructor(init?: StatefulsetMetaData) { - if (!init) return; - if (init.replicas) this.replicas = init.replicas; - if (init.resources) this.resources = init.resources; - if (init.affinity) this.affinity = init.affinity; - if (init.privileged) this.privileged = init.privileged; + if (!init) { return; } + if (init.replicas) { this.replicas = init.replicas; } + if (init.resources) { this.resources = init.resources; } + if (init.affinity) { this.affinity = init.affinity; } + if (init.privileged) { this.privileged = init.privileged; } } static emptyObject(): StatefulsetMetaData { - let result = new StatefulsetMetaData(); + const result = new StatefulsetMetaData(); result.replicas = null; result.resources = null; result.affinity = Affinity.emptyObject(); diff --git a/src/frontend/src/app/shared/model/v1/statefulsettpl.ts b/src/frontend/src/app/shared/model/v1/statefulsettpl.ts index 45c72fc37..41b95fd42 100644 --- a/src/frontend/src/app/shared/model/v1/statefulsettpl.ts +++ b/src/frontend/src/app/shared/model/v1/statefulsettpl.ts @@ -19,25 +19,25 @@ export class User { namespaces: Namespace[]; constructor(init?: User) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.email) this.email = init.email; - if (init.display) this.display = init.display; - if (init.comment) this.comment = init.comment; - if (init.type) this.type = init.type; - if (init.enabled) this.enabled = init.enabled; - if (init.admin) this.admin = init.admin; - if (init.lastLogin) this.lastLogin = new Date(init.lastLogin as any); - if (init.lastIp) this.lastIp = init.lastIp; - if (init.createTime) this.createTime = new Date(init.createTime as any); - if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.namespaces) this.namespaces = init.namespaces; + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.email) { this.email = init.email; } + if (init.display) { this.display = init.display; } + if (init.comment) { this.comment = init.comment; } + if (init.type) { this.type = init.type; } + if (init.enabled) { this.enabled = init.enabled; } + if (init.admin) { this.admin = init.admin; } + if (init.lastLogin) { this.lastLogin = new Date(init.lastLogin as any); } + if (init.lastIp) { this.lastIp = init.lastIp; } + if (init.createTime) { this.createTime = new Date(init.createTime as any); } + if (init.updateTime) { this.updateTime = new Date(init.updateTime as any); } + if (init.namespaces) { this.namespaces = init.namespaces; } } static emptyObject(): User { - let result = new User(); + const result = new User(); result.id = 0; result.name = ''; result.email = ''; @@ -56,111 +56,112 @@ export class User { } -export class AppStarred { - id: number; - app?: App; - user?: User; - - constructor(init?: AppStarred) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.app) this.app = init.app; - if (init.user) this.user = init.user; - } - - - static emptyObject(): AppStarred { - let result = new AppStarred(); - result.id = 0; - result.app = App.emptyObject(); - result.user = User.emptyObject(); - return result; - } - -} - - - -export class Namespace { +export class App { id: number; name: string; + namespace?: Namespace; metaData: string; + description: string; createTime?: Date; updateTime?: Date; user: string; deleted: boolean; + AppStars: AppStarred[]; - constructor(init?: Namespace) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.metaData) this.metaData = init.metaData; - if (init.createTime) this.createTime = new Date(init.createTime as any); - if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.user) this.user = init.user; - if (init.deleted) this.deleted = init.deleted; + constructor(init?: App) { + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.namespace) { this.namespace = init.namespace; } + if (init.metaData) { this.metaData = init.metaData; } + if (init.description) { this.description = init.description; } + if (init.createTime) { this.createTime = new Date(init.createTime as any); } + if (init.updateTime) { this.updateTime = new Date(init.updateTime as any); } + if (init.user) { this.user = init.user; } + if (init.deleted) { this.deleted = init.deleted; } + if (init.AppStars) { this.AppStars = init.AppStars; } } - static emptyObject(): Namespace { - let result = new Namespace(); + static emptyObject(): App { + const result = new App(); result.id = 0; result.name = ''; + result.namespace = Namespace.emptyObject(); result.metaData = ''; + result.description = ''; result.createTime = null; result.updateTime = null; result.user = ''; result.deleted = false; + result.AppStars = []; return result; } } -export class App { +export class AppStarred { + id: number; + app?: App; + user?: User; + + constructor(init?: AppStarred) { + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.app) { this.app = init.app; } + if (init.user) { this.user = init.user; } + } + + static emptyObject(): AppStarred { + const result = new AppStarred(); + result.id = 0; + result.app = App.emptyObject(); + result.user = User.emptyObject(); + return result; + } + +} + + + + +export class Namespace { id: number; name: string; - namespace?: Namespace; metaData: string; - description: string; createTime?: Date; updateTime?: Date; user: string; deleted: boolean; - AppStars: AppStarred[]; - constructor(init?: App) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.namespace) this.namespace = init.namespace; - if (init.metaData) this.metaData = init.metaData; - if (init.description) this.description = init.description; - if (init.createTime) this.createTime = new Date(init.createTime as any); - if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.user) this.user = init.user; - if (init.deleted) this.deleted = init.deleted; - if (init.AppStars) this.AppStars = init.AppStars; + constructor(init?: Namespace) { + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.metaData) { this.metaData = init.metaData; } + if (init.createTime) { this.createTime = new Date(init.createTime as any); } + if (init.updateTime) { this.updateTime = new Date(init.updateTime as any); } + if (init.user) { this.user = init.user; } + if (init.deleted) { this.deleted = init.deleted; } } - static emptyObject(): App { - let result = new App(); + static emptyObject(): Namespace { + const result = new Namespace(); result.id = 0; result.name = ''; - result.namespace = Namespace.emptyObject(); result.metaData = ''; - result.description = ''; result.createTime = null; result.updateTime = null; result.user = ''; result.deleted = false; - result.AppStars = []; return result; } } + export class Statefulset { id: number; name: string; @@ -174,22 +175,22 @@ export class Statefulset { appId: number; constructor(init?: Statefulset) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.metaData) this.metaData = init.metaData; - if (init.app) this.app = init.app; - if (init.description) this.description = init.description; - if (init.createTime) this.createTime = new Date(init.createTime as any); - if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.user) this.user = init.user; - if (init.deleted) this.deleted = init.deleted; - if (init.appId) this.appId = init.appId; + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.metaData) { this.metaData = init.metaData; } + if (init.app) { this.app = init.app; } + if (init.description) { this.description = init.description; } + if (init.createTime) { this.createTime = new Date(init.createTime as any); } + if (init.updateTime) { this.updateTime = new Date(init.updateTime as any); } + if (init.user) { this.user = init.user; } + if (init.deleted) { this.deleted = init.deleted; } + if (init.appId) { this.appId = init.appId; } } static emptyObject(): Statefulset { - let result = new Statefulset(); + const result = new Statefulset(); result.id = 0; result.name = ''; result.metaData = ''; @@ -221,23 +222,23 @@ export class StatefulsetTemplate { containerVersions: string[]; constructor(init?: StatefulsetTemplate) { - if (!init) return; - if (init.id) this.id = init.id; - if (init.name) this.name = init.name; - if (init.template) this.template = init.template; - if (init.statefulset) this.statefulset = init.statefulset; - if (init.description) this.description = init.description; - if (init.createTime) this.createTime = new Date(init.createTime as any); - if (init.updateTime) this.updateTime = new Date(init.updateTime as any); - if (init.user) this.user = init.user; - if (init.deleted) this.deleted = init.deleted; - if (init.statefulsetId) this.statefulsetId = init.statefulsetId; - if (init.status) this.status = init.status; + if (!init) { return; } + if (init.id) { this.id = init.id; } + if (init.name) { this.name = init.name; } + if (init.template) { this.template = init.template; } + if (init.statefulset) { this.statefulset = init.statefulset; } + if (init.description) { this.description = init.description; } + if (init.createTime) { this.createTime = new Date(init.createTime as any); } + if (init.updateTime) { this.updateTime = new Date(init.updateTime as any); } + if (init.user) { this.user = init.user; } + if (init.deleted) { this.deleted = init.deleted; } + if (init.statefulsetId) { this.statefulsetId = init.statefulsetId; } + if (init.status) { this.status = init.status; } } static emptyObject(): StatefulsetTemplate { - let result = new StatefulsetTemplate(); + const result = new StatefulsetTemplate(); result.id = 0; result.name = ''; result.template = ''; diff --git a/src/frontend/src/app/shared/model/v1/status.ts b/src/frontend/src/app/shared/model/v1/status.ts index 59aeedac4..a5e2b4c57 100644 --- a/src/frontend/src/app/shared/model/v1/status.ts +++ b/src/frontend/src/app/shared/model/v1/status.ts @@ -18,7 +18,7 @@ export class TemplateStatus { } static fromPublishStatus(state: PublishStatus) { - let dStatus = new TemplateStatus(); + const dStatus = new TemplateStatus(); dStatus.id = state.id; dStatus.deploymentId = state.resourceId; dStatus.templateId = state.templateId; diff --git a/src/frontend/src/app/shared/navigation/navigation.component.ts b/src/frontend/src/app/shared/navigation/navigation.component.ts index e697c5046..da59ea27f 100644 --- a/src/frontend/src/app/shared/navigation/navigation.component.ts +++ b/src/frontend/src/app/shared/navigation/navigation.component.ts @@ -12,11 +12,11 @@ export class NavigationComponent implements OnInit, AfterViewInit, OnDestroy { nodeTree: Array; private box: any; - boxHeight: number = 0; + boxHeight = 0; boxOffset: number; allNodeOffset: Array; // 判断是否在点击跳转中,避开scrollEvent 事件 - jumpTo: number = 0; + jumpTo = 0; scrollEventManage: any; /** @@ -35,7 +35,7 @@ export class NavigationComponent implements OnInit, AfterViewInit, OnDestroy { @Input() set container(value: string) { if (value) { - if (this.scrollEventManage) this.scrollEventManage(); + if (this.scrollEventManage) { this.scrollEventManage(); } if (this.document.querySelector(value)) { this.box = this.document.querySelector(value); this.scrollEventManage = this.eventMessage.addEventListener(this.box, 'scroll', this.scrollEvent.bind(this)); @@ -57,14 +57,14 @@ export class NavigationComponent implements OnInit, AfterViewInit, OnDestroy { } ngOnDestroy() { - if (this.scrollEventManage) this.scrollEventManage(); + if (this.scrollEventManage) { this.scrollEventManage(); } } boxInit() { if (this.box) { this.boxHeight = this.getBoxHeight(this.box); this.boxOffset = this.getOffset(this.box); - if (this.nodeTree) this.allNodeOffset = this.getBoxOffset(); + if (this.nodeTree) { this.allNodeOffset = this.getBoxOffset(); } } } @@ -99,7 +99,8 @@ export class NavigationComponent implements OnInit, AfterViewInit, OnDestroy { jumpEvent(nodeId: string, event: any) { event.preventDefault(); - this.jumpTo = this.getOffset(this.getElement(nodeId)) - this.boxOffset > this.box.scrollHeight - this.box.offsetHeight ? this.box.scrollHeight - this.box.offsetHeight : this.getOffset(this.getElement(nodeId)) - this.boxOffset; + this.jumpTo = this.getOffset(this.getElement(nodeId)) - this.boxOffset > this.box.scrollHeight - this.box.offsetHeight ? + this.box.scrollHeight - this.box.offsetHeight : this.getOffset(this.getElement(nodeId)) - this.boxOffset; this.box.scrollTo({ top: this.jumpTo, behavior: 'smooth' @@ -148,7 +149,7 @@ export class NavigationComponent implements OnInit, AfterViewInit, OnDestroy { } removeActive() { - if (this.document.querySelector('li.active')) this.document.querySelector('li.active').classList.remove('active'); + if (this.document.querySelector('li.active')) { this.document.querySelector('li.active').classList.remove('active'); } } addActive(nodeId: string) { @@ -161,9 +162,9 @@ export class NavigationComponent implements OnInit, AfterViewInit, OnDestroy { setActive(top: number): void { if (this.allNodeOffset) { - for (var key = 0; key < this.allNodeOffset.length; key++) { + for (let key = 0; key < this.allNodeOffset.length; key++) { if (this.allNodeOffset[key].offset >= top + this.boxOffset) { - let nodeId = this.allNodeOffset[key ? key - 1 : 0].id; + const nodeId = this.allNodeOffset[key ? key - 1 : 0].id; if (!this.isActive(nodeId)) { this.removeActive(); this.addActive(nodeId); @@ -175,15 +176,15 @@ export class NavigationComponent implements OnInit, AfterViewInit, OnDestroy { } getAllNode(array: Array) { - let nodeArray: Array = new Array(); - let arr = JSON.parse(JSON.stringify(array)); + const nodeArray: Array = new Array(); + const arr = JSON.parse(JSON.stringify(array)); - function resolveChild(arr: Array) { - arr.forEach(node => { + function resolveChild(children: Array) { + children.forEach(node => { if (node.id) { nodeArray.push(node.id); } - if (node.child) resolveChild(node.child); + if (node.child) { resolveChild(node.child); } }); } @@ -192,15 +193,15 @@ export class NavigationComponent implements OnInit, AfterViewInit, OnDestroy { } /** - * @param {array} 输入一个node,tree,不包含text参数 - * @returns {arrar} 返回一个node数组,补全text参数 + * 输入一个node,tree,不包含text参数 + * 返回一个node数组,补全text参数 */ resolveTree(array: Array | undefined): Array { if (array) { array.forEach(item => { if (item.id === undefined) { - console.trace('数据缺少id'); + console.log('数据缺少id'); } if (item.text === undefined) { item.text = item.id; @@ -221,7 +222,7 @@ export class NavigationComponent implements OnInit, AfterViewInit, OnDestroy { } /** - * @param{elment} 获取element相对于body的偏移量 + * @param 获取element相对于body的偏移量 */ getOffset(element: any | null): number { diff --git a/src/frontend/src/app/shared/page/page-state.ts b/src/frontend/src/app/shared/page/page-state.ts index 83c99cd3d..fa368a1d5 100644 --- a/src/frontend/src/app/shared/page/page-state.ts +++ b/src/frontend/src/app/shared/page/page-state.ts @@ -1,12 +1,24 @@ import { State } from '@clr/angular'; +export class Page { + pageNo ? = 1; + pageSize ? = 10; + totalPage?: number; + totalCount?: number; +} + +export class Sort { + by: string; + reverse: boolean; +} + export class PageState { - page? = new Page(); - sort? = new Sort(); - filters? = {}; + page ? = new Page(); + sort ? = new Sort(); + filters ? = {}; // relate?: string; // isOnline?: boolean; - params? = {}; + params ? = {}; constructor(page?: Page) { if (page) { @@ -19,7 +31,7 @@ export class PageState { if (!state) { return new PageState(); } - let pageState = new PageState(page); + const pageState = new PageState(page); if (state.page) { pageState.page.pageNo = Math.ceil((state.page.to + 1) / state.page.size); @@ -30,8 +42,8 @@ export class PageState { pageState.sort.reverse = state.sort.reverse; } if (state.filters) { - for (let filter of state.filters) { - let {property, value} = <{ property: string, value: string }>filter; + for (const filter of state.filters) { + const {property, value} = <{ property: string, value: string }>filter; pageState.filters[property] = value; } } @@ -39,15 +51,3 @@ export class PageState { } } -export class Page { - pageNo?: number = 1; - pageSize?: number = 10; - totalPage?: number; - totalCount?: number; -} - -export class Sort { - by: string; - reverse: boolean; -} - diff --git a/src/frontend/src/app/shared/pipe/relative-time.filter.pipe.ts b/src/frontend/src/app/shared/pipe/relative-time.filter.pipe.ts index 815473a2d..069d9dc2f 100644 --- a/src/frontend/src/app/shared/pipe/relative-time.filter.pipe.ts +++ b/src/frontend/src/app/shared/pipe/relative-time.filter.pipe.ts @@ -7,15 +7,15 @@ import { Pipe, PipeTransform } from '@angular/core'; export class RelativeTimeFilterPipe implements PipeTransform { transform(inputDate: string): string { - let current = new Date().valueOf(); - let input = new Date(inputDate).valueOf(); - let msPerMinute = 60 * 1000; - let msPerHour = msPerMinute * 60; - let msPerDay = msPerHour * 24; - let msPerMonth = msPerDay * 30; - let msPerYear = msPerDay * 365; + const current = new Date().valueOf(); + const input = new Date(inputDate).valueOf(); + const msPerMinute = 60 * 1000; + const msPerHour = msPerMinute * 60; + const msPerDay = msPerHour * 24; + const msPerMonth = msPerDay * 30; + const msPerYear = msPerDay * 365; - let elapsed = current - input; + const elapsed = current - input; if (elapsed < msPerMinute) { return Math.floor(elapsed / 1000) + 's'; diff --git a/src/frontend/src/app/shared/tabs/ListStyle.ts b/src/frontend/src/app/shared/tabs/ListStyle.ts index 3185db6ab..a96f9b8c3 100644 --- a/src/frontend/src/app/shared/tabs/ListStyle.ts +++ b/src/frontend/src/app/shared/tabs/ListStyle.ts @@ -1,3 +1,3 @@ export class ListStyle { - translateX: number = 0; + translateX = 0; } diff --git a/src/frontend/src/app/shared/tabs/tab/tab.component.ts b/src/frontend/src/app/shared/tabs/tab/tab.component.ts index 1f3daa072..e9b5a5536 100644 --- a/src/frontend/src/app/shared/tabs/tab/tab.component.ts +++ b/src/frontend/src/app/shared/tabs/tab/tab.component.ts @@ -5,14 +5,12 @@ import { TabDragService } from '../../client/v1/tab-drag.service'; selector: 'wayne-tab', templateUrl: './tab.component.html', styleUrls: ['./tab.component.scss'], - host: { - 'draggable': 'true' - } }) export class TabComponent implements OnInit { descInfo: string; constructor(private el: ElementRef, private dragService: TabDragService) { + el.nativeElement.setAttribute('draggable', 'true'); } @Input() active: boolean; @@ -23,11 +21,13 @@ export class TabComponent implements OnInit { if (value) { this.descInfo = value; } - }; + } @Input() id: number; @Output() orderChange = new EventEmitter(); + + @HostListener('dragstart', ['$event']) startEvent(event) { event.dataTransfer.setData('text/plain', null); diff --git a/src/frontend/src/app/shared/tabs/tabs.component.ts b/src/frontend/src/app/shared/tabs/tabs.component.ts index 686765f6e..d66f4bcef 100644 --- a/src/frontend/src/app/shared/tabs/tabs.component.ts +++ b/src/frontend/src/app/shared/tabs/tabs.component.ts @@ -12,17 +12,17 @@ import { TabDragService } from '../client/v1/tab-drag.service'; }) export class TabsComponent implements AfterViewInit, OnDestroy { // margin 指的是tabs-box-inner的margin值。 - margin: number = 40; + margin = 40; listStyle: ListStyle = new ListStyle(); - showViewPager: boolean = false; + showViewPager = false; tabsContent: Element; tabsList: Element; tabsContentWidth: number; tabsListWidth: number; - firstEnter: boolean = true; + firstEnter = true; resizeTimer: any; - prevDisabled: boolean = true; - nextDisabled: boolean = false; + prevDisabled = true; + nextDisabled = false; dragSubscribe: Array = new Array(); eventList: Array = new Array(); @@ -37,7 +37,8 @@ export class TabsComponent implements AfterViewInit, OnDestroy { direction => { if (direction === 'right') { if (this.listStyle.translateX > (this.tabsContentWidth - this.tabsListWidth)) { - this.listStyle.translateX = this.listStyle.translateX < (this.tabsContentWidth - this.tabsListWidth + 10) ? this.tabsContentWidth - this.tabsListWidth : this.listStyle.translateX - 10; + this.listStyle.translateX = this.listStyle.translateX < (this.tabsContentWidth - this.tabsListWidth + 10) ? + this.tabsContentWidth - this.tabsListWidth : this.listStyle.translateX - 10; } } else if (direction === 'left') { if (this.listStyle.translateX < 0) { @@ -62,9 +63,9 @@ export class TabsComponent implements AfterViewInit, OnDestroy { @ContentChildren(TabComponent) set tabs(tabs: QueryList) { this.addClickEvent(tabs); this.setActive(tabs); - if (!this.firstEnter) this.boxResize(); + if (!this.firstEnter) { this.boxResize(); } this.firstEnter = false; - }; + } prevEnter() { if (this.listStyle.translateX) { @@ -122,7 +123,7 @@ export class TabsComponent implements AfterViewInit, OnDestroy { this.showViewPager = true; this.tabsContentWidth -= 2 * this.margin; } - if (typeof window !== 'undefined') window.onresize = this.boxResize.bind(this); + if (typeof window !== 'undefined') { window.onresize = this.boxResize.bind(this); } this.dragService.init(this.el.nativeElement); this.eventList.push( this.eventManager.addEventListener(this.document.querySelector('.nav-trigger'), 'click', this.boxResize.bind(this, true)) diff --git a/src/frontend/src/app/shared/unauthorized/unauthorized.component.ts b/src/frontend/src/app/shared/unauthorized/unauthorized.component.ts index b51eff82c..a97cd1095 100644 --- a/src/frontend/src/app/shared/unauthorized/unauthorized.component.ts +++ b/src/frontend/src/app/shared/unauthorized/unauthorized.component.ts @@ -25,7 +25,7 @@ export class UnauthorizedComponent implements OnInit, OnDestroy { if (this.leftSeconds <= 0) { // 未授权重定向到登录页面 // document.location.href - let currentUrl = document.location.origin; + const currentUrl = document.location.origin; setTimeout(() => { document.location.href = `${currentUrl}/sign-in`; }, defaultLeftTime); diff --git a/src/frontend/src/app/shared/utils.ts b/src/frontend/src/app/shared/utils.ts index a95bae143..bbf2087e6 100644 --- a/src/frontend/src/app/shared/utils.ts +++ b/src/frontend/src/app/shared/utils.ts @@ -15,14 +15,14 @@ export const isNotEmpty = function (obj: any): boolean { return !isEmpty(obj); }; -export const isArrayEmpty = function (obj: any): boolean { - return !isArrayNotEmpty(obj); -}; - export const isArrayNotEmpty = function (obj: any): boolean { return obj != null && obj.length > 0; }; +export const isArrayEmpty = function (obj: any): boolean { + return !isArrayNotEmpty(obj); +}; + /** * Simple object check. * @param item From 5116ee157e630f3b8daa18037c5ceacf96e251da Mon Sep 17 00:00:00 2001 From: chengyumeng <792400644@qq.com> Date: Fri, 11 Jan 2019 11:49:26 +0800 Subject: [PATCH 002/112] frontend:remove share/switch --- src/frontend/src/app/shared/shared.module.ts | 3 - .../app/shared/switch/switch.component.html | 5 -- .../app/shared/switch/switch.component.scss | 44 ----------- .../src/app/shared/switch/switch.component.ts | 77 ------------------- 4 files changed, 129 deletions(-) delete mode 100644 src/frontend/src/app/shared/switch/switch.component.html delete mode 100644 src/frontend/src/app/shared/switch/switch.component.scss delete mode 100644 src/frontend/src/app/shared/switch/switch.component.ts diff --git a/src/frontend/src/app/shared/shared.module.ts b/src/frontend/src/app/shared/shared.module.ts index a4d152c6d..5dc6dd08a 100644 --- a/src/frontend/src/app/shared/shared.module.ts +++ b/src/frontend/src/app/shared/shared.module.ts @@ -24,7 +24,6 @@ import { AceEditorComponent } from './ace-editor/ace-editor.component'; import { AceEditorBoxComponent } from './ace-editor/ace-editor-box/ace-editor-box.component'; import { AceEditorService } from './ace-editor/ace-editor.service'; import { ModalOperateComponent } from './modal-operate/modal-operate.component'; -import { SwitchComponent } from './switch/switch.component'; import { ProgressComponent } from './progress/progress.component'; import { FloatWindowComponent } from './float-window/float-window.component'; import { FloatWindowItemComponent } from './float-window/float-window-item/float-window-item.component'; @@ -71,7 +70,6 @@ import { ResourceLimitModule } from './component/resource-limit/resource-limit.m PaginateComponent, BreadcrumbComponent, AceEditorComponent, - SwitchComponent, AceEditorBoxComponent, ModalOperateComponent, ProgressComponent, @@ -103,7 +101,6 @@ import { ResourceLimitModule } from './component/resource-limit/resource-limit.m MessageComponent, TabsComponent, TabComponent, - SwitchComponent, BreadcrumbComponent, PaginateComponent, DualListBoxModule, diff --git a/src/frontend/src/app/shared/switch/switch.component.html b/src/frontend/src/app/shared/switch/switch.component.html deleted file mode 100644 index 5127ec30f..000000000 --- a/src/frontend/src/app/shared/switch/switch.component.html +++ /dev/null @@ -1,5 +0,0 @@ - - {{span1Text}} - {{span2Text}} - - \ No newline at end of file diff --git a/src/frontend/src/app/shared/switch/switch.component.scss b/src/frontend/src/app/shared/switch/switch.component.scss deleted file mode 100644 index 35cc8bc3e..000000000 --- a/src/frontend/src/app/shared/switch/switch.component.scss +++ /dev/null @@ -1,44 +0,0 @@ -.swith-box { - display: block; - position: relative; - border: 1px solid #ccc; - border-radius: 4px; - overflow: hidden; - cursor: pointer; - width: 130px; - line-height: normal; -} - -.swith-box button { - position: absolute; - transition: all .3s; - outline: none; - border: none; - background: rgba(0, 0, 0, 0.2); - left: 0; - top: 0; - height: 100%; - width: 50%; - padding: 0; - margin: 0; -} - -.swith-box span { - display: inline-block; - width: 50%; - color: rgb(86, 86, 86); - padding: 5px 0; - white-space: nowrap; - line-height: 1; - user-select: none; - text-align: center; -} - -.invisible { - visibility: hidden; -} - -.switch-active { - color: #000 !important; - font-weight: 800; -} diff --git a/src/frontend/src/app/shared/switch/switch.component.ts b/src/frontend/src/app/shared/switch/switch.component.ts deleted file mode 100644 index 11a04b034..000000000 --- a/src/frontend/src/app/shared/switch/switch.component.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Component, ElementRef, EventEmitter, forwardRef, Input, OnInit, Output, Renderer2, ViewChild } from '@angular/core'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; - -@Component({ - selector: 'wayne-switch', - templateUrl: './switch.component.html', - styleUrls: ['./switch.component.scss'], - providers: [{ - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => SwitchComponent), - multi: true - }] -}) -/** - * - */ -export class SwitchComponent implements OnInit, ControlValueAccessor { - choosed: any; - @Input('key1') span1Text: string; - @Input('key2') span2Text: string; - @Input('value1') span1Value: any; - @Input('value2') span2Value: any; - // model -> view function - @ViewChild('span1') span1: ElementRef; - @ViewChild('span2') span2: ElementRef; - @ViewChild('button') button: ElementRef; - @Output() change = new EventEmitter(); - - get span1Width(): string { - return this.span1.nativeElement.clientWidth; - } - - get buttonWidth(): string { - if (this.choosed === this.span1Value) { - this._render.setStyle(this.button.nativeElement, 'left', `0px`); - return this.span1Width + 'px'; - } else if (this.choosed === this.span2Value) { - this._render.setStyle(this.button.nativeElement, 'left', `${this.span1Width}px`); - return this.span2Width + 'px'; - } else { - return 0 + 'px'; - } - } - - get span2Width(): string { - return this.span2.nativeElement.clientWidth; - } - - updateEmit = (_: any) => { - }; - - constructor(private _render: Renderer2) { - } - - ngOnInit() { - } - - changeItem() { - this.choosed = this.choosed === this.span1Value ? this.span2Value : this.span1Value; - this.updateEmit(this.choosed); - this.change.emit(this.choosed); - } - - writeValue(value: any): void { - if (value !== this.choosed) { - this.choosed = value; - } - } - - registerOnChange(fn: (_: any) => {}): void { - this.updateEmit = fn; - } - - // this is invalid so given an empty result - registerOnTouched(fn: any): void { - } -} From 6168734d3a2e726035c717f8a2e632333143b02b Mon Sep 17 00:00:00 2001 From: chengyumeng <792400644@qq.com> Date: Fri, 11 Jan 2019 16:06:58 +0800 Subject: [PATCH 003/112] frontend:update let to const --- .../src/app/admin/admin.component.spec.ts | 4 +- .../create-edit-apikey.component.html | 2 +- .../create-edit-apikey.component.ts | 6 +- .../list-apikey/list-apikey.component.html | 2 +- .../list-apikey/list-apikey.component.ts | 6 +- .../src/app/admin/app/app.component.ts | 6 +- .../create-edit-app.component.html | 2 +- .../create-edit-app.component.ts | 8 +-- .../admin/app/list-app/list-app.component.ts | 2 +- .../app/trash-app/trash-app.component.ts | 8 +-- .../app/admin/auditlog/auditlog.component.ts | 4 +- .../list-cluster/list-cluster.component.ts | 2 +- .../trash-cluster/trash-cluster.component.ts | 8 +-- .../src/app/admin/config/config.component.ts | 4 +- .../create-edit-config.component.ts | 4 +- .../list-config/list-config.component.ts | 2 +- .../admin/configmap/configmap.component.ts | 6 +- .../create-edit-configmap.component.html | 2 +- .../create-edit-configmap.component.ts | 8 +-- .../list-configmap.component.ts | 2 +- .../trash-configmap.component.ts | 8 +-- .../configmaptpl/configmaptpl.component.ts | 8 +-- .../create-edit-configmaptpl.component.html | 2 +- .../create-edit-configmaptpl.component.ts | 8 +-- .../list-configmaptpl.component.ts | 2 +- .../trash-configmaptpl.component.ts | 8 +-- .../create-edit-cronjob.component.html | 2 +- .../create-edit-cronjob.component.ts | 8 +-- .../app/admin/cronjob/cronjob.component.ts | 8 +-- .../list-cronjob/list-cronjob.component.ts | 2 +- .../trash-cronjob/trash-cronjob.component.ts | 8 +-- .../create-edit-cronjobtpl.component.html | 2 +- .../create-edit-cronjobtpl.component.ts | 8 +-- .../admin/cronjobtpl/cronjobtpl.component.ts | 8 +-- .../list-cronjobtpl.component.ts | 2 +- .../trash-cronjobtpl.component.ts | 8 +-- .../create-edit-daemonset.component.html | 2 +- .../create-edit-daemonset.component.ts | 8 +-- .../admin/daemonset/daemonset.component.ts | 6 +- .../list-daemonset.component.ts | 2 +- .../trash-daemonset.component.ts | 8 +-- .../create-edit-daemonsettpl.component.html | 2 +- .../create-edit-daemonsettpl.component.ts | 6 +- .../daemonsettpl/daemonsettpl.component.ts | 8 +-- .../list-daemonsettpl.component.ts | 2 +- .../trash-daemonsettpl.component.ts | 8 +-- .../create-edit-deployment.component.html | 2 +- .../create-edit-deployment.component.ts | 8 +-- .../deployment/deployment.component.spec.ts | 4 +- .../admin/deployment/deployment.component.ts | 8 +-- .../list-deployment.component.ts | 4 +- .../trash-deployment.component.ts | 8 +-- .../create-edit-deploymenttpl.component.html | 2 +- .../create-edit-deploymenttpl.component.ts | 6 +- .../deploymenttpl/deploymenttpl.component.ts | 8 +-- .../list-deploymenttpl.component.ts | 2 +- .../trash-deploymenttpl.component.ts | 8 +-- .../create-edit-group.component.html | 2 +- .../create-edit-group.component.ts | 14 ++-- .../app/admin/group/group.component.spec.ts | 4 +- .../src/app/admin/group/group.component.ts | 2 +- .../group/list-group/list-group.component.ts | 2 +- .../create-edit-ingress.component.html | 2 +- .../app/admin/ingress/ingress.component.ts | 2 +- .../create-edit-ingresstpl.component.html | 2 +- .../create-edit-ingresstpl.component.ts | 2 +- .../admin/ingresstpl/ingresstpl.component.ts | 4 +- .../kubernetes/node/list-nodes/inventory.ts | 4 +- .../node/list-nodes/list-nodes.component.ts | 6 +- .../create-edit-persistentvolume.component.ts | 2 +- .../persistentvolume.component.ts | 2 +- .../create-edit-namespace.component.ts | 4 +- .../list-namespace.component.ts | 2 +- .../namespace/namespace.component.spec.ts | 4 +- .../admin/namespace/namespace.component.ts | 6 +- .../trash-namespace.component.ts | 6 +- .../src/app/admin/nav/nav.component.spec.ts | 4 +- .../create-notification.component.spec.ts | 4 +- .../list-notification.component.spec.ts | 4 +- .../list-notification.component.ts | 2 +- .../notification.component.spec.ts | 4 +- .../notification/notification.component.ts | 2 +- .../notification/notification.module.spec.ts | 2 +- .../create-edit-permission.component.ts | 8 +-- .../list-permission.component.ts | 2 +- .../permission/permission.component.spec.ts | 4 +- .../admin/permission/permission.component.ts | 2 +- ...-edit-persistentvolumeclaim.component.html | 2 +- ...te-edit-persistentvolumeclaim.component.ts | 8 +-- .../list-persistentvolumeclaim.component.ts | 2 +- .../persistentvolumeclaim.component.ts | 8 +-- .../trash-persistentvolumeclaim.component.ts | 8 +-- ...it-persistentvolumeclaimtpl.component.html | 2 +- ...edit-persistentvolumeclaimtpl.component.ts | 8 +-- ...list-persistentvolumeclaimtpl.component.ts | 2 +- .../persistentvolumeclaimtpl.component.ts | 8 +-- ...rash-persistentvolumeclaimtpl.component.ts | 8 +-- .../create-edit-secret.component.html | 2 +- .../create-edit-secret.component.ts | 8 +-- .../list-secret/list-secret.component.ts | 2 +- .../app/admin/secret/secret.component.spec.ts | 4 +- .../src/app/admin/secret/secret.component.ts | 6 +- .../trash-secret/trash-secret.component.ts | 6 +- .../create-edit-secrettpl.component.html | 2 +- .../create-edit-secrettpl.component.ts | 10 +-- .../list-secrettpl.component.ts | 2 +- .../admin/secrettpl/secrettpl.component.ts | 6 +- .../trash-secrettpl.component.ts | 6 +- .../create-edit-statefulset.component.html | 2 +- .../create-edit-statefulset.component.ts | 8 +-- .../list-statefulset.component.ts | 2 +- .../statefulset/statefulset.component.ts | 6 +- .../trash-statefulset.component.ts | 8 +-- .../create-edit-statefulsettpl.component.html | 2 +- .../create-edit-statefulsettpl.component.ts | 6 +- .../list-statefulsettpl.component.ts | 2 +- .../statefulsettpl.component.ts | 8 +-- .../trash-statefulsettpl.component.ts | 8 +-- .../create-edit-user.component.ts | 14 ++-- .../user/list-user/list-user.component.ts | 2 +- .../reset-password.component.ts | 8 +-- .../src/app/admin/user/user.component.spec.ts | 4 +- .../src/app/admin/user/user.component.ts | 2 +- src/frontend/src/app/app.module.ts | 2 +- .../app/portal/app-apikey/apikey.component.ts | 8 +-- .../create-edit-apikey.component.ts | 6 +- .../list-apikey/list-apikey.component.html | 2 +- .../list-apikey/list-apikey.component.ts | 2 +- .../app/portal/app-user/app-user.component.ts | 8 +-- .../create-edit-app-user.component.ts | 12 ++-- .../list-app-user/list-app-user.component.ts | 2 +- .../app-webhook/app-webhook.component.ts | 8 +-- .../create-edit-app-webhook.component.ts | 4 +- .../list-app-webhook.component.ts | 2 +- .../create-edit-app.component.ts | 10 +-- .../app/detail-app/detail-app.component.ts | 10 +-- .../list-cluster/list-cluster.component.ts | 2 +- .../autoscale/autoscale.component.spec.ts | 4 +- .../create-edit-autoscale.component.spec.ts | 4 +- ...create-edit-autoscaletpl.component.spec.ts | 4 +- .../list-autoscale.component.spec.ts | 4 +- .../publish-tpl/publish-tpl.component.spec.ts | 4 +- .../autoscale/status/status.component.spec.ts | 4 +- .../src/app/portal/base/base.component.ts | 12 ++-- .../publish-history.service.ts | 2 +- .../portal/configmap/configmap.component.ts | 46 ++++++------- .../create-edit-configmap.component.ts | 8 +-- .../list-configmap.component.html | 4 +- .../list-configmap.component.ts | 6 +- .../publish-tpl/publish-tpl.component.ts | 24 +++---- .../create-edit-cronjob.component.ts | 24 +++---- .../app/portal/cronjob/cronjob.component.ts | 58 ++++++++-------- .../list-cronjob/list-cronjob.component.html | 4 +- .../list-cronjob/list-cronjob.component.ts | 8 +-- .../list-event/list-event.component.ts | 6 +- .../cronjob/list-job/list-job.component.ts | 2 +- .../cronjob/list-pod/list-pod.component.ts | 18 ++--- .../publish-tpl/publish-tpl.component.ts | 18 ++--- .../create-edit-daemonset.component.ts | 18 ++--- .../portal/daemonset/daemonset.component.ts | 56 ++++++++-------- .../list-daemonset.component.ts | 10 +-- .../list-event/list-event.component.ts | 6 +- .../daemonset/list-pod/list-pod.component.ts | 26 +++---- .../publish-tpl/publish-tpl.component.ts | 20 +++--- .../create-edit-deploymenttpl.component.html | 2 +- .../portal/deployment/deployment.component.ts | 67 ++++++++++--------- .../list-deployment.component.ts | 12 ++-- .../list-event/list-event.component.ts | 6 +- .../deployment/list-pod/list-pod.component.ts | 30 ++++----- .../publish-tpl/publish-tpl.component.ts | 40 +++++------ .../namespace-apikey/apikey.component.ts | 8 +-- .../create-edit-apikey.component.ts | 6 +- .../list-apikey/list-apikey.component.html | 2 +- .../list-apikey/list-apikey.component.ts | 2 +- .../history/history.component.ts | 4 +- .../namespace-report.component.ts | 2 +- .../resource/resource.component.ts | 16 +++-- .../create-edit-namespace-user.component.ts | 12 ++-- .../list-namespace-user.component.ts | 2 +- .../namespace-user.component.ts | 8 +-- ...create-edit-namespace-webhook.component.ts | 4 +- .../list-namespace-webhook.component.ts | 2 +- .../namespace-webhook.component.ts | 8 +-- .../src/app/portal/nav/nav.component.ts | 8 +-- ...te-edit-persistentvolumeclaim.component.ts | 8 +-- .../list-persistentvolumeclaim.component.html | 6 +- .../list-persistentvolumeclaim.component.ts | 2 +- .../persistentvolumeclaim.component.ts | 28 ++++---- .../publish-tpl/publish-tpl.component.ts | 24 +++---- ...napshot-persistentvolumeclaim.component.ts | 12 ++-- .../pod-logging/pod-logging.component.ts | 28 ++++---- .../pod-terminal/pod-terminal.component.ts | 36 +++++----- .../src/app/portal/portal.component.spec.ts | 4 +- .../src/app/portal/portal.component.ts | 2 +- .../create-edit-secret.component.ts | 8 +-- .../list-secret/list-secret.component.html | 4 +- .../publish-tpl/publish-tpl.component.ts | 24 +++---- .../src/app/portal/secret/secret.component.ts | 44 ++++++------ .../portal/sidenav/sidenav.component.spec.ts | 4 +- .../create-edit-statefulset.component.ts | 38 +++++------ .../list-event/list-event.component.ts | 6 +- .../list-pod/list-pod.component.ts | 26 +++---- .../list-statefulset.component.ts | 10 +-- .../publish-tpl/publish-tpl.component.ts | 36 +++++----- .../statefulset/statefulset.component.ts | 59 ++++++++-------- .../ace-editor-box.component.ts | 36 +++++----- .../shared/ace-editor/ace-editor.component.ts | 4 +- .../src/app/shared/ace-editor/ace-editor.ts | 2 +- .../src/app/shared/ace-editor/modalInfo.ts | 2 +- .../auth-module/sign-in/sign-in.component.ts | 16 ++--- .../auth/admin-auth-check-guard.service.ts | 4 +- .../shared/auth/auth-check-guard.service.ts | 18 ++--- .../src/app/shared/auth/cache.service.ts | 4 +- .../resource/create-edit-resource-template.ts | 2 +- .../shared/base/resource/publish-template.ts | 2 +- .../breadcrumb/breadcrumb.component.spec.ts | 4 +- .../app/shared/checkbox/checkbox.component.ts | 2 +- .../app/shared/client/v1/apikey.service.ts | 10 +-- .../app/shared/client/v1/app-user.service.ts | 12 ++-- .../src/app/shared/client/v1/app.service.ts | 12 ++-- .../app/shared/client/v1/auditlog.service.ts | 8 +-- .../app/shared/client/v1/autoscale.service.ts | 2 +- .../client/v1/available-port.service.ts | 8 +-- .../shared/client/v1/breadcrumb.service.ts | 4 +- .../app/shared/client/v1/cluster.service.ts | 10 +-- .../app/shared/client/v1/config.service.ts | 10 +-- .../app/shared/client/v1/configmap.service.ts | 10 +-- .../shared/client/v1/configmaptpl.service.ts | 10 +-- .../app/shared/client/v1/cronjob.service.ts | 10 +-- .../shared/client/v1/cronjobtpl.service.ts | 10 +-- .../app/shared/client/v1/daemonset.service.ts | 10 +-- .../shared/client/v1/daemonsettpl.service.ts | 10 +-- .../shared/client/v1/deployment.service.ts | 10 +-- .../shared/client/v1/deploymenttpl.service.ts | 10 +-- .../app/shared/client/v1/edge-node.service.ts | 8 +-- .../src/app/shared/client/v1/group.service.ts | 10 +-- .../app/shared/client/v1/ingress.service.ts | 4 +- .../app/shared/client/v1/kubernetes/common.ts | 2 +- .../shared/client/v1/kubernetes/deployment.ts | 2 +- .../shared/client/v1/kubernetes/namespace.ts | 2 +- .../client/v1/namespace-user.service.ts | 10 +-- .../app/shared/client/v1/namespace.service.ts | 10 +-- .../shared/client/v1/permission.service.ts | 10 +-- .../v1/persistentvolumeclaim.service.ts | 10 +-- .../v1/persistentvolumeclaimtpl.service.ts | 18 ++--- .../app/shared/client/v1/public.service.ts | 4 +- .../app/shared/client/v1/publish.service.ts | 8 +-- .../app/shared/client/v1/secret.service.ts | 10 +-- .../app/shared/client/v1/secrettpl.service.ts | 10 +-- .../shared/client/v1/select-copy.service.ts | 8 +-- .../shared/client/v1/statefulset.service.ts | 10 +-- .../client/v1/statefulsettpl.service.ts | 10 +-- .../app/shared/client/v1/storage.service.ts | 2 +- .../app/shared/client/v1/tab-drag.service.ts | 38 ++++++----- .../src/app/shared/client/v1/tip.directive.ts | 6 +- .../src/app/shared/client/v1/tip.service.ts | 12 ++-- .../app/shared/client/v1/used-port.service.ts | 12 ++-- .../src/app/shared/client/v1/user.service.ts | 10 +-- .../app/shared/client/v1/webhook.service.ts | 20 +++--- .../confirmation-dialog.component.ts | 10 +-- .../shared/dropdown/dropdown.component.html | 2 +- .../app/shared/dropdown/dropdown.component.ts | 21 ++++-- .../dual-list-box/dual-list-box.component.ts | 10 +-- .../float-window-item.component.ts | 6 +- .../float-window/float-window.component.ts | 4 +- .../shared/footer/footer.component.spec.ts | 4 +- .../global-message/message.component.ts | 4 +- .../src/app/shared/global-message/message.ts | 2 +- .../src/app/shared/input/input.component.ts | 6 +- .../shared/interceptor/auth-interceptor.ts | 4 +- .../message-handler.service.ts | 4 +- .../modal-operate.component.spec.ts | 4 +- .../src/app/shared/model/v1/cronjobtpl.ts | 2 +- .../src/app/shared/model/v1/deploymenttpl.ts | 2 +- .../app/shared/model/v1/kubernetes/node.ts | 6 +- .../shared/model/v1/kubernetes/statefulset.ts | 26 +++++-- .../paginate/paginate.component.spec.ts | 4 +- .../src/app/shared/select/select.component.ts | 4 +- src/frontend/src/app/shared/utils.ts | 2 +- 279 files changed, 1193 insertions(+), 1154 deletions(-) diff --git a/src/frontend/src/app/admin/admin.component.spec.ts b/src/frontend/src/app/admin/admin.component.spec.ts index 40e571315..94533453e 100644 --- a/src/frontend/src/app/admin/admin.component.spec.ts +++ b/src/frontend/src/app/admin/admin.component.spec.ts @@ -3,8 +3,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { AdminComponent } from './admin.component'; describe('AdminComponent', () => { - let component: AdminComponent; - let fixture: ComponentFixture; + const component: AdminComponent; + const fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ diff --git a/src/frontend/src/app/admin/apikey/create-edit-apikey/create-edit-apikey.component.html b/src/frontend/src/app/admin/apikey/create-edit-apikey/create-edit-apikey.component.html index c5a4fbe0e..ab695f307 100644 --- a/src/frontend/src/app/admin/apikey/create-edit-apikey/create-edit-apikey.component.html +++ b/src/frontend/src/app/admin/apikey/create-edit-apikey/create-edit-apikey.component.html @@ -26,7 +26,7 @@
diff --git a/src/frontend/src/app/admin/apikey/create-edit-apikey/create-edit-apikey.component.ts b/src/frontend/src/app/admin/apikey/create-edit-apikey/create-edit-apikey.component.ts index a3ea78757..aceb38b04 100644 --- a/src/frontend/src/app/admin/apikey/create-edit-apikey/create-edit-apikey.component.ts +++ b/src/frontend/src/app/admin/apikey/create-edit-apikey/create-edit-apikey.component.ts @@ -24,8 +24,8 @@ export class CreateEditApiKeyComponent implements OnInit { currentForm: NgForm; apiKey = new ApiKey(); - checkOnGoing: boolean = false; - isSubmitOnGoing: boolean = false; + checkOnGoing = false; + isSubmitOnGoing = false; groups = Array(); title: string; actionType: ActionType; @@ -40,7 +40,7 @@ export class CreateEditApiKeyComponent implements OnInit { this.apiKeyTypes = ApiKeyType; this.groupService.listGroup(new PageState({pageSize: 1000}), 2).subscribe( response => { - let data = response.data; + const data = response.data; this.groups = data.list; }, error => { diff --git a/src/frontend/src/app/admin/apikey/list-apikey/list-apikey.component.html b/src/frontend/src/app/admin/apikey/list-apikey/list-apikey.component.html index 255789e6f..0472062e1 100644 --- a/src/frontend/src/app/admin/apikey/list-apikey/list-apikey.component.html +++ b/src/frontend/src/app/admin/apikey/list-apikey/list-apikey.component.html @@ -43,7 +43,7 @@ {{apiKey.deleted ? "否" : "是"}} {{apiKey.resourceId}} {{apiKey.createTime | date:'yyyy-MM-dd HH:mm:ss'}} - {{apiKey.expireIn == 0 ? "永久有效" : apiKey.expireIn}} + {{apiKey.expireIn === 0 ? "永久有效" : apiKey.expireIn}} {{apiKey.user}} {{apiKey.description}} diff --git a/src/frontend/src/app/admin/apikey/list-apikey/list-apikey.component.ts b/src/frontend/src/app/admin/apikey/list-apikey/list-apikey.component.ts index c2f9a108e..834de0c71 100644 --- a/src/frontend/src/app/admin/apikey/list-apikey/list-apikey.component.ts +++ b/src/frontend/src/app/admin/apikey/list-apikey/list-apikey.component.ts @@ -16,7 +16,7 @@ export class ListApiKeyComponent implements OnInit { @Input() apiKeys: ApiKey[]; @Input() page: Page; - currentPage: number = 1; + currentPage = 1; state: State; @Output() paginate = new EventEmitter(); @@ -32,8 +32,8 @@ export class ListApiKeyComponent implements OnInit { } getApiKeyType(apiKey: ApiKey) { - for (let type of ApiKeyType) { - if (type.id == apiKey.type) { + for (const type of ApiKeyType) { + if (type.id === apiKey.type) { return type.name; } } diff --git a/src/frontend/src/app/admin/app/app.component.ts b/src/frontend/src/app/admin/app/app.component.ts index 6e31d4398..43b8f9928 100644 --- a/src/frontend/src/app/admin/app/app.component.ts +++ b/src/frontend/src/app/admin/app/app.component.ts @@ -41,7 +41,7 @@ export class AppComponent implements OnInit { if (message && message.state === ConfirmationState.CONFIRMED && message.source === ConfirmationTargets.APP) { - let appId = message.data; + const appId = message.data; this.appService.deleteById(appId, 0) .subscribe( response => { @@ -83,7 +83,7 @@ export class AppComponent implements OnInit { this.appService.listPage(this.pageState, this.namespaceId) .subscribe( response => { - let data = response.data; + const data = response.data; this.pageState.page.totalPage = data.totalPage; this.pageState.page.totalCount = data.totalCount; this.changedApps = data.list; @@ -103,7 +103,7 @@ export class AppComponent implements OnInit { } deleteApp(app: App) { - let deletionMessage = new ConfirmationMessage( + const deletionMessage = new ConfirmationMessage( '删除项目确认', '你确认删除项目 ' + app.name + ' ?', app.id, diff --git a/src/frontend/src/app/admin/app/create-edit-app/create-edit-app.component.html b/src/frontend/src/app/admin/app/create-edit-app/create-edit-app.component.html index a879d82b9..6a6b5dbbe 100644 --- a/src/frontend/src/app/admin/app/create-edit-app/create-edit-app.component.html +++ b/src/frontend/src/app/admin/app/create-edit-app/create-edit-app.component.html @@ -9,7 +9,7 @@
diff --git a/src/frontend/src/app/admin/app/create-edit-app/create-edit-app.component.ts b/src/frontend/src/app/admin/app/create-edit-app/create-edit-app.component.ts index 8aa8406a4..7c5394899 100644 --- a/src/frontend/src/app/admin/app/create-edit-app/create-edit-app.component.ts +++ b/src/frontend/src/app/admin/app/create-edit-app/create-edit-app.component.ts @@ -31,9 +31,9 @@ export class CreateEditAppComponent { componentName = '项目'; app: App = new App(); namespaces: Namespace[]; - checkOnGoing: boolean = false; - isSubmitOnGoing: boolean = false; - isNameValid: boolean = true; + checkOnGoing = false; + isSubmitOnGoing = false; + isNameValid = true; appTitle: string; actionType: ActionType; @@ -137,7 +137,7 @@ export class CreateEditAppComponent { } handleValidation(): void { - let cont = this.currentForm.controls['app_name']; + const cont = this.currentForm.controls['app_name']; if (cont) { this.isNameValid = cont.valid; } diff --git a/src/frontend/src/app/admin/app/list-app/list-app.component.ts b/src/frontend/src/app/admin/app/list-app/list-app.component.ts index ea70ed5b4..cb7668c4a 100644 --- a/src/frontend/src/app/admin/app/list-app/list-app.component.ts +++ b/src/frontend/src/app/admin/app/list-app/list-app.component.ts @@ -16,7 +16,7 @@ export class ListAppComponent implements OnInit { @Input() apps: App[]; @Input() idFilterInit: string; @Input() page: Page; - currentPage: number = 1; + currentPage = 1; state: State; @Output() paginate = new EventEmitter(); diff --git a/src/frontend/src/app/admin/app/trash-app/trash-app.component.ts b/src/frontend/src/app/admin/app/trash-app/trash-app.component.ts index 89f9329a0..744889c5e 100644 --- a/src/frontend/src/app/admin/app/trash-app/trash-app.component.ts +++ b/src/frontend/src/app/admin/app/trash-app/trash-app.component.ts @@ -18,7 +18,7 @@ import { AceEditorMsg } from '../../../shared/ace-editor/ace-editor'; export class TrashAppComponent implements OnInit, OnDestroy { apps: App[]; - currentPage: number = 1; + currentPage = 1; state: State; pageState: PageState = new PageState(); @@ -33,7 +33,7 @@ export class TrashAppComponent implements OnInit, OnDestroy { if (message && message.state === ConfirmationState.CONFIRMED && message.source === ConfirmationTargets.TRASH_APP) { - let appId = message.data; + const appId = message.data; this.appService.deleteById(appId, 0, false) .subscribe( response => { @@ -74,7 +74,7 @@ export class TrashAppComponent implements OnInit, OnDestroy { .listPage(this.pageState) .subscribe( response => { - let data = response.data; + const data = response.data; this.pageState.page.totalPage = data.totalPage; this.pageState.page.totalCount = data.totalCount; this.apps = data.list; @@ -84,7 +84,7 @@ export class TrashAppComponent implements OnInit, OnDestroy { } deleteApp(app: App) { - let deletionMessage = new ConfirmationMessage( + const deletionMessage = new ConfirmationMessage( '删除项目确认', '你确认永久删除项目 ' + app.name + ' ?删除后将不可恢复!', app.id, diff --git a/src/frontend/src/app/admin/auditlog/auditlog.component.ts b/src/frontend/src/app/admin/auditlog/auditlog.component.ts index 462dc8990..2a9a2e39b 100644 --- a/src/frontend/src/app/admin/auditlog/auditlog.component.ts +++ b/src/frontend/src/app/admin/auditlog/auditlog.component.ts @@ -12,7 +12,7 @@ import { MessageHandlerService } from '../../shared/message-handler/message-hand export class AuditLogComponent implements OnInit { pageState: PageState = new PageState(); auditLogs: AuditLog[]; - currentPage: number = 1; + currentPage = 1; state: State; constructor(private auditLogService: AuditLogService, @@ -50,7 +50,7 @@ export class AuditLogComponent implements OnInit { this.auditLogService.listPage(this.pageState) .subscribe( response => { - let data = response.data; + const data = response.data; this.pageState.page.totalPage = data.totalPage; this.pageState.page.totalCount = data.totalCount; this.auditLogs = data.list; diff --git a/src/frontend/src/app/admin/cluster/list-cluster/list-cluster.component.ts b/src/frontend/src/app/admin/cluster/list-cluster/list-cluster.component.ts index 8c2f2938e..06a18894a 100644 --- a/src/frontend/src/app/admin/cluster/list-cluster/list-cluster.component.ts +++ b/src/frontend/src/app/admin/cluster/list-cluster/list-cluster.component.ts @@ -16,7 +16,7 @@ export class ListClusterComponent implements OnInit { @Input() clusters: Cluster[]; @Input() page: Page; - currentPage: number = 1; + currentPage = 1; state: State; @Output() paginate = new EventEmitter(); diff --git a/src/frontend/src/app/admin/cluster/trash-cluster/trash-cluster.component.ts b/src/frontend/src/app/admin/cluster/trash-cluster/trash-cluster.component.ts index 4a1692546..7445e42e4 100644 --- a/src/frontend/src/app/admin/cluster/trash-cluster/trash-cluster.component.ts +++ b/src/frontend/src/app/admin/cluster/trash-cluster/trash-cluster.component.ts @@ -17,7 +17,7 @@ export class TrashClusterComponent implements OnInit, OnDestroy { clusters: Cluster[]; pageState: PageState = new PageState(); - currentPage: number = 1; + currentPage = 1; state: State; subscription: Subscription; @@ -29,7 +29,7 @@ export class TrashClusterComponent implements OnInit, OnDestroy { if (message && message.state === ConfirmationState.CONFIRMED && message.source === ConfirmationTargets.TRASH_CLUSTER) { - let name = message.data; + const name = message.data; this.clusterService .deleteByName(name, false) .subscribe( @@ -69,7 +69,7 @@ export class TrashClusterComponent implements OnInit, OnDestroy { this.clusterService.list(this.pageState, 'true') .subscribe( response => { - let data = response.data; + const data = response.data; this.pageState.page.totalPage = data.totalPage; this.pageState.page.totalCount = data.totalCount; this.clusters = data.list; @@ -79,7 +79,7 @@ export class TrashClusterComponent implements OnInit, OnDestroy { } deleteCluster(cluster: Cluster) { - let deletionMessage = new ConfirmationMessage( + const deletionMessage = new ConfirmationMessage( '删除集群确认', '你确认永久删除集群 ' + cluster.name + ' ?删除后将不可恢复!', cluster.name, diff --git a/src/frontend/src/app/admin/config/config.component.ts b/src/frontend/src/app/admin/config/config.component.ts index 643a0fc8e..057b3578e 100644 --- a/src/frontend/src/app/admin/config/config.component.ts +++ b/src/frontend/src/app/admin/config/config.component.ts @@ -68,7 +68,7 @@ export class ConfigComponent implements OnInit { this.configService.list(this.pageState) .subscribe( response => { - let data = response.data; + const data = response.data; this.pageState.page.totalPage = data.totalPage; this.pageState.page.totalCount = data.totalCount; this.configs = data.list; @@ -88,7 +88,7 @@ export class ConfigComponent implements OnInit { } deleteConfig(config: Config) { - let deletionMessage = new ConfirmationMessage( + const deletionMessage = new ConfirmationMessage( '删除配置确认', '你确认删除配置 ' + config.name + ' ?', config.id, diff --git a/src/frontend/src/app/admin/config/create-edit-config/create-edit-config.component.ts b/src/frontend/src/app/admin/config/create-edit-config/create-edit-config.component.ts index 27e060358..45b90705f 100644 --- a/src/frontend/src/app/admin/config/create-edit-config/create-edit-config.component.ts +++ b/src/frontend/src/app/admin/config/create-edit-config/create-edit-config.component.ts @@ -22,8 +22,8 @@ export class CreateEditConfigComponent { currentForm: NgForm; config: Config = new Config(); - checkOnGoing: boolean = false; - isSubmitOnGoing: boolean = false; + checkOnGoing = false; + isSubmitOnGoing = false; title: string; actionType: ActionType; diff --git a/src/frontend/src/app/admin/config/list-config/list-config.component.ts b/src/frontend/src/app/admin/config/list-config/list-config.component.ts index 079a87640..c40708be4 100644 --- a/src/frontend/src/app/admin/config/list-config/list-config.component.ts +++ b/src/frontend/src/app/admin/config/list-config/list-config.component.ts @@ -12,7 +12,7 @@ export class ListConfigComponent implements OnInit { @Input() configs: Config[]; @Input() page: Page; - currentPage: number = 1; + currentPage = 1; state: State; @Output() paginate = new EventEmitter(); diff --git a/src/frontend/src/app/admin/configmap/configmap.component.ts b/src/frontend/src/app/admin/configmap/configmap.component.ts index 98b70f65a..274a3b7b1 100644 --- a/src/frontend/src/app/admin/configmap/configmap.component.ts +++ b/src/frontend/src/app/admin/configmap/configmap.component.ts @@ -37,7 +37,7 @@ export class ConfigMapComponent implements OnInit { if (message && message.state === ConfirmationState.CONFIRMED && message.source === ConfirmationTargets.CONFIGMAP) { - let id = message.data; + const id = message.data; this.configMapService.deleteById(id, 0) .subscribe( response => { @@ -68,7 +68,7 @@ export class ConfigMapComponent implements OnInit { this.configMapService.list(this.pageState, 'false', '0') .subscribe( response => { - let data = response.data; + const data = response.data; this.pageState.page.totalPage = data.totalPage; this.pageState.page.totalCount = data.totalCount; this.configMaps = data.list; @@ -88,7 +88,7 @@ export class ConfigMapComponent implements OnInit { } deleteConfigMap(configMap: ConfigMap) { - let deletionMessage = new ConfirmationMessage( + const deletionMessage = new ConfirmationMessage( '删除配置集确认', '你确认删除配置集 ' + configMap.name + ' ?', configMap.id, diff --git a/src/frontend/src/app/admin/configmap/create-edit-configmap/create-edit-configmap.component.html b/src/frontend/src/app/admin/configmap/create-edit-configmap/create-edit-configmap.component.html index dddd4b573..a642f3ad0 100644 --- a/src/frontend/src/app/admin/configmap/create-edit-configmap/create-edit-configmap.component.html +++ b/src/frontend/src/app/admin/configmap/create-edit-configmap/create-edit-configmap.component.html @@ -8,7 +8,7 @@
diff --git a/src/frontend/src/app/admin/configmap/create-edit-configmap/create-edit-configmap.component.ts b/src/frontend/src/app/admin/configmap/create-edit-configmap/create-edit-configmap.component.ts index e96242900..e53923826 100644 --- a/src/frontend/src/app/admin/configmap/create-edit-configmap/create-edit-configmap.component.ts +++ b/src/frontend/src/app/admin/configmap/create-edit-configmap/create-edit-configmap.component.ts @@ -30,9 +30,9 @@ export class CreateEditConfigMapComponent implements OnInit { aceBox: any; configMap: ConfigMap = new ConfigMap(); - checkOnGoing: boolean = false; - isSubmitOnGoing: boolean = false; - isNameValid: boolean = true; + checkOnGoing = false; + isSubmitOnGoing = false; + isNameValid = true; title: string; actionType: ActionType; @@ -139,7 +139,7 @@ export class CreateEditConfigMapComponent implements OnInit { //Handle the form validation handleValidation(): void { - let cont = this.currentForm.controls['name']; + const cont = this.currentForm.controls['name']; if (cont) { this.isNameValid = cont.valid; } diff --git a/src/frontend/src/app/admin/configmap/list-configmap/list-configmap.component.ts b/src/frontend/src/app/admin/configmap/list-configmap/list-configmap.component.ts index 7c857848c..599935b82 100644 --- a/src/frontend/src/app/admin/configmap/list-configmap/list-configmap.component.ts +++ b/src/frontend/src/app/admin/configmap/list-configmap/list-configmap.component.ts @@ -17,7 +17,7 @@ export class ListConfigMapComponent implements OnInit { @Input() page: Page; state: State; - currentPage: number = 1; + currentPage = 1; @Output() paginate = new EventEmitter(); @Output() delete = new EventEmitter(); diff --git a/src/frontend/src/app/admin/configmap/trash-configmap/trash-configmap.component.ts b/src/frontend/src/app/admin/configmap/trash-configmap/trash-configmap.component.ts index 61bc33d89..a7fab4712 100644 --- a/src/frontend/src/app/admin/configmap/trash-configmap/trash-configmap.component.ts +++ b/src/frontend/src/app/admin/configmap/trash-configmap/trash-configmap.component.ts @@ -19,7 +19,7 @@ export class TrashConfigMapComponent implements OnInit, OnDestroy { configMaps: ConfigMap[]; pageState: PageState = new PageState(); state: State; - currentPage: number = 1; + currentPage = 1; subscription: Subscription; @@ -33,7 +33,7 @@ export class TrashConfigMapComponent implements OnInit, OnDestroy { if (message && message.state === ConfirmationState.CONFIRMED && message.source === ConfirmationTargets.TRASH_CONFIGMAP) { - let configMap = message.data; + const configMap = message.data; this.configMapService.deleteById(configMap.id, 0, false) .subscribe( response => { @@ -72,7 +72,7 @@ export class TrashConfigMapComponent implements OnInit, OnDestroy { this.configMapService.list(this.pageState, 'true') .subscribe( response => { - let data = response.data; + const data = response.data; this.pageState.page.totalPage = data.totalPage; this.pageState.page.totalCount = data.totalCount; this.configMaps = data.list; @@ -82,7 +82,7 @@ export class TrashConfigMapComponent implements OnInit, OnDestroy { } deleteConfigMap(configMap: ConfigMap) { - let deletionMessage = new ConfirmationMessage( + const deletionMessage = new ConfirmationMessage( '删除配置集确认', '你确认永久删除配置集 ' + configMap.name + ' ?删除后将不可恢复!', configMap, diff --git a/src/frontend/src/app/admin/configmaptpl/configmaptpl.component.ts b/src/frontend/src/app/admin/configmaptpl/configmaptpl.component.ts index 11751c6c0..c2ee5a670 100644 --- a/src/frontend/src/app/admin/configmaptpl/configmaptpl.component.ts +++ b/src/frontend/src/app/admin/configmaptpl/configmaptpl.component.ts @@ -38,7 +38,7 @@ export class ConfigMapTplComponent implements OnInit { if (message && message.state === ConfirmationState.CONFIRMED && message.source === ConfirmationTargets.CONFIGMAP_TPL) { - let id = message.data; + const id = message.data; this.configMapTplService.deleteById(id, 0) .subscribe( response => { @@ -56,7 +56,7 @@ export class ConfigMapTplComponent implements OnInit { ngOnInit() { this.route.params.subscribe(params => { this.configmapId = params['cid']; - if (typeof (this.configmapId) == 'undefined') { + if (typeof (this.configmapId) === 'undefined') { this.configmapId = ''; } }); @@ -76,7 +76,7 @@ export class ConfigMapTplComponent implements OnInit { this.configMapTplService.listPage(this.pageState, 0, this.configmapId) .subscribe( response => { - let data = response.data; + const data = response.data; this.pageState.page.totalPage = data.totalPage; this.pageState.page.totalCount = data.totalCount; this.configMapTpls = data.list; @@ -96,7 +96,7 @@ export class ConfigMapTplComponent implements OnInit { } deleteConfigMapTpl(configMapTpl: ConfigMapTpl) { - let deletionMessage = new ConfirmationMessage( + const deletionMessage = new ConfirmationMessage( '删除配置集模版确认', '你确认删除配置集模版 ' + configMapTpl.name + ' ?', configMapTpl.id, diff --git a/src/frontend/src/app/admin/configmaptpl/create-edit-configmaptpl/create-edit-configmaptpl.component.html b/src/frontend/src/app/admin/configmaptpl/create-edit-configmaptpl/create-edit-configmaptpl.component.html index c03dfce38..bf2763728 100644 --- a/src/frontend/src/app/admin/configmaptpl/create-edit-configmaptpl/create-edit-configmaptpl.component.html +++ b/src/frontend/src/app/admin/configmaptpl/create-edit-configmaptpl/create-edit-configmaptpl.component.html @@ -12,7 +12,7 @@
-
+ [formGroupName]="i" class="form-group clr-row"> +
-
+
-
+
@@ -85,25 +85,25 @@

{{title}}[{{cluster?.name}}]

-
-
+
+
-
+
-
+
Gi
-
-
+
+
-
- @@ -118,11 +118,11 @@

{{title}}[{{cluster?.name}}]

-
diff --git a/src/frontend/src/app/admin/kubernetes/persistentvolume/persistentvolume.component.html b/src/frontend/src/app/admin/kubernetes/persistentvolume/persistentvolume.component.html index 199312053..bc1f6521e 100644 --- a/src/frontend/src/app/admin/kubernetes/persistentvolume/persistentvolume.component.html +++ b/src/frontend/src/app/admin/kubernetes/persistentvolume/persistentvolume.component.html @@ -1,5 +1,5 @@ -
-
+
+