{
  "repo": "tidbcloud/tidb-operator-cse",
  "binary": "controller-manager",
  "binary_path": "cmd/controller-manager/main.go",
  "surface_kind": "controller_service",
  "type": "controller_service",
  "extensions": {
    "notes": [
      "The previous scan incorrectly attached all controller dependencies to /metrics. The real binary has a small HTTP surface and a separate lifecycle that builds clients, upgrades operator assets, starts informers/controllers, and runs leader election.",
      "The lifecycle methods above summarize the actual behavior in cmd/controller-manager/main.go and controller.NewDependencies(...).",
      "HTTPServer only serves Prometheus metrics and pprof on :6060."
    ]
  },
  "services": [
    {
      "name": "ControllerManagerLifecycle",
      "package": "main",
      "methods": [
        {
          "name": "BuildDependencies",
          "name_key": "ControllerManagerLifecycle.BuildDependencies",
          "input": "CLIConfig + rest.Config",
          "output": "Dependencies",
          "type": "local"
        },
        {
          "name": "UpgradeOperator",
          "name_key": "ControllerManagerLifecycle.UpgradeOperator",
          "input": "Dependencies",
          "output": "void",
          "type": "local"
        },
        {
          "name": "StartControllers",
          "name_key": "ControllerManagerLifecycle.StartControllers",
          "input": "Dependencies",
          "output": "void",
          "type": "local"
        },
        {
          "name": "RunLeaderElection",
          "name_key": "ControllerManagerLifecycle.RunLeaderElection",
          "input": "Dependencies",
          "output": "void",
          "type": "local"
        }
      ]
    },
    {
      "name": "HTTPServer",
      "package": "main",
      "methods": [
        {
          "name": "Metrics",
          "name_key": "HTTPServer.Metrics",
          "input": "HTTP GET",
          "output": "Prometheus metrics",
          "path": "/metrics",
          "type": "http"
        },
        {
          "name": "PprofIndex",
          "name_key": "HTTPServer.PprofIndex",
          "input": "HTTP GET",
          "output": "pprof index page",
          "path": "/debug/pprof/",
          "type": "http"
        },
        {
          "name": "PprofCmdline",
          "name_key": "HTTPServer.PprofCmdline",
          "input": "HTTP GET",
          "output": "pprof cmdline data",
          "path": "/debug/pprof/cmdline",
          "type": "http"
        },
        {
          "name": "PprofProfile",
          "name_key": "HTTPServer.PprofProfile",
          "input": "HTTP GET",
          "output": "CPU profile",
          "path": "/debug/pprof/profile",
          "type": "http"
        },
        {
          "name": "PprofSymbol",
          "name_key": "HTTPServer.PprofSymbol",
          "input": "HTTP GET",
          "output": "symbol lookup",
          "path": "/debug/pprof/symbol",
          "type": "http"
        },
        {
          "name": "PprofTrace",
          "name_key": "HTTPServer.PprofTrace",
          "input": "HTTP GET",
          "output": "execution trace",
          "path": "/debug/pprof/trace",
          "type": "http"
        }
      ]
    }
  ]
}
