{
  "repo": "tidbcloud/infra-api",
  "binary": "infra-provider",
  "binary_path": "cmd/infra-provider/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "services": [
    {
      "name": "InfraProviderLifecycle",
      "package": "cmd/infra-provider",
      "methods": [
        {
          "name": "LoadFlagsAndLogger",
          "name_key": "Runtime InfraProviderLifecycle.LoadFlagsAndLogger",
          "input": "metrics-bind-address, pprof, health-probe-bind-address, leader-elect, config, namespace, enable-gitops-v2, enable-o11y-agent",
          "output": "parsed runtime flags and zap logger",
          "type": "local"
        },
        {
          "name": "LoadControllerConfig",
          "name_key": "Runtime InfraProviderLifecycle.LoadControllerConfig",
          "input": "optional controller config file",
          "output": "ctrl.Options merged with config file values",
          "type": "local"
        },
        {
          "name": "ValidateControllerConfig",
          "name_key": "Runtime InfraProviderLifecycle.ValidateControllerConfig",
          "input": "InfraAPIConfig",
          "output": "defaulted and validated controller configuration",
          "type": "local"
        },
        {
          "name": "OverrideGardenerConfigFromEnv",
          "name_key": "Runtime InfraProviderLifecycle.OverrideGardenerConfigFromEnv",
          "input": "GARDENER_CONFIG",
          "output": "gardener kubeconfig path overridden from environment when present",
          "type": "local"
        },
        {
          "name": "CreateManager",
          "name_key": "Runtime InfraProviderLifecycle.CreateManager",
          "input": "controller-runtime options",
          "output": "manager with metrics, probe, webhook, and cache servers",
          "type": "local"
        },
        {
          "name": "LoadProviderClients",
          "name_key": "Runtime InfraProviderLifecycle.LoadProviderClients",
          "input": "ambient AWS config, default GCP credentials, config-service URL",
          "output": "AWS client, GCP API, and config-service SDK initialized",
          "type": "local"
        },
        {
          "name": "InitO11yApi",
          "name_key": "Runtime InfraProviderLifecycle.InitO11yApi",
          "input": "o11y config plus Auth0 credentials",
          "output": "o11y API client initialized when enable-o11y-agent is true",
          "type": "local"
        },
        {
          "name": "InitGardenerEnvironment",
          "name_key": "Runtime InfraProviderLifecycle.InitGardenerEnvironment",
          "input": "gardener config and shoot reconciler registers",
          "output": "gardener manager and shoot environment initialized",
          "type": "local"
        },
        {
          "name": "RegisterControllers",
          "name_key": "Runtime InfraProviderLifecycle.RegisterControllers",
          "input": "manager, gardener environment, provider clients, config, and feature flags",
          "output": "all controllers registered with controller-runtime",
          "type": "local"
        },
        {
          "name": "RegisterWebhooks",
          "name_key": "Runtime InfraProviderLifecycle.RegisterWebhooks",
          "input": "manager and PeeringCreator",
          "output": "resource defaulting and validating webhooks registered when ENABLE_WEBHOOKS != false",
          "type": "local"
        },
        {
          "name": "RegisterHealthAndPprof",
          "name_key": "Runtime InfraProviderLifecycle.RegisterHealthAndPprof",
          "input": "manager plus pprof flag",
          "output": "healthz, readyz, and optional pprof handlers registered",
          "type": "local"
        },
        {
          "name": "SetupAudit",
          "name_key": "Runtime InfraProviderLifecycle.SetupAudit",
          "input": "AuditConfig",
          "output": "audit credential getter and sidecar template overrides configured",
          "type": "local"
        },
        {
          "name": "StartLeaderWorker",
          "name_key": "Runtime InfraProviderLifecycle.StartLeaderWorker",
          "input": "manager-elected channel and signal-aware context",
          "output": "leader-only metrics collectors and gardener environment managers started",
          "type": "local"
        },
        {
          "name": "StartManager",
          "name_key": "Runtime InfraProviderLifecycle.StartManager",
          "input": "signal-aware context",
          "output": "controller-runtime manager running all controllers and HTTP surfaces",
          "type": "local"
        }
      ]
    },
    {
      "name": "InfraProviderController",
      "package": "controllers + pkg/gardener/hibernation",
      "methods": [
        {
          "name": "ProviderTypeReconcile",
          "name_key": "Runtime InfraProviderController.ProviderTypeReconcile",
          "input": "ProviderType reconcile request",
          "output": "finalizer maintained until dependent Provider resources are gone",
          "type": "controller_runtime"
        },
        {
          "name": "ClusterReconcile",
          "name_key": "Runtime InfraProviderController.ClusterReconcile",
          "input": "Cluster reconcile request",
          "output": "cluster infrastructure observed, created, updated, or deleted across infra and gardener control planes",
          "type": "controller_runtime"
        },
        {
          "name": "NetworkReconcile",
          "name_key": "Runtime InfraProviderController.NetworkReconcile",
          "input": "Network reconcile request",
          "output": "network infrastructure observed and reconciled for the resolved provider type",
          "type": "controller_runtime"
        },
        {
          "name": "HibernationReconcile",
          "name_key": "Runtime InfraProviderController.HibernationReconcile",
          "input": "Shoot reconcile request",
          "output": "cached shoot context canceled when the shoot changes",
          "type": "controller_runtime"
        },
        {
          "name": "HibernationEstimatorLoop",
          "name_key": "Runtime InfraProviderController.HibernationEstimatorLoop",
          "input": "periodic idle-check ticker",
          "output": "idle shoots hibernated when network and cluster conditions allow it",
          "type": "background_worker"
        },
        {
          "name": "NetworkPeerReconcile",
          "name_key": "Runtime InfraProviderController.NetworkPeerReconcile",
          "input": "NetworkPeer reconcile request",
          "output": "network peering observed, created, updated, or deleted",
          "type": "controller_runtime"
        },
        {
          "name": "ImportReconcile",
          "name_key": "Runtime InfraProviderController.ImportReconcile",
          "input": "Import reconcile request",
          "output": "import infrastructure observed, created, updated, or deleted",
          "type": "controller_runtime"
        },
        {
          "name": "BackupReconcile",
          "name_key": "Runtime InfraProviderController.BackupReconcile",
          "input": "Backup reconcile request",
          "output": "backup infrastructure observed, created, updated, or deleted",
          "type": "controller_runtime"
        },
        {
          "name": "RestoreReconcile",
          "name_key": "Runtime InfraProviderController.RestoreReconcile",
          "input": "Restore reconcile request",
          "output": "restore infrastructure observed, created, updated, or deleted",
          "type": "controller_runtime"
        },
        {
          "name": "TiCDCReconcile",
          "name_key": "Runtime InfraProviderController.TiCDCReconcile",
          "input": "TiCDC reconcile request",
          "output": "TiCDC infrastructure observed, created, updated, or deleted",
          "type": "controller_runtime"
        }
      ]
    },
    {
      "name": "InfraProviderWebhookHTTP",
      "package": "api/v1",
      "type": "http",
      "methods": [
        {
          "name": "POST /mutate-cloud-pingcap-com-v1-account",
          "name_key": "HTTP POST /mutate-cloud-pingcap-com-v1-account",
          "path": "/mutate-cloud-pingcap-com-v1-account",
          "http_method": "POST",
          "input": "Account admission review",
          "output": "defaulted Account object",
          "type": "webhook"
        },
        {
          "name": "POST /validate-cloud-pingcap-com-v1-account",
          "name_key": "HTTP POST /validate-cloud-pingcap-com-v1-account",
          "path": "/validate-cloud-pingcap-com-v1-account",
          "http_method": "POST",
          "input": "Account admission review",
          "output": "validation result for Account create/update",
          "type": "webhook"
        },
        {
          "name": "POST /mutate-cloud-pingcap-com-v1-providertype",
          "name_key": "HTTP POST /mutate-cloud-pingcap-com-v1-providertype",
          "path": "/mutate-cloud-pingcap-com-v1-providertype",
          "http_method": "POST",
          "input": "ProviderType admission review",
          "output": "defaulted ProviderType object",
          "type": "webhook"
        },
        {
          "name": "POST /validate-cloud-pingcap-com-v1-providertype",
          "name_key": "HTTP POST /validate-cloud-pingcap-com-v1-providertype",
          "path": "/validate-cloud-pingcap-com-v1-providertype",
          "http_method": "POST",
          "input": "ProviderType admission review",
          "output": "validation result for ProviderType create/update",
          "type": "webhook"
        },
        {
          "name": "POST /mutate-cloud-pingcap-com-v1-provider",
          "name_key": "HTTP POST /mutate-cloud-pingcap-com-v1-provider",
          "path": "/mutate-cloud-pingcap-com-v1-provider",
          "http_method": "POST",
          "input": "Provider admission review",
          "output": "defaulted Provider object",
          "type": "webhook"
        },
        {
          "name": "POST /validate-cloud-pingcap-com-v1-provider",
          "name_key": "HTTP POST /validate-cloud-pingcap-com-v1-provider",
          "path": "/validate-cloud-pingcap-com-v1-provider",
          "http_method": "POST",
          "input": "Provider admission review",
          "output": "validation result for Provider create/update",
          "type": "webhook"
        },
        {
          "name": "POST /mutate-cloud-pingcap-com-v1-networkpeer",
          "name_key": "HTTP POST /mutate-cloud-pingcap-com-v1-networkpeer",
          "path": "/mutate-cloud-pingcap-com-v1-networkpeer",
          "http_method": "POST",
          "input": "NetworkPeer admission review",
          "output": "defaulted NetworkPeer object",
          "type": "webhook"
        },
        {
          "name": "POST /validate-cloud-pingcap-com-v1-networkpeer",
          "name_key": "HTTP POST /validate-cloud-pingcap-com-v1-networkpeer",
          "path": "/validate-cloud-pingcap-com-v1-networkpeer",
          "http_method": "POST",
          "input": "NetworkPeer admission review",
          "output": "validation result for NetworkPeer create/update",
          "type": "webhook"
        },
        {
          "name": "POST /mutate-cloud-pingcap-com-v1-import",
          "name_key": "HTTP POST /mutate-cloud-pingcap-com-v1-import",
          "path": "/mutate-cloud-pingcap-com-v1-import",
          "http_method": "POST",
          "input": "Import admission review",
          "output": "defaulted Import object",
          "type": "webhook"
        },
        {
          "name": "POST /validate-cloud-pingcap-com-v1-import",
          "name_key": "HTTP POST /validate-cloud-pingcap-com-v1-import",
          "path": "/validate-cloud-pingcap-com-v1-import",
          "http_method": "POST",
          "input": "Import admission review",
          "output": "validation result for Import create/update",
          "type": "webhook"
        },
        {
          "name": "POST /mutate-cloud-pingcap-com-v1-network",
          "name_key": "HTTP POST /mutate-cloud-pingcap-com-v1-network",
          "path": "/mutate-cloud-pingcap-com-v1-network",
          "http_method": "POST",
          "input": "Network admission review",
          "output": "defaulted Network object",
          "type": "webhook"
        },
        {
          "name": "POST /validate-cloud-pingcap-com-v1-network",
          "name_key": "HTTP POST /validate-cloud-pingcap-com-v1-network",
          "path": "/validate-cloud-pingcap-com-v1-network",
          "http_method": "POST",
          "input": "Network admission review",
          "output": "validation result for Network create/update",
          "type": "webhook"
        },
        {
          "name": "POST /mutate-cloud-pingcap-com-v1-cluster",
          "name_key": "HTTP POST /mutate-cloud-pingcap-com-v1-cluster",
          "path": "/mutate-cloud-pingcap-com-v1-cluster",
          "http_method": "POST",
          "input": "Cluster admission review",
          "output": "defaulted Cluster object",
          "type": "webhook"
        },
        {
          "name": "POST /validate-cloud-pingcap-com-v1-cluster",
          "name_key": "HTTP POST /validate-cloud-pingcap-com-v1-cluster",
          "path": "/validate-cloud-pingcap-com-v1-cluster",
          "http_method": "POST",
          "input": "Cluster admission review",
          "output": "validation result for Cluster create/update",
          "type": "webhook"
        },
        {
          "name": "POST /mutate-cloud-pingcap-com-v1-backup",
          "name_key": "HTTP POST /mutate-cloud-pingcap-com-v1-backup",
          "path": "/mutate-cloud-pingcap-com-v1-backup",
          "http_method": "POST",
          "input": "Backup admission review",
          "output": "defaulted Backup object",
          "type": "webhook"
        },
        {
          "name": "POST /validate-cloud-pingcap-com-v1-backup",
          "name_key": "HTTP POST /validate-cloud-pingcap-com-v1-backup",
          "path": "/validate-cloud-pingcap-com-v1-backup",
          "http_method": "POST",
          "input": "Backup admission review",
          "output": "validation result for Backup create/update",
          "type": "webhook"
        },
        {
          "name": "POST /mutate-cloud-pingcap-com-v1-restore",
          "name_key": "HTTP POST /mutate-cloud-pingcap-com-v1-restore",
          "path": "/mutate-cloud-pingcap-com-v1-restore",
          "http_method": "POST",
          "input": "Restore admission review",
          "output": "defaulted Restore object",
          "type": "webhook"
        },
        {
          "name": "POST /validate-cloud-pingcap-com-v1-restore",
          "name_key": "HTTP POST /validate-cloud-pingcap-com-v1-restore",
          "path": "/validate-cloud-pingcap-com-v1-restore",
          "http_method": "POST",
          "input": "Restore admission review",
          "output": "validation result for Restore create/update",
          "type": "webhook"
        },
        {
          "name": "POST /mutate-cloud-pingcap-com-v1-ticdc",
          "name_key": "HTTP POST /mutate-cloud-pingcap-com-v1-ticdc",
          "path": "/mutate-cloud-pingcap-com-v1-ticdc",
          "http_method": "POST",
          "input": "TiCDC admission review",
          "output": "defaulted TiCDC object",
          "type": "webhook"
        },
        {
          "name": "POST /validate-cloud-pingcap-com-v1-ticdc",
          "name_key": "HTTP POST /validate-cloud-pingcap-com-v1-ticdc",
          "path": "/validate-cloud-pingcap-com-v1-ticdc",
          "http_method": "POST",
          "input": "TiCDC admission review",
          "output": "validation result for TiCDC create/update",
          "type": "webhook"
        }
      ]
    },
    {
      "name": "InfraProviderMetricsHTTP",
      "package": "controller-runtime metrics server",
      "type": "http",
      "methods": [
        {
          "name": "ANY /metrics",
          "name_key": "HTTP GET /metrics",
          "path": "/metrics",
          "http_method": "ANY",
          "input": "Prometheus scrape request",
          "output": "controller-runtime and custom infra metrics payload",
          "type": "http"
        }
      ]
    },
    {
      "name": "InfraProviderProbeHTTP",
      "package": "controller-runtime probe server",
      "type": "http",
      "methods": [
        {
          "name": "GET /healthz",
          "name_key": "HTTP GET /healthz",
          "path": "/healthz",
          "http_method": "GET",
          "input": "none",
          "output": "healthz ping response",
          "type": "http"
        },
        {
          "name": "GET /readyz",
          "name_key": "HTTP GET /readyz",
          "path": "/readyz",
          "http_method": "GET",
          "input": "none",
          "output": "readyz ping response",
          "type": "http"
        }
      ]
    },
    {
      "name": "InfraProviderPprofHTTP",
      "package": "controller-runtime metrics extra handlers",
      "type": "http",
      "methods": [
        {
          "name": "GET /debug/pprof/",
          "name_key": "HTTP GET /debug/pprof/",
          "path": "/debug/pprof/",
          "http_method": "GET",
          "input": "none",
          "output": "pprof index page",
          "type": "http"
        },
        {
          "name": "GET /debug/pprof/cmdline",
          "name_key": "HTTP GET /debug/pprof/cmdline",
          "path": "/debug/pprof/cmdline",
          "http_method": "GET",
          "input": "none",
          "output": "pprof cmdline payload",
          "type": "http"
        },
        {
          "name": "GET /debug/pprof/profile",
          "name_key": "HTTP GET /debug/pprof/profile",
          "path": "/debug/pprof/profile",
          "http_method": "GET",
          "input": "none",
          "output": "pprof CPU profile payload",
          "type": "http"
        },
        {
          "name": "GET /debug/pprof/symbol",
          "name_key": "HTTP GET /debug/pprof/symbol",
          "path": "/debug/pprof/symbol",
          "http_method": "GET",
          "input": "none",
          "output": "pprof symbol payload",
          "type": "http"
        },
        {
          "name": "GET /debug/pprof/trace",
          "name_key": "HTTP GET /debug/pprof/trace",
          "path": "/debug/pprof/trace",
          "http_method": "GET",
          "input": "none",
          "output": "pprof trace payload",
          "type": "http"
        }
      ]
    }
  ],
  "extensions": {
    "notes": [
      "This binary is not just a set of reconcilers. It also conditionally exposes 20 admission webhook handlers, metrics, probes, optional pprof handlers, and a leader-gated background worker that starts the gardener environment after election.",
      "The metrics collector registration and gardenerEnv.Start() are deferred until mgr.Elected() fires, so they are runtime-critical side effects that old controller-only scans miss.",
      "Webhook exposure is conditional on ENABLE_WEBHOOKS != false, and pprof exposure is conditional on the --pprof flag."
    ]
  }
}
