{
  "repo": "tidbcloud/devops",
  "binary": "jump-pod-agent",
  "binary_path": "cmd/jump-pod-agent/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "extensions": {
    "notes": [
      "The agent exposes no health endpoint. Its steady-state runtime surface is the four jump-pod HTTP handlers plus the fsnotify-triggered rebuild loop.",
      "tailscaled is started as a background child process and all tailscale commands talk to the local Unix socket /tmp/tailscaled.sock."
    ]
  },
  "services": [
    {
      "name": "JumpPodAgentLifecycle",
      "package": "cmd/jump-pod-agent",
      "methods": [
        {
          "name": "Startup",
          "name_key": "JumpPodAgentLifecycle.Startup",
          "input": "--addr + --input-dir + --output-dir",
          "output": "initialized jump pod agent and running HTTP server",
          "type": "local"
        },
        {
          "name": "InitializeStorage",
          "name_key": "JumpPodAgentLifecycle.InitializeStorage",
          "input": "input-dir + output-dir",
          "output": "storage directories plus initial merged kube config",
          "type": "local"
        },
        {
          "name": "StartKubernetesWatcher",
          "name_key": "JumpPodAgentLifecycle.StartKubernetesWatcher",
          "input": "fsnotify watcher on input creds directory",
          "output": "background rebuild on filesystem change",
          "type": "local"
        },
        {
          "name": "StartTailscaled",
          "name_key": "JumpPodAgentLifecycle.StartTailscaled",
          "input": "tailscaled binary + /dev/net/tun",
          "output": "tailscaled background process with local socket",
          "type": "local"
        },
        {
          "name": "StartHTTPServer",
          "name_key": "JumpPodAgentLifecycle.StartHTTPServer",
          "input": "listen address",
          "output": "running Gin HTTP listener",
          "type": "local"
        }
      ]
    },
    {
      "name": "JumpPodAgentWatcher",
      "package": "pkg/service/jump/jumppod/agent",
      "methods": [
        {
          "name": "OnCredDirectoryChange",
          "name_key": "JumpPodAgentWatcher.OnCredDirectoryChange",
          "input": "fsnotify file event",
          "output": "rebuilt merged kube config",
          "type": "local"
        }
      ]
    },
    {
      "name": "JumpPodAgentHTTP",
      "package": "pkg/controller/jump/jump_pod_agent.go",
      "methods": [
        {
          "name": "POST /kubernetes/rebuild",
          "name_key": "HTTP POST /kubernetes/rebuild",
          "input": "none",
          "output": "rebuilt kube config or error",
          "path": "/kubernetes/rebuild",
          "type": "http"
        },
        {
          "name": "POST /tailscale/up",
          "name_key": "HTTP POST /tailscale/up",
          "input": "TailscaleUpRequest",
          "output": "tailscale up success or error",
          "path": "/tailscale/up",
          "type": "http"
        },
        {
          "name": "POST /tailscale/down",
          "name_key": "HTTP POST /tailscale/down",
          "input": "none",
          "output": "tailscale logout success or error",
          "path": "/tailscale/down",
          "type": "http"
        },
        {
          "name": "GET /tailscale/status",
          "name_key": "HTTP GET /tailscale/status",
          "input": "none",
          "output": "TailscaleStatusResponse",
          "path": "/tailscale/status",
          "type": "http"
        }
      ]
    }
  ]
}
