(info params.ControllerInfo)
| 479 | } |
| 480 | |
| 481 | func renderControllerInfoTable(info params.ControllerInfo) string { |
| 482 | t := table.NewWriter() |
| 483 | header := table.Row{"Field", "Value"} |
| 484 | |
| 485 | if info.WebhookURL == "" { |
| 486 | info.WebhookURL = "N/A" |
| 487 | } |
| 488 | |
| 489 | if info.ControllerWebhookURL == "" { |
| 490 | info.ControllerWebhookURL = "N/A" |
| 491 | } |
| 492 | serverVersion := "v0.0.0-unknown" |
| 493 | if info.Version != "" { |
| 494 | serverVersion = info.Version |
| 495 | } |
| 496 | t.AppendHeader(header) |
| 497 | t.AppendRow(table.Row{"Controller ID", info.ControllerID}) |
| 498 | if info.Hostname != "" { |
| 499 | t.AppendRow(table.Row{"Hostname", info.Hostname}) |
| 500 | } |
| 501 | t.AppendRow(table.Row{"Metadata URL", info.MetadataURL}) |
| 502 | t.AppendRow(table.Row{"Callback URL", info.CallbackURL}) |
| 503 | t.AppendRow(table.Row{"Webhook Base URL", info.WebhookURL}) |
| 504 | t.AppendRow(table.Row{"Controller Webhook URL", info.ControllerWebhookURL}) |
| 505 | t.AppendRow(table.Row{"Agent URL", info.AgentURL}) |
| 506 | t.AppendRow(table.Row{"GARM agent tools sync URL", info.GARMAgentReleasesURL}) |
| 507 | t.AppendRow(table.Row{"Tools sync enabled", info.SyncGARMAgentTools}) |
| 508 | t.AppendRow(table.Row{"Minimum Job Age Backoff", info.MinimumJobAgeBackoff}) |
| 509 | t.AppendRow(table.Row{"Version", serverVersion}) |
| 510 | if len(info.CACertBundle) > 0 { |
| 511 | t.AppendRow(table.Row{"CA Cert Bundle", string(info.CACertBundle)}) |
| 512 | } |
| 513 | return t.Render() |
| 514 | } |
| 515 | |
| 516 | func formatInfo(info params.ControllerInfo) error { |
| 517 | if outputFormat == common.OutputFormatJSON { |
no outgoing calls
no test coverage detected