@crossdelta/infrastructure 0.2.19 → 0.2.21

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.
@@ -3,6 +3,7 @@ import type { Output } from '@pulumi/pulumi';
3
3
  * Gets the image configuration for a given repository.
4
4
  * @param repository - The name of the repository.
5
5
  * @returns The image configuration.
6
+ * @deprecated Use project-specific config helper instead
6
7
  */
7
8
  export declare const getImage: (repository: string, registryCredentials: Output<string>) => {
8
9
  registryType: any;
package/dist/index.cjs CHANGED
@@ -338028,15 +338028,24 @@ function deployK8sService(provider, namespace, config2) {
338028
338028
  if (config2.ingress.tls?.enabled) {
338029
338029
  ingressAnnotations["cert-manager.io/cluster-issuer"] = config2.ingress.tls.issuerName ?? "letsencrypt-production";
338030
338030
  }
338031
- const tlsSecretName = config2.ingress.tls?.secretName ?? (config2.ingress.host ? `${config2.ingress.host.replace(/\./g, "-")}-tls` : `${config2.name}-tls`);
338031
+ let ingressPath = config2.ingress.path;
338032
+ let ingressPathType = config2.ingress.pathType ?? "Prefix";
338033
+ const shouldStripPrefix = config2.ingress.path !== "/" && !config2.ingress.keepPrefix;
338034
+ if (shouldStripPrefix) {
338035
+ ingressPath = `${config2.ingress.path}(/|$)(.*)`;
338036
+ ingressPathType = "ImplementationSpecific";
338037
+ ingressAnnotations["nginx.ingress.kubernetes.io/use-regex"] = "true";
338038
+ ingressAnnotations["nginx.ingress.kubernetes.io/rewrite-target"] = "/$2";
338039
+ }
338040
+ const tlsSecretName = config2.ingress.tls?.secretName ?? `${config2.name}-tls`;
338032
338041
  const ingressRules = [];
338033
338042
  const createRule = (host) => ({
338034
338043
  ...host && { host },
338035
338044
  http: {
338036
338045
  paths: [
338037
338046
  {
338038
- path: config2.ingress.path,
338039
- pathType: config2.ingress.pathType ?? "Prefix",
338047
+ path: ingressPath,
338048
+ pathType: ingressPathType,
338040
338049
  backend: {
338041
338050
  service: {
338042
338051
  name: config2.name,
package/dist/index.js CHANGED
@@ -337953,15 +337953,24 @@ function deployK8sService(provider, namespace, config2) {
337953
337953
  if (config2.ingress.tls?.enabled) {
337954
337954
  ingressAnnotations["cert-manager.io/cluster-issuer"] = config2.ingress.tls.issuerName ?? "letsencrypt-production";
337955
337955
  }
337956
- const tlsSecretName = config2.ingress.tls?.secretName ?? (config2.ingress.host ? `${config2.ingress.host.replace(/\./g, "-")}-tls` : `${config2.name}-tls`);
337956
+ let ingressPath = config2.ingress.path;
337957
+ let ingressPathType = config2.ingress.pathType ?? "Prefix";
337958
+ const shouldStripPrefix = config2.ingress.path !== "/" && !config2.ingress.keepPrefix;
337959
+ if (shouldStripPrefix) {
337960
+ ingressPath = `${config2.ingress.path}(/|$)(.*)`;
337961
+ ingressPathType = "ImplementationSpecific";
337962
+ ingressAnnotations["nginx.ingress.kubernetes.io/use-regex"] = "true";
337963
+ ingressAnnotations["nginx.ingress.kubernetes.io/rewrite-target"] = "/$2";
337964
+ }
337965
+ const tlsSecretName = config2.ingress.tls?.secretName ?? `${config2.name}-tls`;
337957
337966
  const ingressRules = [];
337958
337967
  const createRule = (host) => ({
337959
337968
  ...host && { host },
337960
337969
  http: {
337961
337970
  paths: [
337962
337971
  {
337963
- path: config2.ingress.path,
337964
- pathType: config2.ingress.pathType ?? "Prefix",
337972
+ path: ingressPath,
337973
+ pathType: ingressPathType,
337965
337974
  backend: {
337966
337975
  service: {
337967
337976
  name: config2.name,
@@ -116,8 +116,18 @@ export interface K8sHealthCheck {
116
116
  export interface K8sIngressConfig {
117
117
  /** Path prefix for routing (e.g., '/', '/api') */
118
118
  path: string;
119
- /** Path type: 'Prefix' (default) or 'Exact' */
120
- pathType?: 'Prefix' | 'Exact';
119
+ /** Path type: 'Prefix' (default), 'Exact', or 'ImplementationSpecific' (for regex) */
120
+ pathType?: 'Prefix' | 'Exact' | 'ImplementationSpecific';
121
+ /**
122
+ * Keep the path prefix when forwarding to the service (default: false).
123
+ *
124
+ * By default, the path prefix is stripped:
125
+ * path='/api': /api/health -> /health
126
+ *
127
+ * With keepPrefix=true:
128
+ * path='/api': /api/health -> /api/health
129
+ */
130
+ keepPrefix?: boolean;
121
131
  /** Custom annotations for the ingress */
122
132
  annotations?: Record<string, string>;
123
133
  /** Hostname for the ingress (required for TLS) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossdelta/infrastructure",
3
- "version": "0.2.19",
3
+ "version": "0.2.21",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {