@highstate/k8s 0.11.7 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DJE2YX64.js → chunk-3CKMDTYK.js} +3 -3
- package/dist/{chunk-DJE2YX64.js.map → chunk-3CKMDTYK.js.map} +1 -1
- package/dist/{chunk-23KLAP3X.js → chunk-3ZITTM5N.js} +8 -10
- package/dist/chunk-3ZITTM5N.js.map +1 -0
- package/dist/{chunk-5CMNORLF.js → chunk-6ACIPGW4.js} +3 -3
- package/dist/{chunk-5CMNORLF.js.map → chunk-6ACIPGW4.js.map} +1 -1
- package/dist/{chunk-SY7FPT77.js → chunk-7H4L3DFC.js} +4 -4
- package/dist/{chunk-SY7FPT77.js.map → chunk-7H4L3DFC.js.map} +1 -1
- package/dist/{chunk-77AY36LR.js → chunk-C6WHUOC3.js} +4 -4
- package/dist/{chunk-77AY36LR.js.map → chunk-C6WHUOC3.js.map} +1 -1
- package/dist/{chunk-Q35R54GK.js → chunk-EACAK6W4.js} +4 -4
- package/dist/{chunk-Q35R54GK.js.map → chunk-EACAK6W4.js.map} +1 -1
- package/dist/{chunk-4NWENXPT.js → chunk-F4JMKHHE.js} +32 -21
- package/dist/chunk-F4JMKHHE.js.map +1 -0
- package/dist/{chunk-UXEHNDI7.js → chunk-MXEIFVBL.js} +8 -10
- package/dist/chunk-MXEIFVBL.js.map +1 -0
- package/dist/{chunk-UHWJ2GDK.js → chunk-SEWB4FUB.js} +4 -4
- package/dist/{chunk-UHWJ2GDK.js.map → chunk-SEWB4FUB.js.map} +1 -1
- package/dist/{chunk-LR6OTL6T.js → chunk-VJL2BFKO.js} +3 -3
- package/dist/{chunk-LR6OTL6T.js.map → chunk-VJL2BFKO.js.map} +1 -1
- package/dist/{chunk-KCPQLLNX.js → chunk-WDNOBEI6.js} +19 -17
- package/dist/chunk-WDNOBEI6.js.map +1 -0
- package/dist/deployment-NNP3UJLZ.js +8 -0
- package/dist/{deployment-LVMOBFVO.js.map → deployment-NNP3UJLZ.js.map} +1 -1
- package/dist/highstate.manifest.json +2 -2
- package/dist/impl/gateway-route.js +5 -5
- package/dist/impl/tls-certificate.js +3 -3
- package/dist/index.js +20 -16
- package/dist/index.js.map +1 -1
- package/dist/stateful-set-XNB255LX.js +8 -0
- package/dist/{stateful-set-KKQDQMES.js.map → stateful-set-XNB255LX.js.map} +1 -1
- package/dist/units/cert-manager/index.js +7 -7
- package/dist/units/dns01-issuer/index.js +1 -1
- package/dist/units/existing-cluster/index.js +2 -2
- package/dist/units/gateway-api/index.js +1 -1
- package/dist/units/reduced-access-cluster/index.js +8 -8
- package/package.json +1 -1
- package/src/cron-job.ts +2 -0
- package/src/deployment.ts +5 -7
- package/src/helm.ts +15 -10
- package/src/job.ts +2 -0
- package/src/stateful-set.ts +5 -7
- package/src/workload.ts +28 -8
- package/dist/chunk-23KLAP3X.js.map +0 -1
- package/dist/chunk-4NWENXPT.js.map +0 -1
- package/dist/chunk-KCPQLLNX.js.map +0 -1
- package/dist/chunk-UXEHNDI7.js.map +0 -1
- package/dist/deployment-LVMOBFVO.js +0 -8
- package/dist/stateful-set-KKQDQMES.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/gateway/backend.ts","../src/gateway/gateway.ts","../src/gateway/http-route.ts","../src/gateway/tcp-route.ts","../src/gateway/udp-route.ts"],"names":["output","ComponentResource","gateway","normalizeInputsAndMap"],"mappings":";;;;;;;;AAoCO,SAAS,kBAAkB,GAAA,EAAiD;AACjF,EAAA,IAAI,OAAA,CAAQ,UAAA,CAAW,GAAG,CAAA,EAAG;AAC3B,IAAA,OAAO,MAAA,CAAO;AAAA,MACZ,IAAA,EAAM,IAAI,QAAA,CAAS,IAAA;AAAA,MACnB,SAAA,EAAW,IAAI,QAAA,CAAS,SAAA;AAAA,MACxB,IAAA,EAAM,GAAA,CAAI,IAAA,CAAK,KAAA,CAAM,CAAC,CAAA,CAAE;AAAA,KAC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A,CAAK,UAAU,iBAAiB,CAAA;AAExF,IAAA,IAAA,CAAK,KAAA,GAAQ,aAAA,CAAc,OAAA,CAAQ,KAAA,CAAM,CAAA,OAAA,KAAW;AAClD,MAAA,OAAO,IAAID,QAAQ,QAAA,CAAS,QAAA;AAAA,QAC1B,IAAA;AAAA,QACA;AAAA,UACE,UAAU,WAAA,CAAY,IAAA,EAAM,IAAI,CAAA,CAAE,MAAM,CAAA,QAAA,MAAa;AAAA,YACnD,GAAG,QAAA;AAAA,YACH,SAAA,EAAW,aAAA,CAAc,SAAA,CAAU,QAAA,CAAS;AAAA,WAC9C,CAAE,CAAA;AAAA,UACF,IAAA,EAAM;AAAA,YACJ,UAAA;AAAA,YACA,KAAA,EAAO;AAAA,cACL;AAAA,gBACE;AAAA;AACF;AACF;AACF,SACF;AAAA,QACA,EAAE,GAAG,IAAA,EAAM,MAAA,EAAQ,MAAM,QAAA,EAAU,WAAA,CAAY,OAAO,CAAA;AAAE,OAC1D;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF","file":"chunk-Q35R54GK.js","sourcesContent":["import type { core } from \"@pulumi/kubernetes\"\nimport { type Input, type Output, output, type Unwrap } from \"@highstate/pulumi\"\nimport { Service } from \"../service\"\n\nexport interface FullBackendRef {\n /**\n * The name of the resource being referenced.\n */\n name: Input<string>\n\n /**\n * The namespace of the resource being referenced.\n * May be undefined if the resource is not in a namespace.\n */\n namespace?: Input<string | undefined>\n\n /**\n * The port of the resource being referenced.\n */\n port: Input<number>\n}\n\nexport interface ServiceBackendRef {\n /**\n * The name of the service being referenced.\n */\n service: Input<core.v1.Service>\n\n /**\n * The port of the service being referenced.\n */\n port: Input<number>\n}\n\nexport type BackendRef = FullBackendRef | ServiceBackendRef | Service\n\nexport function resolveBackendRef(ref: BackendRef): Output<Unwrap<FullBackendRef>> {\n if (Service.isInstance(ref)) {\n return output({\n name: ref.metadata.name,\n namespace: ref.metadata.namespace,\n port: ref.spec.ports[0].port,\n })\n }\n\n if (\"service\" in ref) {\n const service = output(ref.service)\n\n return output({\n name: service.metadata.name,\n namespace: service.metadata.namespace,\n port: ref.port,\n })\n }\n\n return output({\n name: ref.name,\n namespace: ref.namespace,\n port: ref.port,\n })\n}\n","import type { k8s, network } from \"@highstate/library\"\nimport type { types } from \"@pulumi/kubernetes\"\nimport type { SetRequired } from \"type-fest\"\nimport { parseL3Endpoint } from \"@highstate/common\"\nimport { getOrCreate } from \"@highstate/contract\"\nimport { gateway, type types as gwTypes } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n type Inputs,\n interpolate,\n type Output,\n output,\n toPromise,\n} from \"@highstate/pulumi\"\nimport { omit } from \"remeda\"\nimport { Namespace } from \"../namespace\"\nimport { commonExtraArgs, getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\n\nexport type GatewayArgs = ScopedResourceArgs & {\n /**\n * The FQDN to configure the listeners for.\n */\n fqdn?: Input<string>\n\n /**\n * The FQDNs to configure the listeners for.\n */\n fqdns?: InputArray<string>\n} & gwTypes.input.gateway.v1.GatewaySpec\n\nexport type CreateOrGetGatewayArgs = GatewayArgs & {\n /**\n * The gateway entity to patch/retrieve.\n */\n existing: Input<k8s.Gateway> | undefined\n}\n\nconst gatewayExtraArgs = [...commonExtraArgs, \"fqdn\", \"fqdns\"] as const\n\n/**\n * Represents a Kubernetes Gateway resource.\n */\nexport abstract class Gateway extends ComponentResource {\n protected constructor(\n type: string,\n name: string,\n args: Inputs,\n opts: ComponentResourceOptions | undefined,\n\n /**\n * The namespace where the gateway is located.\n */\n readonly namespace: Output<Namespace>,\n\n /**\n * The metadata of the underlying Kubernetes gateway.\n */\n readonly metadata: Output<types.output.meta.v1.ObjectMeta>,\n\n /**\n * The spec of the underlying Gateway resource.\n */\n readonly spec: Output<gwTypes.output.gateway.v1.GatewaySpec>,\n\n /**\n * The status of the underlying Gateway resource.\n */\n readonly status: Output<gwTypes.output.gateway.v1.GatewayStatus>,\n ) {\n super(type, name, args, opts)\n }\n\n /**\n * The cluster where the gateway is located.\n */\n get cluster(): Output<k8s.Cluster> {\n return this.namespace.cluster\n }\n\n /**\n * The Highstate gateway entity.\n */\n get entity(): Output<k8s.Gateway> {\n return output({\n type: \"gateway\",\n clusterId: this.cluster.id,\n clusterName: this.cluster.name,\n metadata: this.metadata,\n })\n }\n\n /**\n * Returns the endpoints L3 endpoints on which the gateway is exposed.\n */\n get endpoints(): Output<network.L3Endpoint[]> {\n return this.status.addresses.apply(addresses => {\n if (!addresses) {\n return []\n }\n\n return addresses.map(address => parseL3Endpoint(address.value))\n })\n }\n\n /**\n * Creates a new gateway.\n */\n static create(name: string, args: GatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Creates a new gateway or patches an existing one.\n *\n * @param name The name of the resource. May not be the same as the gateway name.\n * @param args The arguments to create or patch the gateway with.\n * @param opts Optional resource options.\n */\n static createOrPatch(\n name: string,\n args: CreateOrGetGatewayArgs,\n opts?: ComponentResourceOptions,\n ): Gateway {\n if (args.existing) {\n return new GatewayPatch(name, {\n ...args,\n name: output(args.existing).metadata.name,\n namespace: Namespace.forResourceAsync(args.existing, output(args.namespace).cluster),\n })\n }\n\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Creates a new gateway or gets an existing one.\n *\n * @param name The name of the resource. May not be the same as the gateway name. Will not be used when existing gateway is retrieved.\n * @param args The arguments to create or get the gateway with.\n * @param opts Optional resource options.\n */\n static async createOrGet(\n name: string,\n args: CreateOrGetGatewayArgs,\n opts?: ComponentResourceOptions,\n ): Promise<Gateway> {\n if (args.existing) {\n return await Gateway.forAsync(args.existing, output(args.namespace).cluster)\n }\n\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Patches an existing gateway.\n *\n * Will throw an error if the gateway does not exist.\n *\n * @param name The name of the resource. May not be the same as the gateway name.\n * @param args The arguments to patch the gateway with.\n * @param opts Optional resource options.\n */\n static patch(name: string, args: GatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new GatewayPatch(name, args, opts)\n }\n\n /**\n * Wraps an existing Kubernetes gateway.\n */\n static wrap(name: string, args: WrappedGatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new WrappedGateway(name, args, opts)\n }\n\n /**\n * Gets an existing gateway.\n *\n * Will throw an error if the gateway does not exist.\n */\n static get(name: string, args: ExternalGatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new ExternalGateway(name, args, opts)\n }\n\n private static readonly gatewayCache = new Map<string, Gateway>()\n\n /**\n * Gets an existing gateway for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{gatewayName}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the gateway for.\n * @param cluster The cluster where the gateway is located.\n */\n static for(entity: k8s.Gateway, cluster: Input<k8s.Cluster>): Gateway {\n return getOrCreate(\n Gateway.gatewayCache,\n `${entity.clusterName}.${entity.metadata.namespace}.${entity.metadata.name}.${entity.clusterId}`,\n name => {\n return Gateway.get(name, {\n name: entity.metadata.name,\n namespace: Namespace.forResourceAsync(entity, cluster),\n })\n },\n )\n }\n\n /**\n * Gets an existing gateway for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{gatewayName}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the gateway for.\n * @param cluster The cluster where the gateway is located.\n */\n static async forAsync(entity: Input<k8s.Gateway>, cluster: Input<k8s.Cluster>): Promise<Gateway> {\n const resolvedEntity = await toPromise(entity)\n\n return Gateway.for(resolvedEntity, output(cluster))\n }\n\n /**\n * Creates a gateway with the provided name/namespace/cluster only once.\n *\n * It automatically names the resource with the following format: `{name}.{namespace}.{clusterName}.{clusterId}`.\n *\n * On subsequent calls the gateway is patched with the union of existing and requested listeners.\n * Only the listeners field is modified to avoid altering other spec fields.\n *\n * @param name The name of the gateway to create.\n * @param args The arguments to create the gateway with.\n * @param opts Optional resource options.\n */\n static async createOnce(\n args: SetRequired<GatewayArgs, \"name\">,\n opts?: ComponentResourceOptions,\n ): Promise<Gateway> {\n const { name, namespace, cluster } = await toPromise({\n name: args.name,\n namespace: output(args.namespace).metadata.name,\n cluster: output(args.namespace).cluster,\n })\n\n const fullName = `${name}.${namespace}.${cluster.name}.${cluster.id}`\n\n const existing = Gateway.gatewayCache.get(fullName)\n if (existing) {\n Gateway.patch(\n fullName,\n {\n name,\n namespace: args.namespace,\n listeners: args.listeners,\n },\n opts,\n )\n\n return existing\n }\n\n const created = Gateway.create(\n fullName,\n {\n ...args,\n name,\n namespace: args.namespace,\n },\n opts,\n )\n\n Gateway.gatewayCache.set(fullName, created)\n return created\n }\n}\n\nclass CreatedGateway extends Gateway {\n constructor(name: string, args: GatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return new gateway.v1.Gateway(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: omit(args, gatewayExtraArgs),\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:Gateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n\nclass GatewayPatch extends Gateway {\n constructor(name: string, args: GatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return new gateway.v1.GatewayPatch(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: omit(args, gatewayExtraArgs),\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:GatewayPatch\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n\nexport type WrappedGatewayArgs = {\n /**\n * The underlying Kubernetes gateway to wrap.\n */\n gateway: Input<gateway.v1.Gateway>\n\n /**\n * The namespace where the gateway is located.\n */\n namespace: Input<Namespace>\n}\n\nclass WrappedGateway extends Gateway {\n constructor(name: string, args: WrappedGatewayArgs, opts?: ComponentResourceOptions) {\n super(\n \"highstate:k8s:WrappedGateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n output(args.gateway).metadata as Output<types.output.meta.v1.ObjectMeta>,\n output(args.gateway).spec,\n output(args.gateway).status,\n )\n }\n}\n\nexport type ExternalGatewayArgs = {\n /**\n * The name of the gateway to get.\n */\n name: Input<string>\n\n /**\n * The namespace of the gateway to get.\n */\n namespace: Input<Namespace>\n}\n\nclass ExternalGateway extends Gateway {\n constructor(name: string, args: ExternalGatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return gateway.v1.Gateway.get(\n name,\n interpolate`${output(args.namespace).metadata.name}/${args.name}`,\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:ExternalGateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalize,\n normalizeInputs,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { map, pipe } from \"remeda\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type HttpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The alias for `hostnames: [hostname]`.\n */\n hostname?: Input<string>\n\n /**\n * The rule of the route.\n */\n rule?: Input<HttpRouteRuleArgs>\n\n /**\n * The rules of the route.\n */\n rules?: InputArray<HttpRouteRuleArgs>\n} & Omit<Partial<types.input.gateway.v1.HTTPRouteSpec>, \"rules\">\n\nexport type HttpRouteRuleArgs = Omit<\n types.input.gateway.v1.HTTPRouteSpecRules,\n \"matches\" | \"filters\" | \"backendRefs\"\n> & {\n /**\n * The conditions of the rule.\n * Can be specified as string to match on the path.\n */\n matches?: InputArray<HttpRouteRuleMatchOptions>\n\n /**\n * The condition of the rule.\n * Can be specified as string to match on the path.\n */\n match?: Input<HttpRouteRuleMatchOptions>\n\n /**\n * The filters of the rule.\n */\n filters?: InputArray<types.input.gateway.v1.HTTPRouteSpecRulesFilters>\n\n /**\n * The filter of the rule.\n */\n filter?: Input<types.input.gateway.v1.HTTPRouteSpecRulesFilters>\n\n /**\n * The service to route to.\n */\n backend?: Input<BackendRef>\n\n /**\n * The services to route to.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport type HttpRouteRuleMatchOptions = types.input.gateway.v1.HTTPRouteSpecRulesMatches | string\n\nexport class HttpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1.HTTPRoute>\n\n constructor(name: string, args: HttpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:HttpRoute\", name, args, opts)\n\n this.route = output(args.gateway).cluster.apply(cluster => {\n return new gateway.v1.HTTPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: output(args.gateway).namespace.metadata.name,\n })),\n spec: {\n hostnames: normalizeInputs(args.hostname, args.hostnames),\n\n parentRefs: [\n {\n name: output(args.gateway).metadata.name,\n },\n ],\n\n rules: normalizeInputsAndMap(args.rule, args.rules, rule => ({\n timeouts: rule.timeouts,\n\n matches: pipe(\n normalize(rule.match, rule.matches),\n map(mapHttpRouteRuleMatch),\n addDefaultPathMatch,\n ),\n\n filters: normalize(rule.filter, rule.filters),\n backendRefs: normalizeInputsAndMap(rule.backend, rule.backends, resolveBackendRef),\n })),\n } satisfies types.input.gateway.v1.HTTPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n\nfunction addDefaultPathMatch(\n matches: types.input.gateway.v1.HTTPRouteSpecRulesMatches[],\n): types.input.gateway.v1.HTTPRouteSpecRulesMatches[] {\n return matches.length ? matches : [{ path: { type: \"PathPrefix\", value: \"/\" } }]\n}\n\nexport function mapHttpRouteRuleMatch(\n match: HttpRouteRuleMatchOptions,\n): types.input.gateway.v1.HTTPRouteSpecRulesMatches {\n if (typeof match === \"string\") {\n return { path: { type: \"PathPrefix\", value: match } }\n }\n\n return match\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type TcpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The name of the listener to attach the route to.\n */\n listenerName: Input<string>\n\n /**\n * The backend reference handled by the route.\n */\n backend?: Input<BackendRef>\n\n /**\n * The backend references handled by the route.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport class TcpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1alpha2.TCPRoute>\n\n constructor(name: string, args: TcpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:TcpRoute\", name, args, opts)\n\n const gatewayOutput = output(args.gateway)\n\n const parentRefs = output({\n gateway: gatewayOutput,\n listenerName: args.listenerName,\n }).apply(\n ({ gateway, listenerName }) =>\n [\n {\n group: \"gateway.networking.k8s.io\",\n kind: \"Gateway\",\n name: gateway.metadata.name,\n namespace: gateway.namespace.metadata.name,\n sectionName: listenerName,\n },\n ] satisfies types.input.gateway.v1alpha2.TCPRouteSpecParentRefs[],\n )\n\n const backendRefs = normalizeInputsAndMap(args.backend, args.backends, resolveBackendRef)\n\n this.route = gatewayOutput.cluster.apply(cluster => {\n return new gateway.v1alpha2.TCPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: gatewayOutput.namespace.metadata.name,\n })),\n spec: {\n parentRefs,\n rules: [\n {\n backendRefs,\n },\n ],\n } satisfies types.input.gateway.v1alpha2.TCPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type UdpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The name of the listener to attach the route to.\n */\n listenerName: Input<string>\n\n /**\n * The backend reference handled by the route.\n */\n backend?: Input<BackendRef>\n\n /**\n * The backend references handled by the route.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport class UdpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1alpha2.UDPRoute>\n\n constructor(name: string, args: UdpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:UdpRoute\", name, args, opts)\n\n const gatewayOutput = output(args.gateway)\n\n const parentRefs = output({\n gateway: gatewayOutput,\n listenerName: args.listenerName,\n }).apply(\n ({ gateway, listenerName }) =>\n [\n {\n group: \"gateway.networking.k8s.io\",\n kind: \"Gateway\",\n name: gateway.metadata.name,\n namespace: gateway.namespace.metadata.name,\n sectionName: listenerName,\n },\n ] satisfies types.input.gateway.v1alpha2.UDPRouteSpecParentRefs[],\n )\n\n const backendRefs = normalizeInputsAndMap(args.backend, args.backends, resolveBackendRef)\n\n this.route = gatewayOutput.cluster.apply(cluster => {\n return new gateway.v1alpha2.UDPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: gatewayOutput.namespace.metadata.name,\n })),\n spec: {\n parentRefs,\n rules: [\n {\n backendRefs,\n },\n ],\n } satisfies types.input.gateway.v1alpha2.UDPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/gateway/backend.ts","../src/gateway/gateway.ts","../src/gateway/http-route.ts","../src/gateway/tcp-route.ts","../src/gateway/udp-route.ts"],"names":["output","ComponentResource","gateway","normalizeInputsAndMap"],"mappings":";;;;;;;;AAoCO,SAAS,kBAAkB,GAAA,EAAiD;AACjF,EAAA,IAAI,OAAA,CAAQ,UAAA,CAAW,GAAG,CAAA,EAAG;AAC3B,IAAA,OAAO,MAAA,CAAO;AAAA,MACZ,IAAA,EAAM,IAAI,QAAA,CAAS,IAAA;AAAA,MACnB,SAAA,EAAW,IAAI,QAAA,CAAS,SAAA;AAAA,MACxB,IAAA,EAAM,GAAA,CAAI,IAAA,CAAK,KAAA,CAAM,CAAC,CAAA,CAAE;AAAA,KACzB,CAAA;AAAA,EACH;AAEA,EAAA,IAAI,aAAa,GAAA,EAAK;AACpB,IAAA,MAAM,OAAA,GAAU,MAAA,CAAO,GAAA,CAAI,OAAO,CAAA;AAElC,IAAA,OAAO,MAAA,CAAO;AAAA,MACZ,IAAA,EAAM,QAAQ,QAAA,CAAS,IAAA;AAAA,MACvB,SAAA,EAAW,QAAQ,QAAA,CAAS,SAAA;AAAA,MAC5B,MAAM,GAAA,CAAI;AAAA,KACX,CAAA;AAAA,EACH;AAEA,EAAA,OAA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AAW,aAAA,CAAc,SAAA,CAAU,QAAA,CAAS;AAAA,WAC9C,CAAE,CAAA;AAAA,UACF,IAAA,EAAM;AAAA,YACJ,UAAA;AAAA,YACA,KAAA,EAAO;AAAA,cACL;AAAA,gBACE;AAAA;AACF;AACF;AACF,SACF;AAAA,QACA,EAAE,GAAG,IAAA,EAAM,MAAA,EAAQ,MAAM,QAAA,EAAU,WAAA,CAAY,OAAO,CAAA;AAAE,OAC1D;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF","file":"chunk-EACAK6W4.js","sourcesContent":["import type { core } from \"@pulumi/kubernetes\"\nimport { type Input, type Output, output, type Unwrap } from \"@highstate/pulumi\"\nimport { Service } from \"../service\"\n\nexport interface FullBackendRef {\n /**\n * The name of the resource being referenced.\n */\n name: Input<string>\n\n /**\n * The namespace of the resource being referenced.\n * May be undefined if the resource is not in a namespace.\n */\n namespace?: Input<string | undefined>\n\n /**\n * The port of the resource being referenced.\n */\n port: Input<number>\n}\n\nexport interface ServiceBackendRef {\n /**\n * The name of the service being referenced.\n */\n service: Input<core.v1.Service>\n\n /**\n * The port of the service being referenced.\n */\n port: Input<number>\n}\n\nexport type BackendRef = FullBackendRef | ServiceBackendRef | Service\n\nexport function resolveBackendRef(ref: BackendRef): Output<Unwrap<FullBackendRef>> {\n if (Service.isInstance(ref)) {\n return output({\n name: ref.metadata.name,\n namespace: ref.metadata.namespace,\n port: ref.spec.ports[0].port,\n })\n }\n\n if (\"service\" in ref) {\n const service = output(ref.service)\n\n return output({\n name: service.metadata.name,\n namespace: service.metadata.namespace,\n port: ref.port,\n })\n }\n\n return output({\n name: ref.name,\n namespace: ref.namespace,\n port: ref.port,\n })\n}\n","import type { k8s, network } from \"@highstate/library\"\nimport type { types } from \"@pulumi/kubernetes\"\nimport type { SetRequired } from \"type-fest\"\nimport { parseL3Endpoint } from \"@highstate/common\"\nimport { getOrCreate } from \"@highstate/contract\"\nimport { gateway, type types as gwTypes } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n type Inputs,\n interpolate,\n type Output,\n output,\n toPromise,\n} from \"@highstate/pulumi\"\nimport { omit } from \"remeda\"\nimport { Namespace } from \"../namespace\"\nimport { commonExtraArgs, getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\n\nexport type GatewayArgs = ScopedResourceArgs & {\n /**\n * The FQDN to configure the listeners for.\n */\n fqdn?: Input<string>\n\n /**\n * The FQDNs to configure the listeners for.\n */\n fqdns?: InputArray<string>\n} & gwTypes.input.gateway.v1.GatewaySpec\n\nexport type CreateOrGetGatewayArgs = GatewayArgs & {\n /**\n * The gateway entity to patch/retrieve.\n */\n existing: Input<k8s.Gateway> | undefined\n}\n\nconst gatewayExtraArgs = [...commonExtraArgs, \"fqdn\", \"fqdns\"] as const\n\n/**\n * Represents a Kubernetes Gateway resource.\n */\nexport abstract class Gateway extends ComponentResource {\n protected constructor(\n type: string,\n name: string,\n args: Inputs,\n opts: ComponentResourceOptions | undefined,\n\n /**\n * The namespace where the gateway is located.\n */\n readonly namespace: Output<Namespace>,\n\n /**\n * The metadata of the underlying Kubernetes gateway.\n */\n readonly metadata: Output<types.output.meta.v1.ObjectMeta>,\n\n /**\n * The spec of the underlying Gateway resource.\n */\n readonly spec: Output<gwTypes.output.gateway.v1.GatewaySpec>,\n\n /**\n * The status of the underlying Gateway resource.\n */\n readonly status: Output<gwTypes.output.gateway.v1.GatewayStatus>,\n ) {\n super(type, name, args, opts)\n }\n\n /**\n * The cluster where the gateway is located.\n */\n get cluster(): Output<k8s.Cluster> {\n return this.namespace.cluster\n }\n\n /**\n * The Highstate gateway entity.\n */\n get entity(): Output<k8s.Gateway> {\n return output({\n type: \"gateway\",\n clusterId: this.cluster.id,\n clusterName: this.cluster.name,\n metadata: this.metadata,\n })\n }\n\n /**\n * Returns the endpoints L3 endpoints on which the gateway is exposed.\n */\n get endpoints(): Output<network.L3Endpoint[]> {\n return this.status.addresses.apply(addresses => {\n if (!addresses) {\n return []\n }\n\n return addresses.map(address => parseL3Endpoint(address.value))\n })\n }\n\n /**\n * Creates a new gateway.\n */\n static create(name: string, args: GatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Creates a new gateway or patches an existing one.\n *\n * @param name The name of the resource. May not be the same as the gateway name.\n * @param args The arguments to create or patch the gateway with.\n * @param opts Optional resource options.\n */\n static createOrPatch(\n name: string,\n args: CreateOrGetGatewayArgs,\n opts?: ComponentResourceOptions,\n ): Gateway {\n if (args.existing) {\n return new GatewayPatch(name, {\n ...args,\n name: output(args.existing).metadata.name,\n namespace: Namespace.forResourceAsync(args.existing, output(args.namespace).cluster),\n })\n }\n\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Creates a new gateway or gets an existing one.\n *\n * @param name The name of the resource. May not be the same as the gateway name. Will not be used when existing gateway is retrieved.\n * @param args The arguments to create or get the gateway with.\n * @param opts Optional resource options.\n */\n static async createOrGet(\n name: string,\n args: CreateOrGetGatewayArgs,\n opts?: ComponentResourceOptions,\n ): Promise<Gateway> {\n if (args.existing) {\n return await Gateway.forAsync(args.existing, output(args.namespace).cluster)\n }\n\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Patches an existing gateway.\n *\n * Will throw an error if the gateway does not exist.\n *\n * @param name The name of the resource. May not be the same as the gateway name.\n * @param args The arguments to patch the gateway with.\n * @param opts Optional resource options.\n */\n static patch(name: string, args: GatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new GatewayPatch(name, args, opts)\n }\n\n /**\n * Wraps an existing Kubernetes gateway.\n */\n static wrap(name: string, args: WrappedGatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new WrappedGateway(name, args, opts)\n }\n\n /**\n * Gets an existing gateway.\n *\n * Will throw an error if the gateway does not exist.\n */\n static get(name: string, args: ExternalGatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new ExternalGateway(name, args, opts)\n }\n\n private static readonly gatewayCache = new Map<string, Gateway>()\n\n /**\n * Gets an existing gateway for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{gatewayName}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the gateway for.\n * @param cluster The cluster where the gateway is located.\n */\n static for(entity: k8s.Gateway, cluster: Input<k8s.Cluster>): Gateway {\n return getOrCreate(\n Gateway.gatewayCache,\n `${entity.clusterName}.${entity.metadata.namespace}.${entity.metadata.name}.${entity.clusterId}`,\n name => {\n return Gateway.get(name, {\n name: entity.metadata.name,\n namespace: Namespace.forResourceAsync(entity, cluster),\n })\n },\n )\n }\n\n /**\n * Gets an existing gateway for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{gatewayName}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the gateway for.\n * @param cluster The cluster where the gateway is located.\n */\n static async forAsync(entity: Input<k8s.Gateway>, cluster: Input<k8s.Cluster>): Promise<Gateway> {\n const resolvedEntity = await toPromise(entity)\n\n return Gateway.for(resolvedEntity, output(cluster))\n }\n\n /**\n * Creates a gateway with the provided name/namespace/cluster only once.\n *\n * It automatically names the resource with the following format: `{name}.{namespace}.{clusterName}.{clusterId}`.\n *\n * On subsequent calls the gateway is patched with the union of existing and requested listeners.\n * Only the listeners field is modified to avoid altering other spec fields.\n *\n * @param name The name of the gateway to create.\n * @param args The arguments to create the gateway with.\n * @param opts Optional resource options.\n */\n static async createOnce(\n args: SetRequired<GatewayArgs, \"name\">,\n opts?: ComponentResourceOptions,\n ): Promise<Gateway> {\n const { name, namespace, cluster } = await toPromise({\n name: args.name,\n namespace: output(args.namespace).metadata.name,\n cluster: output(args.namespace).cluster,\n })\n\n const fullName = `${name}.${namespace}.${cluster.name}.${cluster.id}`\n\n const existing = Gateway.gatewayCache.get(fullName)\n if (existing) {\n Gateway.patch(\n fullName,\n {\n name,\n namespace: args.namespace,\n listeners: args.listeners,\n },\n opts,\n )\n\n return existing\n }\n\n const created = Gateway.create(\n fullName,\n {\n ...args,\n name,\n namespace: args.namespace,\n },\n opts,\n )\n\n Gateway.gatewayCache.set(fullName, created)\n return created\n }\n}\n\nclass CreatedGateway extends Gateway {\n constructor(name: string, args: GatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return new gateway.v1.Gateway(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: omit(args, gatewayExtraArgs),\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:Gateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n\nclass GatewayPatch extends Gateway {\n constructor(name: string, args: GatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return new gateway.v1.GatewayPatch(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: omit(args, gatewayExtraArgs),\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:GatewayPatch\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n\nexport type WrappedGatewayArgs = {\n /**\n * The underlying Kubernetes gateway to wrap.\n */\n gateway: Input<gateway.v1.Gateway>\n\n /**\n * The namespace where the gateway is located.\n */\n namespace: Input<Namespace>\n}\n\nclass WrappedGateway extends Gateway {\n constructor(name: string, args: WrappedGatewayArgs, opts?: ComponentResourceOptions) {\n super(\n \"highstate:k8s:WrappedGateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n output(args.gateway).metadata as Output<types.output.meta.v1.ObjectMeta>,\n output(args.gateway).spec,\n output(args.gateway).status,\n )\n }\n}\n\nexport type ExternalGatewayArgs = {\n /**\n * The name of the gateway to get.\n */\n name: Input<string>\n\n /**\n * The namespace of the gateway to get.\n */\n namespace: Input<Namespace>\n}\n\nclass ExternalGateway extends Gateway {\n constructor(name: string, args: ExternalGatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return gateway.v1.Gateway.get(\n name,\n interpolate`${output(args.namespace).metadata.name}/${args.name}`,\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:ExternalGateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalize,\n normalizeInputs,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { map, pipe } from \"remeda\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type HttpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The alias for `hostnames: [hostname]`.\n */\n hostname?: Input<string>\n\n /**\n * The rule of the route.\n */\n rule?: Input<HttpRouteRuleArgs>\n\n /**\n * The rules of the route.\n */\n rules?: InputArray<HttpRouteRuleArgs>\n} & Omit<Partial<types.input.gateway.v1.HTTPRouteSpec>, \"rules\">\n\nexport type HttpRouteRuleArgs = Omit<\n types.input.gateway.v1.HTTPRouteSpecRules,\n \"matches\" | \"filters\" | \"backendRefs\"\n> & {\n /**\n * The conditions of the rule.\n * Can be specified as string to match on the path.\n */\n matches?: InputArray<HttpRouteRuleMatchOptions>\n\n /**\n * The condition of the rule.\n * Can be specified as string to match on the path.\n */\n match?: Input<HttpRouteRuleMatchOptions>\n\n /**\n * The filters of the rule.\n */\n filters?: InputArray<types.input.gateway.v1.HTTPRouteSpecRulesFilters>\n\n /**\n * The filter of the rule.\n */\n filter?: Input<types.input.gateway.v1.HTTPRouteSpecRulesFilters>\n\n /**\n * The service to route to.\n */\n backend?: Input<BackendRef>\n\n /**\n * The services to route to.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport type HttpRouteRuleMatchOptions = types.input.gateway.v1.HTTPRouteSpecRulesMatches | string\n\nexport class HttpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1.HTTPRoute>\n\n constructor(name: string, args: HttpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:HttpRoute\", name, args, opts)\n\n this.route = output(args.gateway).cluster.apply(cluster => {\n return new gateway.v1.HTTPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: output(args.gateway).namespace.metadata.name,\n })),\n spec: {\n hostnames: normalizeInputs(args.hostname, args.hostnames),\n\n parentRefs: [\n {\n name: output(args.gateway).metadata.name,\n },\n ],\n\n rules: normalizeInputsAndMap(args.rule, args.rules, rule => ({\n timeouts: rule.timeouts,\n\n matches: pipe(\n normalize(rule.match, rule.matches),\n map(mapHttpRouteRuleMatch),\n addDefaultPathMatch,\n ),\n\n filters: normalize(rule.filter, rule.filters),\n backendRefs: normalizeInputsAndMap(rule.backend, rule.backends, resolveBackendRef),\n })),\n } satisfies types.input.gateway.v1.HTTPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n\nfunction addDefaultPathMatch(\n matches: types.input.gateway.v1.HTTPRouteSpecRulesMatches[],\n): types.input.gateway.v1.HTTPRouteSpecRulesMatches[] {\n return matches.length ? matches : [{ path: { type: \"PathPrefix\", value: \"/\" } }]\n}\n\nexport function mapHttpRouteRuleMatch(\n match: HttpRouteRuleMatchOptions,\n): types.input.gateway.v1.HTTPRouteSpecRulesMatches {\n if (typeof match === \"string\") {\n return { path: { type: \"PathPrefix\", value: match } }\n }\n\n return match\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type TcpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The name of the listener to attach the route to.\n */\n listenerName: Input<string>\n\n /**\n * The backend reference handled by the route.\n */\n backend?: Input<BackendRef>\n\n /**\n * The backend references handled by the route.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport class TcpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1alpha2.TCPRoute>\n\n constructor(name: string, args: TcpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:TcpRoute\", name, args, opts)\n\n const gatewayOutput = output(args.gateway)\n\n const parentRefs = output({\n gateway: gatewayOutput,\n listenerName: args.listenerName,\n }).apply(\n ({ gateway, listenerName }) =>\n [\n {\n group: \"gateway.networking.k8s.io\",\n kind: \"Gateway\",\n name: gateway.metadata.name,\n namespace: gateway.namespace.metadata.name,\n sectionName: listenerName,\n },\n ] satisfies types.input.gateway.v1alpha2.TCPRouteSpecParentRefs[],\n )\n\n const backendRefs = normalizeInputsAndMap(args.backend, args.backends, resolveBackendRef)\n\n this.route = gatewayOutput.cluster.apply(cluster => {\n return new gateway.v1alpha2.TCPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: gatewayOutput.namespace.metadata.name,\n })),\n spec: {\n parentRefs,\n rules: [\n {\n backendRefs,\n },\n ],\n } satisfies types.input.gateway.v1alpha2.TCPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type UdpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The name of the listener to attach the route to.\n */\n listenerName: Input<string>\n\n /**\n * The backend reference handled by the route.\n */\n backend?: Input<BackendRef>\n\n /**\n * The backend references handled by the route.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport class UdpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1alpha2.UDPRoute>\n\n constructor(name: string, args: UdpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:UdpRoute\", name, args, opts)\n\n const gatewayOutput = output(args.gateway)\n\n const parentRefs = output({\n gateway: gatewayOutput,\n listenerName: args.listenerName,\n }).apply(\n ({ gateway, listenerName }) =>\n [\n {\n group: \"gateway.networking.k8s.io\",\n kind: \"Gateway\",\n name: gateway.metadata.name,\n namespace: gateway.namespace.metadata.name,\n sectionName: listenerName,\n },\n ] satisfies types.input.gateway.v1alpha2.UDPRouteSpecParentRefs[],\n )\n\n const backendRefs = normalizeInputsAndMap(args.backend, args.backends, resolveBackendRef)\n\n this.route = gatewayOutput.cluster.apply(cluster => {\n return new gateway.v1alpha2.UDPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: gatewayOutput.namespace.metadata.name,\n })),\n spec: {\n parentRefs,\n rules: [\n {\n backendRefs,\n },\n ],\n } satisfies types.input.gateway.v1alpha2.UDPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isEndpointFromCluster, mapServiceToLabelSelector, Service, mapContainerPortToServicePort } from './chunk-
|
|
2
|
-
import { Secret } from './chunk-
|
|
3
|
-
import { commonExtraArgs, ScopedResource, Namespace, mapMetadata, getProvider, mapSelectorLikeToSelector, getProviderAsync, mapNamespaceNameToSelector, getNamespaceName, images_exports } from './chunk-
|
|
1
|
+
import { isEndpointFromCluster, mapServiceToLabelSelector, Service, mapContainerPortToServicePort } from './chunk-3CKMDTYK.js';
|
|
2
|
+
import { Secret } from './chunk-VJL2BFKO.js';
|
|
3
|
+
import { commonExtraArgs, ScopedResource, Namespace, mapMetadata, getProvider, mapSelectorLikeToSelector, getProviderAsync, mapNamespaceNameToSelector, getNamespaceName, images_exports } from './chunk-SEWB4FUB.js';
|
|
4
4
|
import { z, getOrCreate, trimIndentation } from '@highstate/contract';
|
|
5
5
|
import { ComponentResource, toPromise, output as output$1, interpolate as interpolate$1, normalize, normalizeInputs, fileFromString } from '@highstate/pulumi';
|
|
6
6
|
import { core, networking } from '@pulumi/kubernetes';
|
|
@@ -1179,10 +1179,8 @@ var exposableWorkloadExtraArgs = [
|
|
|
1179
1179
|
"route",
|
|
1180
1180
|
"routes"
|
|
1181
1181
|
];
|
|
1182
|
-
function getWorkloadComponents(name, args, parent, opts) {
|
|
1183
|
-
const labels = {
|
|
1184
|
-
"app.kubernetes.io/name": name
|
|
1185
|
-
};
|
|
1182
|
+
function getWorkloadComponents(name, args, parent, opts, isForPatch) {
|
|
1183
|
+
const labels = isForPatch ? void 0 : { "app.kubernetes.io/name": name };
|
|
1186
1184
|
const containers = output(args).apply((args2) => normalize(args2.container, args2.containers));
|
|
1187
1185
|
const initContainers = output(args).apply(
|
|
1188
1186
|
(args2) => normalize(args2.initContainer, args2.initContainers)
|
|
@@ -1241,13 +1239,17 @@ function getWorkloadComponents(name, args, parent, opts) {
|
|
|
1241
1239
|
labels,
|
|
1242
1240
|
annotations: {
|
|
1243
1241
|
// to trigger a redeployment when the volumes change
|
|
1244
|
-
|
|
1242
|
+
// we embed a hash as annotation name (not value) to allow patching without conflicts
|
|
1243
|
+
[`highstate.io/dependency-hash-${dependencyHash2}`]: "1"
|
|
1245
1244
|
}
|
|
1246
1245
|
},
|
|
1247
1246
|
spec: podSpec2
|
|
1248
1247
|
};
|
|
1249
1248
|
});
|
|
1250
1249
|
const networkPolicy = output({ containers }).apply(({ containers: containers2 }) => {
|
|
1250
|
+
if (isForPatch) {
|
|
1251
|
+
return output(void 0);
|
|
1252
|
+
}
|
|
1251
1253
|
const allowedEndpoints = containers2.flatMap((container) => container.allowedEndpoints ?? []);
|
|
1252
1254
|
if (allowedEndpoints.length === 0 && !args.networkPolicy) {
|
|
1253
1255
|
return output(void 0);
|
|
@@ -1271,8 +1273,8 @@ function getWorkloadComponents(name, args, parent, opts) {
|
|
|
1271
1273
|
});
|
|
1272
1274
|
return { labels, containers, volumes, podSpec, podTemplate, networkPolicy };
|
|
1273
1275
|
}
|
|
1274
|
-
function getExposableWorkloadComponents(name, args, parent, opts) {
|
|
1275
|
-
const { labels, containers, volumes, podSpec, podTemplate, networkPolicy } = getWorkloadComponents(name, args, parent, opts);
|
|
1276
|
+
function getExposableWorkloadComponents(name, args, parent, opts, isForPatch) {
|
|
1277
|
+
const { labels, containers, volumes, podSpec, podTemplate, networkPolicy } = getWorkloadComponents(name, args, parent, opts, isForPatch);
|
|
1276
1278
|
const service = output({
|
|
1277
1279
|
existing: args.existing,
|
|
1278
1280
|
serviceArgs: args.service,
|
|
@@ -1322,20 +1324,22 @@ function getExposableWorkloadComponents(name, args, parent, opts) {
|
|
|
1322
1324
|
return { labels, containers, volumes, podSpec, podTemplate, networkPolicy, service, routes };
|
|
1323
1325
|
}
|
|
1324
1326
|
var Workload = class extends ScopedResource {
|
|
1325
|
-
constructor(type, name, args, opts, apiVersion, kind, terminalArgs, containers, namespace, metadata, networkPolicy) {
|
|
1327
|
+
constructor(type, name, args, opts, apiVersion, kind, terminalArgs, containers, namespace, metadata, podTemplate, networkPolicy) {
|
|
1326
1328
|
super(type, name, args, opts, apiVersion, kind, namespace, metadata);
|
|
1327
1329
|
this.name = name;
|
|
1328
1330
|
this.terminalArgs = terminalArgs;
|
|
1329
1331
|
this.containers = containers;
|
|
1332
|
+
this.podTemplate = podTemplate;
|
|
1330
1333
|
this.networkPolicy = networkPolicy;
|
|
1331
1334
|
}
|
|
1335
|
+
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: for pulumi which for some reason tries to copy all properties
|
|
1336
|
+
set terminal(_value) {
|
|
1337
|
+
}
|
|
1332
1338
|
/**
|
|
1333
1339
|
* The instance terminal to interact with the deployment.
|
|
1334
1340
|
*/
|
|
1335
1341
|
get terminal() {
|
|
1336
|
-
const containerName =
|
|
1337
|
-
return containers[0]?.name ?? this.name;
|
|
1338
|
-
});
|
|
1342
|
+
const containerName = this.podTemplate.spec.containers.apply((containers) => containers[0].name);
|
|
1339
1343
|
const shell = this.terminalArgs.apply((args) => args.shell ?? "bash");
|
|
1340
1344
|
const podLabelSelector = this.templateMetadata.apply((meta) => meta.labels ?? {}).apply(
|
|
1341
1345
|
(labels) => Object.entries(labels).map(([key, value]) => `${key}=${value}`).join(",")
|
|
@@ -1448,7 +1452,7 @@ var Workload = class extends ScopedResource {
|
|
|
1448
1452
|
}
|
|
1449
1453
|
};
|
|
1450
1454
|
var ExposableWorkload = class extends Workload {
|
|
1451
|
-
constructor(type, name, args, opts, apiVersion, kind, terminalArgs, containers, namespace, metadata, networkPolicy, _service, routes) {
|
|
1455
|
+
constructor(type, name, args, opts, apiVersion, kind, terminalArgs, containers, namespace, metadata, podTemplate, networkPolicy, _service, routes) {
|
|
1452
1456
|
super(
|
|
1453
1457
|
type,
|
|
1454
1458
|
name,
|
|
@@ -1460,11 +1464,18 @@ var ExposableWorkload = class extends Workload {
|
|
|
1460
1464
|
containers,
|
|
1461
1465
|
namespace,
|
|
1462
1466
|
metadata,
|
|
1467
|
+
podTemplate,
|
|
1463
1468
|
networkPolicy
|
|
1464
1469
|
);
|
|
1465
1470
|
this._service = _service;
|
|
1466
1471
|
this.routes = routes;
|
|
1467
1472
|
}
|
|
1473
|
+
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: for pulumi which for some reason tries to copy all properties
|
|
1474
|
+
set optionalService(_value) {
|
|
1475
|
+
}
|
|
1476
|
+
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: for pulumi which for some reason tries to copy all properties
|
|
1477
|
+
set service(_value) {
|
|
1478
|
+
}
|
|
1468
1479
|
/**
|
|
1469
1480
|
* The service associated with the workload.
|
|
1470
1481
|
*/
|
|
@@ -1490,7 +1501,7 @@ var ExposableWorkload = class extends Workload {
|
|
|
1490
1501
|
static createOrPatchGeneric(name, args, opts) {
|
|
1491
1502
|
return output(args).apply(async (args2) => {
|
|
1492
1503
|
if (args2.existing?.type === "deployment") {
|
|
1493
|
-
const { Deployment } = await import('./deployment-
|
|
1504
|
+
const { Deployment } = await import('./deployment-NNP3UJLZ.js');
|
|
1494
1505
|
return Deployment.patch(
|
|
1495
1506
|
name,
|
|
1496
1507
|
{
|
|
@@ -1502,7 +1513,7 @@ var ExposableWorkload = class extends Workload {
|
|
|
1502
1513
|
);
|
|
1503
1514
|
}
|
|
1504
1515
|
if (args2.existing?.type === "stateful-set") {
|
|
1505
|
-
const { StatefulSet } = await import('./stateful-set-
|
|
1516
|
+
const { StatefulSet } = await import('./stateful-set-XNB255LX.js');
|
|
1506
1517
|
return StatefulSet.patch(
|
|
1507
1518
|
name,
|
|
1508
1519
|
{
|
|
@@ -1514,11 +1525,11 @@ var ExposableWorkload = class extends Workload {
|
|
|
1514
1525
|
);
|
|
1515
1526
|
}
|
|
1516
1527
|
if (args2.type === "Deployment") {
|
|
1517
|
-
const { Deployment } = await import('./deployment-
|
|
1528
|
+
const { Deployment } = await import('./deployment-NNP3UJLZ.js');
|
|
1518
1529
|
return Deployment.create(name, deepmerge(args2, args2.deployment), opts);
|
|
1519
1530
|
}
|
|
1520
1531
|
if (args2.type === "StatefulSet") {
|
|
1521
|
-
const { StatefulSet } = await import('./stateful-set-
|
|
1532
|
+
const { StatefulSet } = await import('./stateful-set-XNB255LX.js');
|
|
1522
1533
|
return StatefulSet.create(name, deepmerge(args2, args2.statefulSet), opts);
|
|
1523
1534
|
}
|
|
1524
1535
|
throw new Error(`Unknown workload type: ${args2.type}`);
|
|
@@ -1527,5 +1538,5 @@ var ExposableWorkload = class extends Workload {
|
|
|
1527
1538
|
};
|
|
1528
1539
|
|
|
1529
1540
|
export { ConfigMap, ExposableWorkload, NativeNetworkPolicy, NetworkPolicy, PersistentVolumeClaim, Workload, exposableWorkloadExtraArgs, getAutoVolumeName, getBestEndpoint, getExposableWorkloadComponents, getFallbackContainerName, getWorkloadComponents, getWorkloadVolumeResourceUuid, mapContainerEnvironment, mapContainerToRaw, mapEnvironmentSource, mapVolumeMount, mapWorkloadVolume, networkPolicyMediator, podSpecDefaults, requireBestEndpoint, workloadExtraArgs };
|
|
1530
|
-
//# sourceMappingURL=chunk-
|
|
1531
|
-
//# sourceMappingURL=chunk-
|
|
1541
|
+
//# sourceMappingURL=chunk-F4JMKHHE.js.map
|
|
1542
|
+
//# sourceMappingURL=chunk-F4JMKHHE.js.map
|