@highstate/k8s 0.9.29 → 0.9.30
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-PODFA5KM.js → chunk-2FKGGWPJ.js} +3 -3
- package/dist/{chunk-PODFA5KM.js.map → chunk-2FKGGWPJ.js.map} +1 -1
- package/dist/{chunk-VI4JGEVG.js → chunk-4YC2SLCU.js} +3 -3
- package/dist/{chunk-VI4JGEVG.js.map → chunk-4YC2SLCU.js.map} +1 -1
- package/dist/{chunk-7CAKYZQ4.js → chunk-64LNVTHJ.js} +5 -5
- package/dist/{chunk-7CAKYZQ4.js.map → chunk-64LNVTHJ.js.map} +1 -1
- package/dist/{chunk-5BNGVYWY.js → chunk-ARG3I734.js} +3 -3
- package/dist/{chunk-5BNGVYWY.js.map → chunk-ARG3I734.js.map} +1 -1
- package/dist/{chunk-EBX6NFKK.js → chunk-FKJLPM3M.js} +3 -3
- package/dist/{chunk-EBX6NFKK.js.map → chunk-FKJLPM3M.js.map} +1 -1
- package/dist/{chunk-OEGSMSYV.js → chunk-HOARC4LU.js} +7 -7
- package/dist/{chunk-OEGSMSYV.js.map → chunk-HOARC4LU.js.map} +1 -1
- package/dist/{chunk-KHNUUVL4.js → chunk-VMEJWYK2.js} +11 -4
- package/dist/chunk-VMEJWYK2.js.map +1 -0
- package/dist/{chunk-UF3ADZGM.js → chunk-XYJNM2EN.js} +4 -5
- package/dist/chunk-XYJNM2EN.js.map +1 -0
- package/dist/deployment-PKZ4IQMG.js +8 -0
- package/dist/{deployment-NTLQBNXM.js.map → deployment-PKZ4IQMG.js.map} +1 -1
- package/dist/highstate.manifest.json +2 -2
- package/dist/impl/gateway-route.js +3 -3
- package/dist/impl/tls-certificate.js +2 -2
- package/dist/index.js +9 -9
- package/dist/stateful-set-OMPM2F7W.js +8 -0
- package/dist/{stateful-set-KBJ3EAMW.js.map → stateful-set-OMPM2F7W.js.map} +1 -1
- package/dist/units/cert-manager/index.js +5 -5
- package/dist/units/reduced-access-cluster/index.js +5 -5
- package/package.json +9 -9
- package/src/gateway/gateway.ts +2 -3
- package/src/secret.ts +12 -2
- package/dist/chunk-KHNUUVL4.js.map +0 -1
- package/dist/chunk-UF3ADZGM.js.map +0 -1
- package/dist/deployment-NTLQBNXM.js +0 -8
- package/dist/stateful-set-KBJ3EAMW.js +0 -8
@@ -217,12 +217,19 @@ var WrappedSecret = class extends Secret {
|
|
217
217
|
};
|
218
218
|
var ExternalSecret = class extends Secret {
|
219
219
|
constructor(name, args, opts) {
|
220
|
-
const secret = output(args.namespace).cluster.apply((cluster) => {
|
221
|
-
|
220
|
+
const secret = output(args.namespace).cluster.apply(async (cluster) => {
|
221
|
+
const secret2 = core.v1.Secret.get(
|
222
222
|
name,
|
223
223
|
interpolate`${output(args.namespace).metadata.name}/${args.name}`,
|
224
224
|
{ ...opts, parent: this, provider: getProvider(cluster) }
|
225
225
|
);
|
226
|
+
const namespace = await toPromise(output(args.namespace).metadata.name);
|
227
|
+
const resolvedName = await toPromise(args.name);
|
228
|
+
const metadata = await toPromise(secret2.metadata);
|
229
|
+
if (!metadata) {
|
230
|
+
throw new Error(`Secret ${resolvedName} in namespace ${namespace} not found`);
|
231
|
+
}
|
232
|
+
return secret2;
|
226
233
|
});
|
227
234
|
super(
|
228
235
|
"highstate:k8s:ExternalSecret",
|
@@ -240,5 +247,5 @@ var ExternalSecret = class extends Secret {
|
|
240
247
|
};
|
241
248
|
|
242
249
|
export { Secret };
|
243
|
-
//# sourceMappingURL=chunk-
|
244
|
-
//# sourceMappingURL=chunk-
|
250
|
+
//# sourceMappingURL=chunk-VMEJWYK2.js.map
|
251
|
+
//# sourceMappingURL=chunk-VMEJWYK2.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/secret.ts"],"names":["secret"],"mappings":";;;;;;AA4BO,IAAe,MAAA,GAAf,MAAe,OAAA,SAAe,cAAA,CAAe;AAAA,EACxC,WAAA,CACR,IAAA,EAC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AY,OAAO,CAAA;AAAE,OAC1D;AAGA,MAAA,MAAM,SAAA,GAAY,MAAM,SAAA,CAAU,MAAA,CAAO,KAAK,SAAS,CAAA,CAAE,SAAS,IAAI,CAAA;AACtE,MAAA,MAAM,YAAA,GAAe,MAAM,SAAA,CAAU,IAAA,CAAK,IAAI,CAAA;AAC9C,MAAA,MAAM,QAAA,GAAW,MAAM,SAAA,CAAUA,OAAAA,CAAO,QAAQ,CAAA;AAChD,MAAA,IAAI,CAAC,QAAA,EAAU;AACb,QAAA,MAAM,IAAI,KAAA,CAAM,CAAA,OAAA,EAAU,YAAY,CAAA,cAAA,EAAiB,SAAS,CAAA,UAAA,CAAY,CAAA;AAAA,MAC9E;AAEA,MAAA,OAAOA,OAAAA;AAAA,IACT,CAAC,CAAA;AAED,IAAA,KAAA;AAAA,MACE,8BAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MAEA,MAAA,CAAO,UAAA;AAAA,MACP,MAAA,CAAO,IAAA;AAAA,MACP,MAAA,CAAO,KAAK,SAAS,CAAA;AAAA,MACrB,MAAA,CAAO,QAAA;AAAA,MACP,MAAA,CAAO,IAAA;AAAA,MACP,MAAA,CAAO;AAAA,KACT;AAAA,EACF;AACF,CAAA","file":"chunk-VMEJWYK2.js","sourcesContent":["import type { k8s } from \"@highstate/library\"\nimport { getOrCreate } from \"@highstate/contract\"\nimport { toPromise } from \"@highstate/pulumi\"\nimport { core, type types } from \"@pulumi/kubernetes\"\nimport {\n type ComponentResourceOptions,\n type Input,\n type Inputs,\n interpolate,\n type Output,\n output,\n} from \"@pulumi/pulumi\"\nimport { Namespace } from \"./namespace\"\nimport { getProvider, mapMetadata, ScopedResource, type ScopedResourceArgs } from \"./shared\"\n\nexport type SecretArgs = ScopedResourceArgs &\n Omit<types.input.core.v1.Secret, \"kind\" | \"metadata\" | \"apiVersion\">\n\nexport type CreateOrGetSecretArgs = SecretArgs & {\n /**\n * The secret entity to patch/retrieve.\n */\n existing: Input<k8s.ScopedResource> | undefined\n}\n\n/**\n * Represents a Kubernetes Secret resource with metadata and data.\n */\nexport abstract class Secret extends ScopedResource {\n protected constructor(\n type: string,\n name: string,\n args: Inputs,\n opts: ComponentResourceOptions | undefined,\n\n apiVersion: Output<string>,\n kind: Output<string>,\n namespace: Output<Namespace>,\n metadata: Output<types.output.meta.v1.ObjectMeta>,\n\n /**\n * The data of the underlying Kubernetes secret.\n */\n readonly data: Output<Record<string, string>>,\n\n /**\n * The stringData of the underlying Kubernetes secret.\n */\n readonly stringData: Output<Record<string, string>>,\n ) {\n super(type, name, args, opts, apiVersion, kind, namespace, metadata)\n }\n\n /**\n * The Highstate secret entity.\n */\n get entity(): Output<k8s.ScopedResource> {\n return output({\n type: \"secret\",\n clusterId: this.cluster.id,\n clusterName: this.cluster.name,\n metadata: this.metadata,\n })\n }\n\n /**\n * Gets the value of the secret field by the given key in `data`.\n *\n * Automatically decodes the base64 value.\n *\n * @param key The key of the secret.\n * @returns The value of the secret.\n */\n getValue(key: string): Output<string> {\n return this.data[key].apply(value => Buffer.from(value, \"base64\").toString())\n }\n\n /**\n * Creates a new secret.\n */\n static create(name: string, args: SecretArgs, opts?: ComponentResourceOptions): Secret {\n return new CreatedSecret(name, args, opts)\n }\n\n /**\n * Creates a new secret or patches an existing one.\n *\n * @param name The name of the resource. May not be the same as the secret name.\n * @param args The arguments to create or patch the secret with.\n * @param opts Optional resource options.\n */\n static createOrPatch(\n name: string,\n args: CreateOrGetSecretArgs,\n opts?: ComponentResourceOptions,\n ): Secret {\n if (args.existing) {\n return new SecretPatch(name, {\n ...args,\n name: output(args.existing).metadata.name,\n })\n }\n\n return new CreatedSecret(name, args, opts)\n }\n\n /**\n * Creates a new secret or gets an existing one.\n *\n * @param name The name of the resource. May not be the same as the secret name. Will not be used when existing secret is retrieved.\n * @param args The arguments to create or get the secret with.\n * @param opts Optional resource options.\n */\n static async createOrGet(\n name: string,\n args: CreateOrGetSecretArgs,\n opts?: ComponentResourceOptions,\n ): Promise<Secret> {\n if (args.existing) {\n return await Secret.forAsync(args.existing, output(args.namespace).cluster)\n }\n\n return new CreatedSecret(name, args, opts)\n }\n\n /**\n * Patches an existing secret.\n *\n * Will throw an error if the secret does not exist.\n *\n * @param name The name of the resource. May not be the same as the secret name.\n * @param args The arguments to patch the secret with.\n * @param opts Optional resource options.\n */\n static patch(name: string, args: SecretArgs, opts?: ComponentResourceOptions): Secret {\n return new SecretPatch(name, args, opts)\n }\n\n /**\n * Wraps an existing Kubernetes secret.\n */\n static wrap(name: string, args: WrappedSecretArgs, opts?: ComponentResourceOptions): Secret {\n return new WrappedSecret(name, args, opts)\n }\n\n /**\n * Gets an existing secret.\n *\n * Will throw an error if the secret does not exist.\n */\n static get(name: string, args: ExternalSecretArgs, opts?: ComponentResourceOptions): Secret {\n return new ExternalSecret(name, args, opts)\n }\n\n private static readonly secretCache = new Map<string, Secret>()\n\n /**\n * Gets an existing secret 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}.{name}.{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 secret for.\n * @param cluster The cluster where the secret is located.\n */\n static for(entity: k8s.ScopedResource, cluster: Input<k8s.Cluster>): Secret {\n return getOrCreate(\n Secret.secretCache,\n `${entity.clusterName}.${entity.metadata.namespace}.${entity.metadata.name}.${entity.clusterId}`,\n name => {\n return Secret.get(name, {\n name: entity.metadata.name,\n namespace: Namespace.forResource(entity, cluster),\n })\n },\n )\n }\n\n /**\n * Gets an existing secret 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}.{name}.{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 secret for.\n * @param cluster The cluster where the secret is located.\n */\n static async forAsync(\n entity: Input<k8s.ScopedResource>,\n cluster: Input<k8s.Cluster>,\n ): Promise<Secret> {\n const resolvedEntity = await toPromise(entity)\n return Secret.for(resolvedEntity, cluster)\n }\n}\n\nclass CreatedSecret extends Secret {\n constructor(name: string, args: SecretArgs, opts?: ComponentResourceOptions) {\n const secret = output(args.namespace).cluster.apply(cluster => {\n return new core.v1.Secret(\n name,\n {\n metadata: mapMetadata(args, name),\n data: args.data,\n stringData: args.stringData,\n type: args.type,\n immutable: args.immutable,\n },\n {\n ...opts,\n parent: this,\n provider: getProvider(cluster),\n },\n )\n })\n\n super(\n \"highstate:k8s:Secret\",\n name,\n args,\n opts,\n secret.apiVersion,\n secret.kind,\n output(args.namespace),\n secret.metadata,\n secret.data,\n secret.stringData,\n )\n }\n}\n\nclass SecretPatch extends Secret {\n constructor(name: string, args: SecretArgs, opts?: ComponentResourceOptions) {\n const secret = output(args.namespace).cluster.apply(cluster => {\n return new core.v1.SecretPatch(\n name,\n {\n metadata: mapMetadata(args, name),\n data: args.data,\n stringData: args.stringData,\n type: args.type,\n immutable: args.immutable,\n },\n {\n ...opts,\n parent: this,\n provider: getProvider(cluster),\n },\n )\n })\n\n super(\n \"highstate:k8s:SecretPatch\",\n name,\n args,\n opts,\n secret.apiVersion,\n secret.kind,\n output(args.namespace),\n secret.metadata,\n secret.data,\n secret.stringData,\n )\n }\n}\n\nexport type WrappedSecretArgs = {\n /**\n * The underlying Kubernetes secret to wrap.\n */\n secret: Input<core.v1.Secret>\n\n /**\n * The namespace where the secret is located.\n */\n namespace: Input<Namespace>\n}\n\nclass WrappedSecret extends Secret {\n constructor(name: string, args: WrappedSecretArgs, opts?: ComponentResourceOptions) {\n super(\n \"highstate:k8s:WrappedSecret\",\n name,\n args,\n opts,\n\n output(args.secret).apiVersion,\n output(args.secret).kind,\n output(args.namespace),\n output(args.secret).metadata,\n output(args.secret).data,\n output(args.secret).stringData,\n )\n }\n}\n\nexport type ExternalSecretArgs = {\n /**\n * The name of the secret to get.\n */\n name: Input<string>\n\n /**\n * The namespace where the secret is located.\n */\n namespace: Input<Namespace>\n}\n\nclass ExternalSecret extends Secret {\n constructor(name: string, args: ExternalSecretArgs, opts?: ComponentResourceOptions) {\n const secret = output(args.namespace).cluster.apply(async cluster => {\n const secret = core.v1.Secret.get(\n name,\n interpolate`${output(args.namespace).metadata.name}/${args.name}`,\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n\n // TODO: investigate why this needed\n const namespace = await toPromise(output(args.namespace).metadata.name)\n const resolvedName = await toPromise(args.name)\n const metadata = await toPromise(secret.metadata)\n if (!metadata) {\n throw new Error(`Secret ${resolvedName} in namespace ${namespace} not found`)\n }\n\n return secret\n })\n\n super(\n \"highstate:k8s:ExternalSecret\",\n name,\n args,\n opts,\n\n secret.apiVersion,\n secret.kind,\n output(args.namespace),\n secret.metadata,\n secret.data,\n secret.stringData,\n )\n }\n}\n"]}
|
@@ -4,7 +4,6 @@ import { output, ComponentResource, toPromise, interpolate, normalizeInputsAndMa
|
|
4
4
|
import { parseL3Endpoint } from '@highstate/common';
|
5
5
|
import { getOrCreate } from '@highstate/contract';
|
6
6
|
import { gateway } from '@highstate/gateway-api';
|
7
|
-
import { deepmerge } from 'deepmerge-ts';
|
8
7
|
import { omit, pipe, map } from 'remeda';
|
9
8
|
|
10
9
|
function resolveBackendRef(ref) {
|
@@ -207,7 +206,7 @@ var CreatedGateway = class extends Gateway {
|
|
207
206
|
name,
|
208
207
|
{
|
209
208
|
metadata: mapMetadata(args, name),
|
210
|
-
spec:
|
209
|
+
spec: omit(args, gatewayExtraArgs)
|
211
210
|
},
|
212
211
|
{ ...opts, parent: this, provider: getProvider(cluster) }
|
213
212
|
);
|
@@ -231,7 +230,7 @@ var GatewayPatch = class extends Gateway {
|
|
231
230
|
name,
|
232
231
|
{
|
233
232
|
metadata: mapMetadata(args, name),
|
234
|
-
spec:
|
233
|
+
spec: omit(args, gatewayExtraArgs)
|
235
234
|
},
|
236
235
|
{ ...opts, parent: this, provider: getProvider(cluster) }
|
237
236
|
);
|
@@ -333,5 +332,5 @@ function mapHttpRouteRuleMatch(match) {
|
|
333
332
|
}
|
334
333
|
|
335
334
|
export { Gateway, HttpRoute, mapHttpRouteRuleMatch, resolveBackendRef };
|
336
|
-
//# sourceMappingURL=chunk-
|
337
|
-
//# sourceMappingURL=chunk-
|
335
|
+
//# sourceMappingURL=chunk-XYJNM2EN.js.map
|
336
|
+
//# sourceMappingURL=chunk-XYJNM2EN.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/gateway/backend.ts","../src/gateway/gateway.ts","../src/gateway/http-route.ts"],"names":["output","ComponentResource","gateway"],"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,OAAO,MAAA,CAAO;AAAA,IACZ,MAAM,GAAA,CAAI,IAAA;AAAA,IACV,WAAW,GAAA,CAAI,SAAA;AAAA,IACf,MAAM,GAAA,CAAI;AAAA,GACX,CAAA;AACH;ACpBA,IAAM,gBAAA,GAAmB,CAAC,GAAG,eAAA,EAAiB,QAAQ,OAAO,CAAA;AAKtD,IAAe,OAAA,GAAf,MAAe,QAAA,SAAg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,aAClE,CAAE;AAAA;AACJ,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;AAEA,SAAS,oBACP,OAAA,EACoD;AACpD,EAAA,OAAO,OAAA,CAAQ,MAAA,GAAS,OAAA,GAAU,CAAC,EAAE,IAAA,EAAM,EAAE,IAAA,EAAM,YAAA,EAAc,KAAA,EAAO,GAAA,EAAI,EAAG,CAAA;AACjF;AAEO,SAAS,sBACd,KAAA,EACkD;AAClD,EAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,IAAA,OAAO,EAAE,IAAA,EAAM,EAAE,MAAM,YAAA,EAAc,KAAA,EAAO,OAAM,EAAE;AAAA,EACtD;AAEA,EAAA,OAAO,KAAA;AACT","file":"chunk-XYJNM2EN.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 * This method is idempotent and will return the same instance for the same name/namespace/cluster.\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 return getOrCreate(Gateway.gatewayCache, name, () =>\n Gateway.create(\n fullName,\n {\n ...args,\n name,\n namespace: args.namespace,\n },\n opts,\n ),\n )\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\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: rule.backend ? [resolveBackendRef(rule.backend)] : undefined,\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"]}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export { Deployment } from './chunk-2FKGGWPJ.js';
|
2
|
+
import './chunk-HOARC4LU.js';
|
3
|
+
import './chunk-SI7X6N46.js';
|
4
|
+
import './chunk-VMEJWYK2.js';
|
5
|
+
import './chunk-WGMJCZSK.js';
|
6
|
+
import './chunk-PZ5AY32C.js';
|
7
|
+
//# sourceMappingURL=deployment-PKZ4IQMG.js.map
|
8
|
+
//# sourceMappingURL=deployment-PKZ4IQMG.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"deployment-
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"deployment-PKZ4IQMG.js"}
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"./dist/units/existing-cluster/index.js": 2212294583,
|
9
9
|
"./dist/units/gateway-api/index.js": 2212294583,
|
10
10
|
"./dist/units/reduced-access-cluster/index.js": 2212294583,
|
11
|
-
"./dist/impl/gateway-route.js":
|
12
|
-
"./dist/impl/tls-certificate.js":
|
11
|
+
"./dist/impl/gateway-route.js": 2698408177,
|
12
|
+
"./dist/impl/tls-certificate.js": 2030214681
|
13
13
|
}
|
14
14
|
}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { Certificate } from '../chunk-
|
2
|
-
import { Gateway, HttpRoute } from '../chunk-
|
1
|
+
import { Certificate } from '../chunk-4YC2SLCU.js';
|
2
|
+
import { Gateway, HttpRoute } from '../chunk-XYJNM2EN.js';
|
3
3
|
import { Service, l4EndpointToServicePort } from '../chunk-SI7X6N46.js';
|
4
|
-
import '../chunk-
|
4
|
+
import '../chunk-VMEJWYK2.js';
|
5
5
|
import { Namespace, mapMetadata, getProvider } from '../chunk-WGMJCZSK.js';
|
6
6
|
import '../chunk-PZ5AY32C.js';
|
7
7
|
import { gatewayRouteMediator, filterEndpoints } from '@highstate/common';
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Certificate } from '../chunk-
|
2
|
-
import '../chunk-
|
1
|
+
import { Certificate } from '../chunk-4YC2SLCU.js';
|
2
|
+
import '../chunk-VMEJWYK2.js';
|
3
3
|
import { getProvider, Namespace } from '../chunk-WGMJCZSK.js';
|
4
4
|
import '../chunk-PZ5AY32C.js';
|
5
5
|
import { tlsCertificateMediator } from '@highstate/common';
|
package/dist/index.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
export { Gateway, HttpRoute, mapHttpRouteRuleMatch, resolveBackendRef } from './chunk-
|
2
|
-
export { Chart, RenderedChart, getChartService, getChartServiceOutput, resolveHelmChart } from './chunk-
|
1
|
+
export { Gateway, HttpRoute, mapHttpRouteRuleMatch, resolveBackendRef } from './chunk-XYJNM2EN.js';
|
2
|
+
export { Chart, RenderedChart, getChartService, getChartServiceOutput, resolveHelmChart } from './chunk-64LNVTHJ.js';
|
3
3
|
export { dns01SolverMediator } from './chunk-HH2JJELM.js';
|
4
|
-
import { ClusterAccessScope } from './chunk-
|
5
|
-
export { ClusterAccessScope } from './chunk-
|
6
|
-
export { Deployment } from './chunk-
|
7
|
-
export { StatefulSet } from './chunk-
|
8
|
-
import { Workload, getWorkloadComponents, ConfigMap } from './chunk-
|
9
|
-
export { ConfigMap, ExposableWorkload, NativeNetworkPolicy, NetworkPolicy, PersistentVolumeClaim, Workload, exposableWorkloadExtraArgs, getAutoVolumeName, getBestEndpoint, getExposableWorkloadComponents, getWorkloadComponents, getWorkloadVolumeResourceUuid, mapContainerEnvironment, mapContainerToRaw, mapEnvironmentSource, mapVolumeMount, mapWorkloadVolume, networkPolicyMediator, podSpecDefaults, requireBestEndpoint, workloadExtraArgs } from './chunk-
|
4
|
+
import { ClusterAccessScope } from './chunk-FKJLPM3M.js';
|
5
|
+
export { ClusterAccessScope } from './chunk-FKJLPM3M.js';
|
6
|
+
export { Deployment } from './chunk-2FKGGWPJ.js';
|
7
|
+
export { StatefulSet } from './chunk-ARG3I734.js';
|
8
|
+
import { Workload, getWorkloadComponents, ConfigMap } from './chunk-HOARC4LU.js';
|
9
|
+
export { ConfigMap, ExposableWorkload, NativeNetworkPolicy, NetworkPolicy, PersistentVolumeClaim, Workload, exposableWorkloadExtraArgs, getAutoVolumeName, getBestEndpoint, getExposableWorkloadComponents, getWorkloadComponents, getWorkloadVolumeResourceUuid, mapContainerEnvironment, mapContainerToRaw, mapEnvironmentSource, mapVolumeMount, mapWorkloadVolume, networkPolicyMediator, podSpecDefaults, requireBestEndpoint, workloadExtraArgs } from './chunk-HOARC4LU.js';
|
10
10
|
export { Service, getServiceType, isEndpointFromCluster, l4EndpointToServicePort, mapContainerPortToServicePort, mapServiceToLabelSelector } from './chunk-SI7X6N46.js';
|
11
|
-
export { Secret } from './chunk-
|
11
|
+
export { Secret } from './chunk-VMEJWYK2.js';
|
12
12
|
export { createK8sTerminal, detectExternalIps } from './chunk-O3ZNJMTN.js';
|
13
13
|
import { commonExtraArgs, Namespace, mapMetadata, getProvider, images_exports } from './chunk-WGMJCZSK.js';
|
14
14
|
export { Namespace, ScopedResource, commonExtraArgs, getNamespaceName, getProvider, getProviderAsync, images_exports as images, mapMetadata, mapNamespaceNameToSelector, mapSelectorLikeToSelector, validateCluster } from './chunk-WGMJCZSK.js';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export { StatefulSet } from './chunk-ARG3I734.js';
|
2
|
+
import './chunk-HOARC4LU.js';
|
3
|
+
import './chunk-SI7X6N46.js';
|
4
|
+
import './chunk-VMEJWYK2.js';
|
5
|
+
import './chunk-WGMJCZSK.js';
|
6
|
+
import './chunk-PZ5AY32C.js';
|
7
|
+
//# sourceMappingURL=stateful-set-OMPM2F7W.js.map
|
8
|
+
//# sourceMappingURL=stateful-set-OMPM2F7W.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"stateful-set-
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"stateful-set-OMPM2F7W.js"}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { Chart } from '../../chunk-
|
2
|
-
import '../../chunk-
|
3
|
-
import '../../chunk-
|
4
|
-
import '../../chunk-
|
1
|
+
import { Chart } from '../../chunk-64LNVTHJ.js';
|
2
|
+
import '../../chunk-2FKGGWPJ.js';
|
3
|
+
import '../../chunk-ARG3I734.js';
|
4
|
+
import '../../chunk-HOARC4LU.js';
|
5
5
|
import '../../chunk-SI7X6N46.js';
|
6
|
-
import '../../chunk-
|
6
|
+
import '../../chunk-VMEJWYK2.js';
|
7
7
|
import { Namespace } from '../../chunk-WGMJCZSK.js';
|
8
8
|
import '../../chunk-PZ5AY32C.js';
|
9
9
|
import { k8s } from '@highstate/library';
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { ClusterAccessScope } from '../../chunk-
|
2
|
-
import { Deployment } from '../../chunk-
|
3
|
-
import { StatefulSet } from '../../chunk-
|
4
|
-
import { PersistentVolumeClaim, ConfigMap } from '../../chunk-
|
1
|
+
import { ClusterAccessScope } from '../../chunk-FKJLPM3M.js';
|
2
|
+
import { Deployment } from '../../chunk-2FKGGWPJ.js';
|
3
|
+
import { StatefulSet } from '../../chunk-ARG3I734.js';
|
4
|
+
import { PersistentVolumeClaim, ConfigMap } from '../../chunk-HOARC4LU.js';
|
5
5
|
import { Service } from '../../chunk-SI7X6N46.js';
|
6
|
-
import { Secret } from '../../chunk-
|
6
|
+
import { Secret } from '../../chunk-VMEJWYK2.js';
|
7
7
|
import { createK8sTerminal } from '../../chunk-O3ZNJMTN.js';
|
8
8
|
import { Namespace } from '../../chunk-WGMJCZSK.js';
|
9
9
|
import '../../chunk-PZ5AY32C.js';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@highstate/k8s",
|
3
|
-
"version": "0.9.
|
3
|
+
"version": "0.9.30",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist",
|
@@ -70,12 +70,12 @@
|
|
70
70
|
"biome:check": "biome check --error-on-warnings"
|
71
71
|
},
|
72
72
|
"dependencies": {
|
73
|
-
"@highstate/cert-manager": "^0.9.
|
74
|
-
"@highstate/common": "^0.9.
|
75
|
-
"@highstate/contract": "^0.9.
|
76
|
-
"@highstate/gateway-api": "^0.9.
|
77
|
-
"@highstate/library": "^0.9.
|
78
|
-
"@highstate/pulumi": "^0.9.
|
73
|
+
"@highstate/cert-manager": "^0.9.30",
|
74
|
+
"@highstate/common": "^0.9.30",
|
75
|
+
"@highstate/contract": "^0.9.30",
|
76
|
+
"@highstate/gateway-api": "^0.9.30",
|
77
|
+
"@highstate/library": "^0.9.30",
|
78
|
+
"@highstate/pulumi": "^0.9.30",
|
79
79
|
"@kubernetes/client-node": "^1.1.0",
|
80
80
|
"@pulumi/command": "^1.0.2",
|
81
81
|
"@pulumi/kubernetes": "^4.18.0",
|
@@ -90,9 +90,9 @@
|
|
90
90
|
},
|
91
91
|
"devDependencies": {
|
92
92
|
"@biomejs/biome": "2.2.0",
|
93
|
-
"@highstate/cli": "^0.9.
|
93
|
+
"@highstate/cli": "^0.9.30",
|
94
94
|
"@typescript/native-preview": "^7.0.0-dev.20250920.1",
|
95
95
|
"type-fest": "^4.41.0"
|
96
96
|
},
|
97
|
-
"gitHead": "
|
97
|
+
"gitHead": "8f5a4724814f573e2172bc0eaf09fcbdd9eb0a4c"
|
98
98
|
}
|
package/src/gateway/gateway.ts
CHANGED
@@ -15,7 +15,6 @@ import {
|
|
15
15
|
output,
|
16
16
|
toPromise,
|
17
17
|
} from "@highstate/pulumi"
|
18
|
-
import { deepmerge } from "deepmerge-ts"
|
19
18
|
import { omit } from "remeda"
|
20
19
|
import { Namespace } from "../namespace"
|
21
20
|
import { commonExtraArgs, getProvider, mapMetadata, type ScopedResourceArgs } from "../shared"
|
@@ -271,7 +270,7 @@ class CreatedGateway extends Gateway {
|
|
271
270
|
name,
|
272
271
|
{
|
273
272
|
metadata: mapMetadata(args, name),
|
274
|
-
spec:
|
273
|
+
spec: omit(args, gatewayExtraArgs),
|
275
274
|
},
|
276
275
|
{ ...opts, parent: this, provider: getProvider(cluster) },
|
277
276
|
)
|
@@ -298,7 +297,7 @@ class GatewayPatch extends Gateway {
|
|
298
297
|
name,
|
299
298
|
{
|
300
299
|
metadata: mapMetadata(args, name),
|
301
|
-
spec:
|
300
|
+
spec: omit(args, gatewayExtraArgs),
|
302
301
|
},
|
303
302
|
{ ...opts, parent: this, provider: getProvider(cluster) },
|
304
303
|
)
|
package/src/secret.ts
CHANGED
@@ -312,12 +312,22 @@ export type ExternalSecretArgs = {
|
|
312
312
|
|
313
313
|
class ExternalSecret extends Secret {
|
314
314
|
constructor(name: string, args: ExternalSecretArgs, opts?: ComponentResourceOptions) {
|
315
|
-
const secret = output(args.namespace).cluster.apply(cluster => {
|
316
|
-
|
315
|
+
const secret = output(args.namespace).cluster.apply(async cluster => {
|
316
|
+
const secret = core.v1.Secret.get(
|
317
317
|
name,
|
318
318
|
interpolate`${output(args.namespace).metadata.name}/${args.name}`,
|
319
319
|
{ ...opts, parent: this, provider: getProvider(cluster) },
|
320
320
|
)
|
321
|
+
|
322
|
+
// TODO: investigate why this needed
|
323
|
+
const namespace = await toPromise(output(args.namespace).metadata.name)
|
324
|
+
const resolvedName = await toPromise(args.name)
|
325
|
+
const metadata = await toPromise(secret.metadata)
|
326
|
+
if (!metadata) {
|
327
|
+
throw new Error(`Secret ${resolvedName} in namespace ${namespace} not found`)
|
328
|
+
}
|
329
|
+
|
330
|
+
return secret
|
321
331
|
})
|
322
332
|
|
323
333
|
super(
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../src/secret.ts"],"names":[],"mappings":";;;;;;AA4BO,IAAe,MAAA,GAAf,MAAe,OAAA,SAAe,cAAA,CAAe;AAAA,EACxC,WAAA,CACR,IAAA,EACA,IAAA,EACA,IA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ACF,CAAC,CAAA;AAED,IAAA,KAAA;AAAA,MACE,8BAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MAEA,MAAA,CAAO,UAAA;AAAA,MACP,MAAA,CAAO,IAAA;AAAA,MACP,MAAA,CAAO,KAAK,SAAS,CAAA;AAAA,MACrB,MAAA,CAAO,QAAA;AAAA,MACP,MAAA,CAAO,IAAA;AAAA,MACP,MAAA,CAAO;AAAA,KACT;AAAA,EACF;AACF,CAAA","file":"chunk-KHNUUVL4.js","sourcesContent":["import type { k8s } from \"@highstate/library\"\nimport { getOrCreate } from \"@highstate/contract\"\nimport { toPromise } from \"@highstate/pulumi\"\nimport { core, type types } from \"@pulumi/kubernetes\"\nimport {\n type ComponentResourceOptions,\n type Input,\n type Inputs,\n interpolate,\n type Output,\n output,\n} from \"@pulumi/pulumi\"\nimport { Namespace } from \"./namespace\"\nimport { getProvider, mapMetadata, ScopedResource, type ScopedResourceArgs } from \"./shared\"\n\nexport type SecretArgs = ScopedResourceArgs &\n Omit<types.input.core.v1.Secret, \"kind\" | \"metadata\" | \"apiVersion\">\n\nexport type CreateOrGetSecretArgs = SecretArgs & {\n /**\n * The secret entity to patch/retrieve.\n */\n existing: Input<k8s.ScopedResource> | undefined\n}\n\n/**\n * Represents a Kubernetes Secret resource with metadata and data.\n */\nexport abstract class Secret extends ScopedResource {\n protected constructor(\n type: string,\n name: string,\n args: Inputs,\n opts: ComponentResourceOptions | undefined,\n\n apiVersion: Output<string>,\n kind: Output<string>,\n namespace: Output<Namespace>,\n metadata: Output<types.output.meta.v1.ObjectMeta>,\n\n /**\n * The data of the underlying Kubernetes secret.\n */\n readonly data: Output<Record<string, string>>,\n\n /**\n * The stringData of the underlying Kubernetes secret.\n */\n readonly stringData: Output<Record<string, string>>,\n ) {\n super(type, name, args, opts, apiVersion, kind, namespace, metadata)\n }\n\n /**\n * The Highstate secret entity.\n */\n get entity(): Output<k8s.ScopedResource> {\n return output({\n type: \"secret\",\n clusterId: this.cluster.id,\n clusterName: this.cluster.name,\n metadata: this.metadata,\n })\n }\n\n /**\n * Gets the value of the secret field by the given key in `data`.\n *\n * Automatically decodes the base64 value.\n *\n * @param key The key of the secret.\n * @returns The value of the secret.\n */\n getValue(key: string): Output<string> {\n return this.data[key].apply(value => Buffer.from(value, \"base64\").toString())\n }\n\n /**\n * Creates a new secret.\n */\n static create(name: string, args: SecretArgs, opts?: ComponentResourceOptions): Secret {\n return new CreatedSecret(name, args, opts)\n }\n\n /**\n * Creates a new secret or patches an existing one.\n *\n * @param name The name of the resource. May not be the same as the secret name.\n * @param args The arguments to create or patch the secret with.\n * @param opts Optional resource options.\n */\n static createOrPatch(\n name: string,\n args: CreateOrGetSecretArgs,\n opts?: ComponentResourceOptions,\n ): Secret {\n if (args.existing) {\n return new SecretPatch(name, {\n ...args,\n name: output(args.existing).metadata.name,\n })\n }\n\n return new CreatedSecret(name, args, opts)\n }\n\n /**\n * Creates a new secret or gets an existing one.\n *\n * @param name The name of the resource. May not be the same as the secret name. Will not be used when existing secret is retrieved.\n * @param args The arguments to create or get the secret with.\n * @param opts Optional resource options.\n */\n static async createOrGet(\n name: string,\n args: CreateOrGetSecretArgs,\n opts?: ComponentResourceOptions,\n ): Promise<Secret> {\n if (args.existing) {\n return await Secret.forAsync(args.existing, output(args.namespace).cluster)\n }\n\n return new CreatedSecret(name, args, opts)\n }\n\n /**\n * Patches an existing secret.\n *\n * Will throw an error if the secret does not exist.\n *\n * @param name The name of the resource. May not be the same as the secret name.\n * @param args The arguments to patch the secret with.\n * @param opts Optional resource options.\n */\n static patch(name: string, args: SecretArgs, opts?: ComponentResourceOptions): Secret {\n return new SecretPatch(name, args, opts)\n }\n\n /**\n * Wraps an existing Kubernetes secret.\n */\n static wrap(name: string, args: WrappedSecretArgs, opts?: ComponentResourceOptions): Secret {\n return new WrappedSecret(name, args, opts)\n }\n\n /**\n * Gets an existing secret.\n *\n * Will throw an error if the secret does not exist.\n */\n static get(name: string, args: ExternalSecretArgs, opts?: ComponentResourceOptions): Secret {\n return new ExternalSecret(name, args, opts)\n }\n\n private static readonly secretCache = new Map<string, Secret>()\n\n /**\n * Gets an existing secret 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}.{name}.{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 secret for.\n * @param cluster The cluster where the secret is located.\n */\n static for(entity: k8s.ScopedResource, cluster: Input<k8s.Cluster>): Secret {\n return getOrCreate(\n Secret.secretCache,\n `${entity.clusterName}.${entity.metadata.namespace}.${entity.metadata.name}.${entity.clusterId}`,\n name => {\n return Secret.get(name, {\n name: entity.metadata.name,\n namespace: Namespace.forResource(entity, cluster),\n })\n },\n )\n }\n\n /**\n * Gets an existing secret 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}.{name}.{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 secret for.\n * @param cluster The cluster where the secret is located.\n */\n static async forAsync(\n entity: Input<k8s.ScopedResource>,\n cluster: Input<k8s.Cluster>,\n ): Promise<Secret> {\n const resolvedEntity = await toPromise(entity)\n return Secret.for(resolvedEntity, cluster)\n }\n}\n\nclass CreatedSecret extends Secret {\n constructor(name: string, args: SecretArgs, opts?: ComponentResourceOptions) {\n const secret = output(args.namespace).cluster.apply(cluster => {\n return new core.v1.Secret(\n name,\n {\n metadata: mapMetadata(args, name),\n data: args.data,\n stringData: args.stringData,\n type: args.type,\n immutable: args.immutable,\n },\n {\n ...opts,\n parent: this,\n provider: getProvider(cluster),\n },\n )\n })\n\n super(\n \"highstate:k8s:Secret\",\n name,\n args,\n opts,\n secret.apiVersion,\n secret.kind,\n output(args.namespace),\n secret.metadata,\n secret.data,\n secret.stringData,\n )\n }\n}\n\nclass SecretPatch extends Secret {\n constructor(name: string, args: SecretArgs, opts?: ComponentResourceOptions) {\n const secret = output(args.namespace).cluster.apply(cluster => {\n return new core.v1.SecretPatch(\n name,\n {\n metadata: mapMetadata(args, name),\n data: args.data,\n stringData: args.stringData,\n type: args.type,\n immutable: args.immutable,\n },\n {\n ...opts,\n parent: this,\n provider: getProvider(cluster),\n },\n )\n })\n\n super(\n \"highstate:k8s:SecretPatch\",\n name,\n args,\n opts,\n secret.apiVersion,\n secret.kind,\n output(args.namespace),\n secret.metadata,\n secret.data,\n secret.stringData,\n )\n }\n}\n\nexport type WrappedSecretArgs = {\n /**\n * The underlying Kubernetes secret to wrap.\n */\n secret: Input<core.v1.Secret>\n\n /**\n * The namespace where the secret is located.\n */\n namespace: Input<Namespace>\n}\n\nclass WrappedSecret extends Secret {\n constructor(name: string, args: WrappedSecretArgs, opts?: ComponentResourceOptions) {\n super(\n \"highstate:k8s:WrappedSecret\",\n name,\n args,\n opts,\n\n output(args.secret).apiVersion,\n output(args.secret).kind,\n output(args.namespace),\n output(args.secret).metadata,\n output(args.secret).data,\n output(args.secret).stringData,\n )\n }\n}\n\nexport type ExternalSecretArgs = {\n /**\n * The name of the secret to get.\n */\n name: Input<string>\n\n /**\n * The namespace where the secret is located.\n */\n namespace: Input<Namespace>\n}\n\nclass ExternalSecret extends Secret {\n constructor(name: string, args: ExternalSecretArgs, opts?: ComponentResourceOptions) {\n const secret = output(args.namespace).cluster.apply(cluster => {\n return core.v1.Secret.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:ExternalSecret\",\n name,\n args,\n opts,\n\n secret.apiVersion,\n secret.kind,\n output(args.namespace),\n secret.metadata,\n secret.data,\n secret.stringData,\n )\n }\n}\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../src/gateway/backend.ts","../src/gateway/gateway.ts","../src/gateway/http-route.ts"],"names":["output","ComponentResource","gateway"],"mappings":";;;;;;;;;AAoCO,SAAS,kBAAkB,GAAA,EA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G,CAAA;AACjF;AAEO,SAAS,sBACd,KAAA,EACkD;AAClD,EAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC7B,IAAA,OAAO,EAAE,IAAA,EAAM,EAAE,MAAM,YAAA,EAAc,KAAA,EAAO,OAAM,EAAE;AAAA,EACtD;AAEA,EAAA,OAAO,KAAA;AACT","file":"chunk-UF3ADZGM.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 { deepmerge } from \"deepmerge-ts\"\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 * This method is idempotent and will return the same instance for the same name/namespace/cluster.\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 return getOrCreate(Gateway.gatewayCache, name, () =>\n Gateway.create(\n fullName,\n {\n ...args,\n name,\n namespace: args.namespace,\n },\n opts,\n ),\n )\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: deepmerge({}, 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: deepmerge({}, 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\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: rule.backend ? [resolveBackendRef(rule.backend)] : undefined,\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"]}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
export { Deployment } from './chunk-PODFA5KM.js';
|
2
|
-
import './chunk-OEGSMSYV.js';
|
3
|
-
import './chunk-SI7X6N46.js';
|
4
|
-
import './chunk-KHNUUVL4.js';
|
5
|
-
import './chunk-WGMJCZSK.js';
|
6
|
-
import './chunk-PZ5AY32C.js';
|
7
|
-
//# sourceMappingURL=deployment-NTLQBNXM.js.map
|
8
|
-
//# sourceMappingURL=deployment-NTLQBNXM.js.map
|
@@ -1,8 +0,0 @@
|
|
1
|
-
export { StatefulSet } from './chunk-5BNGVYWY.js';
|
2
|
-
import './chunk-OEGSMSYV.js';
|
3
|
-
import './chunk-SI7X6N46.js';
|
4
|
-
import './chunk-KHNUUVL4.js';
|
5
|
-
import './chunk-WGMJCZSK.js';
|
6
|
-
import './chunk-PZ5AY32C.js';
|
7
|
-
//# sourceMappingURL=stateful-set-KBJ3EAMW.js.map
|
8
|
-
//# sourceMappingURL=stateful-set-KBJ3EAMW.js.map
|