UNPKG

k8ts

Version:

Powerful framework for building Kubernetes manifests in TypeScript.

1,254 lines (1,253 loc) 51.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.KustomizationV1Beta2SpecPostBuildSubstituteFromKind = exports.KustomizationV1Beta2SpecPatchesJson6902PatchOp = exports.KustomizationV1Beta2SpecSourceRefKind = exports.KustomizationV1Beta2SpecDecryptionProvider = exports.KustomizationV1Beta2SpecValidation = exports.KustomizationV1Beta2 = exports.KustomizationV1Beta1SpecPostBuildSubstituteFromKind = exports.KustomizationV1Beta1SpecPatchesJson6902PatchOp = exports.KustomizationV1Beta1SpecSourceRefKind = exports.KustomizationV1Beta1SpecDecryptionProvider = exports.KustomizationV1Beta1SpecValidation = exports.KustomizationV1Beta1 = exports.KustomizationSpecPostBuildSubstituteFromKind = exports.KustomizationSpecSourceRefKind = exports.KustomizationSpecDecryptionProvider = exports.KustomizationSpecDeletionPolicy = exports.Kustomization = void 0; exports.toJson_KustomizationProps = toJson_KustomizationProps; exports.toJson_KustomizationSpec = toJson_KustomizationSpec; exports.toJson_KustomizationSpecCommonMetadata = toJson_KustomizationSpecCommonMetadata; exports.toJson_KustomizationSpecDecryption = toJson_KustomizationSpecDecryption; exports.toJson_KustomizationSpecDependsOn = toJson_KustomizationSpecDependsOn; exports.toJson_KustomizationSpecHealthCheckExprs = toJson_KustomizationSpecHealthCheckExprs; exports.toJson_KustomizationSpecHealthChecks = toJson_KustomizationSpecHealthChecks; exports.toJson_KustomizationSpecImages = toJson_KustomizationSpecImages; exports.toJson_KustomizationSpecKubeConfig = toJson_KustomizationSpecKubeConfig; exports.toJson_KustomizationSpecPatches = toJson_KustomizationSpecPatches; exports.toJson_KustomizationSpecPostBuild = toJson_KustomizationSpecPostBuild; exports.toJson_KustomizationSpecSourceRef = toJson_KustomizationSpecSourceRef; exports.toJson_KustomizationSpecDecryptionSecretRef = toJson_KustomizationSpecDecryptionSecretRef; exports.toJson_KustomizationSpecKubeConfigSecretRef = toJson_KustomizationSpecKubeConfigSecretRef; exports.toJson_KustomizationSpecPatchesTarget = toJson_KustomizationSpecPatchesTarget; exports.toJson_KustomizationSpecPostBuildSubstituteFrom = toJson_KustomizationSpecPostBuildSubstituteFrom; exports.toJson_KustomizationV1Beta1Props = toJson_KustomizationV1Beta1Props; exports.toJson_KustomizationV1Beta1Spec = toJson_KustomizationV1Beta1Spec; exports.toJson_KustomizationV1Beta1SpecDecryption = toJson_KustomizationV1Beta1SpecDecryption; exports.toJson_KustomizationV1Beta1SpecDependsOn = toJson_KustomizationV1Beta1SpecDependsOn; exports.toJson_KustomizationV1Beta1SpecHealthChecks = toJson_KustomizationV1Beta1SpecHealthChecks; exports.toJson_KustomizationV1Beta1SpecImages = toJson_KustomizationV1Beta1SpecImages; exports.toJson_KustomizationV1Beta1SpecKubeConfig = toJson_KustomizationV1Beta1SpecKubeConfig; exports.toJson_KustomizationV1Beta1SpecPatches = toJson_KustomizationV1Beta1SpecPatches; exports.toJson_KustomizationV1Beta1SpecPatchesJson6902 = toJson_KustomizationV1Beta1SpecPatchesJson6902; exports.toJson_KustomizationV1Beta1SpecPostBuild = toJson_KustomizationV1Beta1SpecPostBuild; exports.toJson_KustomizationV1Beta1SpecSourceRef = toJson_KustomizationV1Beta1SpecSourceRef; exports.toJson_KustomizationV1Beta1SpecDecryptionSecretRef = toJson_KustomizationV1Beta1SpecDecryptionSecretRef; exports.toJson_KustomizationV1Beta1SpecKubeConfigSecretRef = toJson_KustomizationV1Beta1SpecKubeConfigSecretRef; exports.toJson_KustomizationV1Beta1SpecPatchesTarget = toJson_KustomizationV1Beta1SpecPatchesTarget; exports.toJson_KustomizationV1Beta1SpecPatchesJson6902Patch = toJson_KustomizationV1Beta1SpecPatchesJson6902Patch; exports.toJson_KustomizationV1Beta1SpecPatchesJson6902Target = toJson_KustomizationV1Beta1SpecPatchesJson6902Target; exports.toJson_KustomizationV1Beta1SpecPostBuildSubstituteFrom = toJson_KustomizationV1Beta1SpecPostBuildSubstituteFrom; exports.toJson_KustomizationV1Beta2Props = toJson_KustomizationV1Beta2Props; exports.toJson_KustomizationV1Beta2Spec = toJson_KustomizationV1Beta2Spec; exports.toJson_KustomizationV1Beta2SpecCommonMetadata = toJson_KustomizationV1Beta2SpecCommonMetadata; exports.toJson_KustomizationV1Beta2SpecDecryption = toJson_KustomizationV1Beta2SpecDecryption; exports.toJson_KustomizationV1Beta2SpecDependsOn = toJson_KustomizationV1Beta2SpecDependsOn; exports.toJson_KustomizationV1Beta2SpecHealthChecks = toJson_KustomizationV1Beta2SpecHealthChecks; exports.toJson_KustomizationV1Beta2SpecImages = toJson_KustomizationV1Beta2SpecImages; exports.toJson_KustomizationV1Beta2SpecKubeConfig = toJson_KustomizationV1Beta2SpecKubeConfig; exports.toJson_KustomizationV1Beta2SpecPatches = toJson_KustomizationV1Beta2SpecPatches; exports.toJson_KustomizationV1Beta2SpecPatchesJson6902 = toJson_KustomizationV1Beta2SpecPatchesJson6902; exports.toJson_KustomizationV1Beta2SpecPostBuild = toJson_KustomizationV1Beta2SpecPostBuild; exports.toJson_KustomizationV1Beta2SpecSourceRef = toJson_KustomizationV1Beta2SpecSourceRef; exports.toJson_KustomizationV1Beta2SpecDecryptionSecretRef = toJson_KustomizationV1Beta2SpecDecryptionSecretRef; exports.toJson_KustomizationV1Beta2SpecKubeConfigSecretRef = toJson_KustomizationV1Beta2SpecKubeConfigSecretRef; exports.toJson_KustomizationV1Beta2SpecPatchesTarget = toJson_KustomizationV1Beta2SpecPatchesTarget; exports.toJson_KustomizationV1Beta2SpecPatchesJson6902Patch = toJson_KustomizationV1Beta2SpecPatchesJson6902Patch; exports.toJson_KustomizationV1Beta2SpecPatchesJson6902Target = toJson_KustomizationV1Beta2SpecPatchesJson6902Target; exports.toJson_KustomizationV1Beta2SpecPostBuildSubstituteFrom = toJson_KustomizationV1Beta2SpecPostBuildSubstituteFrom; // generated by cdk8s const cdk8s_1 = require("cdk8s"); /** * Kustomization is the Schema for the kustomizations API. * * @schema Kustomization */ class Kustomization extends cdk8s_1.ApiObject { /** * Renders a Kubernetes manifest for "Kustomization". * * This can be used to inline resource manifests inside other objects (e.g. as templates). * * @param props initialization props */ static manifest(props = {}) { return { ...Kustomization.GVK, ...toJson_KustomizationProps(props), }; } /** * Defines a "Kustomization" API object * @param scope the scope in which to define this object * @param id a scope-local name for the object * @param props initialization props */ constructor(scope, id, props = {}) { super(scope, id, { ...Kustomization.GVK, ...props, }); } /** * Renders the object to Kubernetes JSON. */ toJson() { const resolved = super.toJson(); return { ...Kustomization.GVK, ...toJson_KustomizationProps(resolved), }; } } exports.Kustomization = Kustomization; /** * Returns the apiVersion and kind for "Kustomization" */ Kustomization.GVK = { apiVersion: 'kustomize.toolkit.fluxcd.io/v1', kind: 'Kustomization', }; /** * Converts an object of type 'KustomizationProps' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationProps(obj) { if (obj === undefined) { return undefined; } const result = { 'metadata': obj.metadata, 'spec': toJson_KustomizationSpec(obj.spec), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpec' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpec(obj) { if (obj === undefined) { return undefined; } const result = { 'commonMetadata': toJson_KustomizationSpecCommonMetadata(obj.commonMetadata), 'components': obj.components?.map(y => y), 'decryption': toJson_KustomizationSpecDecryption(obj.decryption), 'deletionPolicy': obj.deletionPolicy, 'dependsOn': obj.dependsOn?.map(y => toJson_KustomizationSpecDependsOn(y)), 'force': obj.force, 'healthCheckExprs': obj.healthCheckExprs?.map(y => toJson_KustomizationSpecHealthCheckExprs(y)), 'healthChecks': obj.healthChecks?.map(y => toJson_KustomizationSpecHealthChecks(y)), 'images': obj.images?.map(y => toJson_KustomizationSpecImages(y)), 'interval': obj.interval, 'kubeConfig': toJson_KustomizationSpecKubeConfig(obj.kubeConfig), 'namePrefix': obj.namePrefix, 'nameSuffix': obj.nameSuffix, 'patches': obj.patches?.map(y => toJson_KustomizationSpecPatches(y)), 'path': obj.path, 'postBuild': toJson_KustomizationSpecPostBuild(obj.postBuild), 'prune': obj.prune, 'retryInterval': obj.retryInterval, 'serviceAccountName': obj.serviceAccountName, 'sourceRef': toJson_KustomizationSpecSourceRef(obj.sourceRef), 'suspend': obj.suspend, 'targetNamespace': obj.targetNamespace, 'timeout': obj.timeout, 'wait': obj.wait, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecCommonMetadata' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecCommonMetadata(obj) { if (obj === undefined) { return undefined; } const result = { 'annotations': ((obj.annotations) === undefined) ? undefined : (Object.entries(obj.annotations).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})), 'labels': ((obj.labels) === undefined) ? undefined : (Object.entries(obj.labels).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecDecryption' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecDecryption(obj) { if (obj === undefined) { return undefined; } const result = { 'provider': obj.provider, 'secretRef': toJson_KustomizationSpecDecryptionSecretRef(obj.secretRef), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /* eslint-enable max-len, quote-props */ /** * DeletionPolicy can be used to control garbage collection when this * Kustomization is deleted. Valid values are ('MirrorPrune', 'Delete', * 'Orphan'). 'MirrorPrune' mirrors the Prune field (orphan if false, * delete if true). Defaults to 'MirrorPrune'. * * @default MirrorPrune'. * @schema KustomizationSpecDeletionPolicy */ var KustomizationSpecDeletionPolicy; (function (KustomizationSpecDeletionPolicy) { /** MirrorPrune */ KustomizationSpecDeletionPolicy["MIRROR_PRUNE"] = "MirrorPrune"; /** Delete */ KustomizationSpecDeletionPolicy["DELETE"] = "Delete"; /** Orphan */ KustomizationSpecDeletionPolicy["ORPHAN"] = "Orphan"; })(KustomizationSpecDeletionPolicy || (exports.KustomizationSpecDeletionPolicy = KustomizationSpecDeletionPolicy = {})); /** * Converts an object of type 'KustomizationSpecDependsOn' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecDependsOn(obj) { if (obj === undefined) { return undefined; } const result = { 'name': obj.name, 'namespace': obj.namespace, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecHealthCheckExprs' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecHealthCheckExprs(obj) { if (obj === undefined) { return undefined; } const result = { 'apiVersion': obj.apiVersion, 'current': obj.current, 'failed': obj.failed, 'inProgress': obj.inProgress, 'kind': obj.kind, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecHealthChecks' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecHealthChecks(obj) { if (obj === undefined) { return undefined; } const result = { 'apiVersion': obj.apiVersion, 'kind': obj.kind, 'name': obj.name, 'namespace': obj.namespace, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecImages' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecImages(obj) { if (obj === undefined) { return undefined; } const result = { 'digest': obj.digest, 'name': obj.name, 'newName': obj.newName, 'newTag': obj.newTag, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecKubeConfig' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecKubeConfig(obj) { if (obj === undefined) { return undefined; } const result = { 'secretRef': toJson_KustomizationSpecKubeConfigSecretRef(obj.secretRef), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecPatches' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecPatches(obj) { if (obj === undefined) { return undefined; } const result = { 'patch': obj.patch, 'target': toJson_KustomizationSpecPatchesTarget(obj.target), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecPostBuild' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecPostBuild(obj) { if (obj === undefined) { return undefined; } const result = { 'substitute': ((obj.substitute) === undefined) ? undefined : (Object.entries(obj.substitute).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})), 'substituteFrom': obj.substituteFrom?.map(y => toJson_KustomizationSpecPostBuildSubstituteFrom(y)), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecSourceRef' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecSourceRef(obj) { if (obj === undefined) { return undefined; } const result = { 'apiVersion': obj.apiVersion, 'kind': obj.kind, 'name': obj.name, 'namespace': obj.namespace, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /* eslint-enable max-len, quote-props */ /** * Provider is the name of the decryption engine. * * @schema KustomizationSpecDecryptionProvider */ var KustomizationSpecDecryptionProvider; (function (KustomizationSpecDecryptionProvider) { /** sops */ KustomizationSpecDecryptionProvider["SOPS"] = "sops"; })(KustomizationSpecDecryptionProvider || (exports.KustomizationSpecDecryptionProvider = KustomizationSpecDecryptionProvider = {})); /** * Converts an object of type 'KustomizationSpecDecryptionSecretRef' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecDecryptionSecretRef(obj) { if (obj === undefined) { return undefined; } const result = { 'name': obj.name, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecKubeConfigSecretRef' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecKubeConfigSecretRef(obj) { if (obj === undefined) { return undefined; } const result = { 'key': obj.key, 'name': obj.name, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecPatchesTarget' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecPatchesTarget(obj) { if (obj === undefined) { return undefined; } const result = { 'annotationSelector': obj.annotationSelector, 'group': obj.group, 'kind': obj.kind, 'labelSelector': obj.labelSelector, 'name': obj.name, 'namespace': obj.namespace, 'version': obj.version, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationSpecPostBuildSubstituteFrom' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationSpecPostBuildSubstituteFrom(obj) { if (obj === undefined) { return undefined; } const result = { 'kind': obj.kind, 'name': obj.name, 'optional': obj.optional, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /* eslint-enable max-len, quote-props */ /** * Kind of the referent. * * @schema KustomizationSpecSourceRefKind */ var KustomizationSpecSourceRefKind; (function (KustomizationSpecSourceRefKind) { /** OCIRepository */ KustomizationSpecSourceRefKind["OCI_REPOSITORY"] = "OCIRepository"; /** GitRepository */ KustomizationSpecSourceRefKind["GIT_REPOSITORY"] = "GitRepository"; /** Bucket */ KustomizationSpecSourceRefKind["BUCKET"] = "Bucket"; })(KustomizationSpecSourceRefKind || (exports.KustomizationSpecSourceRefKind = KustomizationSpecSourceRefKind = {})); /** * Kind of the values referent, valid values are ('Secret', 'ConfigMap'). * * @schema KustomizationSpecPostBuildSubstituteFromKind */ var KustomizationSpecPostBuildSubstituteFromKind; (function (KustomizationSpecPostBuildSubstituteFromKind) { /** Secret */ KustomizationSpecPostBuildSubstituteFromKind["SECRET"] = "Secret"; /** ConfigMap */ KustomizationSpecPostBuildSubstituteFromKind["CONFIG_MAP"] = "ConfigMap"; })(KustomizationSpecPostBuildSubstituteFromKind || (exports.KustomizationSpecPostBuildSubstituteFromKind = KustomizationSpecPostBuildSubstituteFromKind = {})); /** * Kustomization is the Schema for the kustomizations API. * * @schema KustomizationV1Beta1 */ class KustomizationV1Beta1 extends cdk8s_1.ApiObject { /** * Renders a Kubernetes manifest for "KustomizationV1Beta1". * * This can be used to inline resource manifests inside other objects (e.g. as templates). * * @param props initialization props */ static manifest(props = {}) { return { ...KustomizationV1Beta1.GVK, ...toJson_KustomizationV1Beta1Props(props), }; } /** * Defines a "KustomizationV1Beta1" API object * @param scope the scope in which to define this object * @param id a scope-local name for the object * @param props initialization props */ constructor(scope, id, props = {}) { super(scope, id, { ...KustomizationV1Beta1.GVK, ...props, }); } /** * Renders the object to Kubernetes JSON. */ toJson() { const resolved = super.toJson(); return { ...KustomizationV1Beta1.GVK, ...toJson_KustomizationV1Beta1Props(resolved), }; } } exports.KustomizationV1Beta1 = KustomizationV1Beta1; /** * Returns the apiVersion and kind for "KustomizationV1Beta1" */ KustomizationV1Beta1.GVK = { apiVersion: 'kustomize.toolkit.fluxcd.io/v1beta1', kind: 'Kustomization', }; /** * Converts an object of type 'KustomizationV1Beta1Props' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1Props(obj) { if (obj === undefined) { return undefined; } const result = { 'metadata': obj.metadata, 'spec': toJson_KustomizationV1Beta1Spec(obj.spec), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1Spec' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1Spec(obj) { if (obj === undefined) { return undefined; } const result = { 'decryption': toJson_KustomizationV1Beta1SpecDecryption(obj.decryption), 'dependsOn': obj.dependsOn?.map(y => toJson_KustomizationV1Beta1SpecDependsOn(y)), 'force': obj.force, 'healthChecks': obj.healthChecks?.map(y => toJson_KustomizationV1Beta1SpecHealthChecks(y)), 'images': obj.images?.map(y => toJson_KustomizationV1Beta1SpecImages(y)), 'interval': obj.interval, 'kubeConfig': toJson_KustomizationV1Beta1SpecKubeConfig(obj.kubeConfig), 'patches': obj.patches?.map(y => toJson_KustomizationV1Beta1SpecPatches(y)), 'patchesJson6902': obj.patchesJson6902?.map(y => toJson_KustomizationV1Beta1SpecPatchesJson6902(y)), 'patchesStrategicMerge': obj.patchesStrategicMerge?.map(y => y), 'path': obj.path, 'postBuild': toJson_KustomizationV1Beta1SpecPostBuild(obj.postBuild), 'prune': obj.prune, 'retryInterval': obj.retryInterval, 'serviceAccountName': obj.serviceAccountName, 'sourceRef': toJson_KustomizationV1Beta1SpecSourceRef(obj.sourceRef), 'suspend': obj.suspend, 'targetNamespace': obj.targetNamespace, 'timeout': obj.timeout, 'validation': obj.validation, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecDecryption' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecDecryption(obj) { if (obj === undefined) { return undefined; } const result = { 'provider': obj.provider, 'secretRef': toJson_KustomizationV1Beta1SpecDecryptionSecretRef(obj.secretRef), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecDependsOn' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecDependsOn(obj) { if (obj === undefined) { return undefined; } const result = { 'name': obj.name, 'namespace': obj.namespace, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecHealthChecks' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecHealthChecks(obj) { if (obj === undefined) { return undefined; } const result = { 'apiVersion': obj.apiVersion, 'kind': obj.kind, 'name': obj.name, 'namespace': obj.namespace, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecImages' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecImages(obj) { if (obj === undefined) { return undefined; } const result = { 'digest': obj.digest, 'name': obj.name, 'newName': obj.newName, 'newTag': obj.newTag, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecKubeConfig' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecKubeConfig(obj) { if (obj === undefined) { return undefined; } const result = { 'secretRef': toJson_KustomizationV1Beta1SpecKubeConfigSecretRef(obj.secretRef), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecPatches' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecPatches(obj) { if (obj === undefined) { return undefined; } const result = { 'patch': obj.patch, 'target': toJson_KustomizationV1Beta1SpecPatchesTarget(obj.target), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecPatchesJson6902' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecPatchesJson6902(obj) { if (obj === undefined) { return undefined; } const result = { 'patch': obj.patch?.map(y => toJson_KustomizationV1Beta1SpecPatchesJson6902Patch(y)), 'target': toJson_KustomizationV1Beta1SpecPatchesJson6902Target(obj.target), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecPostBuild' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecPostBuild(obj) { if (obj === undefined) { return undefined; } const result = { 'substitute': ((obj.substitute) === undefined) ? undefined : (Object.entries(obj.substitute).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})), 'substituteFrom': obj.substituteFrom?.map(y => toJson_KustomizationV1Beta1SpecPostBuildSubstituteFrom(y)), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecSourceRef' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecSourceRef(obj) { if (obj === undefined) { return undefined; } const result = { 'apiVersion': obj.apiVersion, 'kind': obj.kind, 'name': obj.name, 'namespace': obj.namespace, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /* eslint-enable max-len, quote-props */ /** * Validate the Kubernetes objects before applying them on the cluster. * The validation strategy can be 'client' (local dry-run), 'server' * (APIServer dry-run) or 'none'. * When 'Force' is 'true', validation will fallback to 'client' if set to * 'server' because server-side validation is not supported in this scenario. * * @schema KustomizationV1Beta1SpecValidation */ var KustomizationV1Beta1SpecValidation; (function (KustomizationV1Beta1SpecValidation) { /** none */ KustomizationV1Beta1SpecValidation["NONE"] = "none"; /** client */ KustomizationV1Beta1SpecValidation["CLIENT"] = "client"; /** server */ KustomizationV1Beta1SpecValidation["SERVER"] = "server"; })(KustomizationV1Beta1SpecValidation || (exports.KustomizationV1Beta1SpecValidation = KustomizationV1Beta1SpecValidation = {})); /** * Provider is the name of the decryption engine. * * @schema KustomizationV1Beta1SpecDecryptionProvider */ var KustomizationV1Beta1SpecDecryptionProvider; (function (KustomizationV1Beta1SpecDecryptionProvider) { /** sops */ KustomizationV1Beta1SpecDecryptionProvider["SOPS"] = "sops"; })(KustomizationV1Beta1SpecDecryptionProvider || (exports.KustomizationV1Beta1SpecDecryptionProvider = KustomizationV1Beta1SpecDecryptionProvider = {})); /** * Converts an object of type 'KustomizationV1Beta1SpecDecryptionSecretRef' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecDecryptionSecretRef(obj) { if (obj === undefined) { return undefined; } const result = { 'name': obj.name, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecKubeConfigSecretRef' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecKubeConfigSecretRef(obj) { if (obj === undefined) { return undefined; } const result = { 'name': obj.name, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecPatchesTarget' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecPatchesTarget(obj) { if (obj === undefined) { return undefined; } const result = { 'annotationSelector': obj.annotationSelector, 'group': obj.group, 'kind': obj.kind, 'labelSelector': obj.labelSelector, 'name': obj.name, 'namespace': obj.namespace, 'version': obj.version, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecPatchesJson6902Patch' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecPatchesJson6902Patch(obj) { if (obj === undefined) { return undefined; } const result = { 'from': obj.from, 'op': obj.op, 'path': obj.path, 'value': obj.value, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecPatchesJson6902Target' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecPatchesJson6902Target(obj) { if (obj === undefined) { return undefined; } const result = { 'annotationSelector': obj.annotationSelector, 'group': obj.group, 'kind': obj.kind, 'labelSelector': obj.labelSelector, 'name': obj.name, 'namespace': obj.namespace, 'version': obj.version, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta1SpecPostBuildSubstituteFrom' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta1SpecPostBuildSubstituteFrom(obj) { if (obj === undefined) { return undefined; } const result = { 'kind': obj.kind, 'name': obj.name, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /* eslint-enable max-len, quote-props */ /** * Kind of the referent * * @schema KustomizationV1Beta1SpecSourceRefKind */ var KustomizationV1Beta1SpecSourceRefKind; (function (KustomizationV1Beta1SpecSourceRefKind) { /** GitRepository */ KustomizationV1Beta1SpecSourceRefKind["GIT_REPOSITORY"] = "GitRepository"; /** Bucket */ KustomizationV1Beta1SpecSourceRefKind["BUCKET"] = "Bucket"; })(KustomizationV1Beta1SpecSourceRefKind || (exports.KustomizationV1Beta1SpecSourceRefKind = KustomizationV1Beta1SpecSourceRefKind = {})); /** * Op indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or * "test". * https://datatracker.ietf.org/doc/html/rfc6902#section-4 * * @schema KustomizationV1Beta1SpecPatchesJson6902PatchOp */ var KustomizationV1Beta1SpecPatchesJson6902PatchOp; (function (KustomizationV1Beta1SpecPatchesJson6902PatchOp) { /** test */ KustomizationV1Beta1SpecPatchesJson6902PatchOp["TEST"] = "test"; /** remove */ KustomizationV1Beta1SpecPatchesJson6902PatchOp["REMOVE"] = "remove"; /** add */ KustomizationV1Beta1SpecPatchesJson6902PatchOp["ADD"] = "add"; /** replace */ KustomizationV1Beta1SpecPatchesJson6902PatchOp["REPLACE"] = "replace"; /** move */ KustomizationV1Beta1SpecPatchesJson6902PatchOp["MOVE"] = "move"; /** copy */ KustomizationV1Beta1SpecPatchesJson6902PatchOp["COPY"] = "copy"; })(KustomizationV1Beta1SpecPatchesJson6902PatchOp || (exports.KustomizationV1Beta1SpecPatchesJson6902PatchOp = KustomizationV1Beta1SpecPatchesJson6902PatchOp = {})); /** * Kind of the values referent, valid values are ('Secret', 'ConfigMap'). * * @schema KustomizationV1Beta1SpecPostBuildSubstituteFromKind */ var KustomizationV1Beta1SpecPostBuildSubstituteFromKind; (function (KustomizationV1Beta1SpecPostBuildSubstituteFromKind) { /** Secret */ KustomizationV1Beta1SpecPostBuildSubstituteFromKind["SECRET"] = "Secret"; /** ConfigMap */ KustomizationV1Beta1SpecPostBuildSubstituteFromKind["CONFIG_MAP"] = "ConfigMap"; })(KustomizationV1Beta1SpecPostBuildSubstituteFromKind || (exports.KustomizationV1Beta1SpecPostBuildSubstituteFromKind = KustomizationV1Beta1SpecPostBuildSubstituteFromKind = {})); /** * Kustomization is the Schema for the kustomizations API. * * @schema KustomizationV1Beta2 */ class KustomizationV1Beta2 extends cdk8s_1.ApiObject { /** * Renders a Kubernetes manifest for "KustomizationV1Beta2". * * This can be used to inline resource manifests inside other objects (e.g. as templates). * * @param props initialization props */ static manifest(props = {}) { return { ...KustomizationV1Beta2.GVK, ...toJson_KustomizationV1Beta2Props(props), }; } /** * Defines a "KustomizationV1Beta2" API object * @param scope the scope in which to define this object * @param id a scope-local name for the object * @param props initialization props */ constructor(scope, id, props = {}) { super(scope, id, { ...KustomizationV1Beta2.GVK, ...props, }); } /** * Renders the object to Kubernetes JSON. */ toJson() { const resolved = super.toJson(); return { ...KustomizationV1Beta2.GVK, ...toJson_KustomizationV1Beta2Props(resolved), }; } } exports.KustomizationV1Beta2 = KustomizationV1Beta2; /** * Returns the apiVersion and kind for "KustomizationV1Beta2" */ KustomizationV1Beta2.GVK = { apiVersion: 'kustomize.toolkit.fluxcd.io/v1beta2', kind: 'Kustomization', }; /** * Converts an object of type 'KustomizationV1Beta2Props' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2Props(obj) { if (obj === undefined) { return undefined; } const result = { 'metadata': obj.metadata, 'spec': toJson_KustomizationV1Beta2Spec(obj.spec), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2Spec' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2Spec(obj) { if (obj === undefined) { return undefined; } const result = { 'commonMetadata': toJson_KustomizationV1Beta2SpecCommonMetadata(obj.commonMetadata), 'components': obj.components?.map(y => y), 'decryption': toJson_KustomizationV1Beta2SpecDecryption(obj.decryption), 'dependsOn': obj.dependsOn?.map(y => toJson_KustomizationV1Beta2SpecDependsOn(y)), 'force': obj.force, 'healthChecks': obj.healthChecks?.map(y => toJson_KustomizationV1Beta2SpecHealthChecks(y)), 'images': obj.images?.map(y => toJson_KustomizationV1Beta2SpecImages(y)), 'interval': obj.interval, 'kubeConfig': toJson_KustomizationV1Beta2SpecKubeConfig(obj.kubeConfig), 'patches': obj.patches?.map(y => toJson_KustomizationV1Beta2SpecPatches(y)), 'patchesJson6902': obj.patchesJson6902?.map(y => toJson_KustomizationV1Beta2SpecPatchesJson6902(y)), 'patchesStrategicMerge': obj.patchesStrategicMerge?.map(y => y), 'path': obj.path, 'postBuild': toJson_KustomizationV1Beta2SpecPostBuild(obj.postBuild), 'prune': obj.prune, 'retryInterval': obj.retryInterval, 'serviceAccountName': obj.serviceAccountName, 'sourceRef': toJson_KustomizationV1Beta2SpecSourceRef(obj.sourceRef), 'suspend': obj.suspend, 'targetNamespace': obj.targetNamespace, 'timeout': obj.timeout, 'validation': obj.validation, 'wait': obj.wait, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecCommonMetadata' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecCommonMetadata(obj) { if (obj === undefined) { return undefined; } const result = { 'annotations': ((obj.annotations) === undefined) ? undefined : (Object.entries(obj.annotations).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})), 'labels': ((obj.labels) === undefined) ? undefined : (Object.entries(obj.labels).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecDecryption' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecDecryption(obj) { if (obj === undefined) { return undefined; } const result = { 'provider': obj.provider, 'secretRef': toJson_KustomizationV1Beta2SpecDecryptionSecretRef(obj.secretRef), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecDependsOn' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecDependsOn(obj) { if (obj === undefined) { return undefined; } const result = { 'name': obj.name, 'namespace': obj.namespace, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecHealthChecks' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecHealthChecks(obj) { if (obj === undefined) { return undefined; } const result = { 'apiVersion': obj.apiVersion, 'kind': obj.kind, 'name': obj.name, 'namespace': obj.namespace, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecImages' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecImages(obj) { if (obj === undefined) { return undefined; } const result = { 'digest': obj.digest, 'name': obj.name, 'newName': obj.newName, 'newTag': obj.newTag, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecKubeConfig' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecKubeConfig(obj) { if (obj === undefined) { return undefined; } const result = { 'secretRef': toJson_KustomizationV1Beta2SpecKubeConfigSecretRef(obj.secretRef), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecPatches' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecPatches(obj) { if (obj === undefined) { return undefined; } const result = { 'patch': obj.patch, 'target': toJson_KustomizationV1Beta2SpecPatchesTarget(obj.target), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecPatchesJson6902' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecPatchesJson6902(obj) { if (obj === undefined) { return undefined; } const result = { 'patch': obj.patch?.map(y => toJson_KustomizationV1Beta2SpecPatchesJson6902Patch(y)), 'target': toJson_KustomizationV1Beta2SpecPatchesJson6902Target(obj.target), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecPostBuild' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecPostBuild(obj) { if (obj === undefined) { return undefined; } const result = { 'substitute': ((obj.substitute) === undefined) ? undefined : (Object.entries(obj.substitute).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {})), 'substituteFrom': obj.substituteFrom?.map(y => toJson_KustomizationV1Beta2SpecPostBuildSubstituteFrom(y)), }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecSourceRef' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecSourceRef(obj) { if (obj === undefined) { return undefined; } const result = { 'apiVersion': obj.apiVersion, 'kind': obj.kind, 'name': obj.name, 'namespace': obj.namespace, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /* eslint-enable max-len, quote-props */ /** * Deprecated: Not used in v1beta2. * * @schema KustomizationV1Beta2SpecValidation */ var KustomizationV1Beta2SpecValidation; (function (KustomizationV1Beta2SpecValidation) { /** none */ KustomizationV1Beta2SpecValidation["NONE"] = "none"; /** client */ KustomizationV1Beta2SpecValidation["CLIENT"] = "client"; /** server */ KustomizationV1Beta2SpecValidation["SERVER"] = "server"; })(KustomizationV1Beta2SpecValidation || (exports.KustomizationV1Beta2SpecValidation = KustomizationV1Beta2SpecValidation = {})); /** * Provider is the name of the decryption engine. * * @schema KustomizationV1Beta2SpecDecryptionProvider */ var KustomizationV1Beta2SpecDecryptionProvider; (function (KustomizationV1Beta2SpecDecryptionProvider) { /** sops */ KustomizationV1Beta2SpecDecryptionProvider["SOPS"] = "sops"; })(KustomizationV1Beta2SpecDecryptionProvider || (exports.KustomizationV1Beta2SpecDecryptionProvider = KustomizationV1Beta2SpecDecryptionProvider = {})); /** * Converts an object of type 'KustomizationV1Beta2SpecDecryptionSecretRef' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecDecryptionSecretRef(obj) { if (obj === undefined) { return undefined; } const result = { 'name': obj.name, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecKubeConfigSecretRef' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecKubeConfigSecretRef(obj) { if (obj === undefined) { return undefined; } const result = { 'key': obj.key, 'name': obj.name, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecPatchesTarget' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecPatchesTarget(obj) { if (obj === undefined) { return undefined; } const result = { 'annotationSelector': obj.annotationSelector, 'group': obj.group, 'kind': obj.kind, 'labelSelector': obj.labelSelector, 'name': obj.name, 'namespace': obj.namespace, 'version': obj.version, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecPatchesJson6902Patch' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecPatchesJson6902Patch(obj) { if (obj === undefined) { return undefined; } const result = { 'from': obj.from, 'op': obj.op, 'path': obj.path, 'value': obj.value, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecPatchesJson6902Target' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecPatchesJson6902Target(obj) { if (obj === undefined) { return undefined; } const result = { 'annotationSelector': obj.annotationSelector, 'group': obj.group, 'kind': obj.kind, 'labelSelector': obj.labelSelector, 'name': obj.name, 'namespace': obj.namespace, 'version': obj.version, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /** * Converts an object of type 'KustomizationV1Beta2SpecPostBuildSubstituteFrom' to JSON representation. */ /* eslint-disable max-len, quote-props */ function toJson_KustomizationV1Beta2SpecPostBuildSubstituteFrom(obj) { if (obj === undefined) { return undefined; } const result = { 'kind': obj.kind, 'name': obj.name, 'optional': obj.optional, }; // filter undefined values return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {}); } /* eslint-enable max-len, quote-props */ /** * Kind of the referent. * * @schema KustomizationV1Beta2SpecSourceRefKind */ var KustomizationV1Beta2SpecSourceRefKind; (function (KustomizationV1Beta2SpecSourceRefKind) { /** OCIRepository */ KustomizationV1Beta2SpecSourceRefKind["OCI_REPOSITORY"] = "OCIRepository"; /** GitRepository */ KustomizationV1Beta2SpecSourceRefKind["GIT_REPOSITORY"] = "GitRepository"; /** Bucket */ KustomizationV1Beta2SpecSourceRefKind["BUCKET"] = "Bucket"; })(KustomizationV1Beta2SpecSourceRefKind || (exports.KustomizationV1Beta2SpecSourceRefKind = KustomizationV1Beta2SpecSourceRefKind = {})); /** * Op indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or * "test".