Files
zeekayandGitHub 7339594b34 feat(cloud-mount): port ingress to HIP-0106 Mount(*zip.App, cloud.Deps) (#2)
* feat(cloud-mount): port ingress to HIP-0106 Mount(*zip.App, cloud.Deps)

Add pkg/ingress/mount.go (build tag: cloud) exposing the canonical
HIP-0106 contract. Hanzo Ingress is k8s-native: the full reverse-proxy
/ TLS / providers machinery stays in cmd/traefik (standalone
hanzo-ingress at the cluster edge). The unified cloud binary
co-resident with Ingress only needs:

  - /_/ingress/healthz — native zip endpoint so liveness probes survive
    even when the edge proxy is reloading
  - /_/ingress/config — read-only projection of the deployment's
    expected entrypoints / providers / acme state. Sourced from env
    (INGRESS_ENTRYPOINTS, INGRESS_PROVIDERS, INGRESS_ACME_ENABLED).

Nothing else mounts: cloud-mode does NOT import pkg/config/static
(would pull in the entire provider tree: Kubernetes, Docker, Consul,
AWS, Azure, GCP, Cloudflare, Akamai, etc. — every provider stays in
the standalone binary).

Build tag isolation: the standalone hanzo-ingress binary must not pull
hanzoai/cloud + hanzoai/zip. The `//go:build cloud` constraint on
mount.go + mount_test.go keeps the default build path clean. Build the
cloud variant with `-tags=cloud`.

Wiring:
  - init() registers ("ingress", order=90) in cloud.Registry — runs
    after gateway(80) so identity headers are already injected.
  - go.mod gains the hanzoai/cloud + hanzoai/zip requires (gated by
    tag at the import sites), pinned via local ../ replace.

Tests:
  - TestMount_RegistersHealthAndConfig boots a fresh zip.App, mounts
    ingress with sample env, asserts /_/ingress/healthz and
    /_/ingress/config respond with the expected JSON.
  - cmd/traefik (the standalone hanzo-ingress binary) still builds
    clean in the default mode.

Schema: schema/ingress.zap describes Health + Config services for the
zapc codegen path.

* refactor: collapse pkg/ingress/ → root for clean import path

Subsystem code lives in package ingress at repo root. Importers now use
`github.com/hanzoai/ingress` (no /pkg/ingress/ nesting). Standalone shim moved
to cmd/ingress/ where applicable.

Per Hanzo Go-stdlib pattern: repo IS the package.

* refactor: flatten import path — github.com/hanzoai/cloud (drop /pkg/cloud)
2026-05-18 23:37:56 -07:00

38 lines
1016 B
Plaintext

// ingress.zap — ZAP schema for the Hanzo Ingress subsystem.
//
// HIP-0106 unified-binary contract. Hanzo Ingress is k8s-native: the
// full reverse-proxy / TLS / provider machinery runs as the standalone
// hanzo-ingress binary at the cluster edge. The unified cloud binary
// only co-resides for healthz coverage and a read-only config view —
// the Mount surface here matches that scope.
package ingress.v1;
service Health {
// Check returns OK when the ingress mount is wired.
Check(HealthRequest) -> HealthResponse;
}
message HealthRequest {}
message HealthResponse {
string status = 1; // "ok"
string service = 2; // "ingress"
}
service Config {
// Get returns a read-only projection of the ingress runtime config
// for this deployment. Mirrors /_/ingress/config.
Get(ConfigRequest) -> ConfigView;
}
message ConfigRequest {}
message ConfigView {
string brand = 1;
string domain = 2;
repeated string entrypoints = 3;
repeated string providers = 4;
bool acme_enabled = 5;
}