(user params.User, controllerInfo *apiClientController.UpdateControllerOK, controllerURLUpdateErr error)
| 228 | } |
| 229 | |
| 230 | func renderResponseMessage(user params.User, controllerInfo *apiClientController.UpdateControllerOK, controllerURLUpdateErr error) { |
| 231 | headerMsg := `Congrats! Your controller is now initialized. |
| 232 | |
| 233 | Following are the details of the admin user and details about the controller. |
| 234 | |
| 235 | Admin user information: |
| 236 | |
| 237 | %s |
| 238 | ` |
| 239 | |
| 240 | controllerMsg := `Controller information: |
| 241 | |
| 242 | %s |
| 243 | |
| 244 | Make sure that the URLs in the table above are reachable by the relevant parties. |
| 245 | |
| 246 | The metadata and callback URLs *must* be accessible by the runners that GARM spins up. |
| 247 | The base webhook and the controller webhook URLs must be accessible by GitHub or GHES. |
| 248 | ` |
| 249 | |
| 250 | controllerErrorMsg := `WARNING: Failed to set the required controller URLs with error: %q |
| 251 | |
| 252 | Please run: |
| 253 | |
| 254 | garm-cli controller show |
| 255 | |
| 256 | To make sure that the callback, metadata and webhook URLs are set correctly. If not, |
| 257 | you must set them up by running: |
| 258 | |
| 259 | garm-cli controller update \ |
| 260 | --metadata-url=<metadata-url> \ |
| 261 | --callback-url=<callback-url> \ |
| 262 | --webhook-url=<webhook-url> |
| 263 | |
| 264 | See the help message for garm-cli controller update for more information. |
| 265 | ` |
| 266 | var ctrlMsg string |
| 267 | if controllerURLUpdateErr != nil || controllerInfo == nil { |
| 268 | ctrlMsg = fmt.Sprintf(controllerErrorMsg, controllerURLUpdateErr) |
| 269 | } else { |
| 270 | controllerInfoTable := renderControllerInfoTable(controllerInfo.Payload) |
| 271 | ctrlMsg = fmt.Sprintf(controllerMsg, controllerInfoTable) |
| 272 | } |
| 273 | |
| 274 | userTable := renderUserTable(user) |
| 275 | fmt.Printf("%s\n%s\n", fmt.Sprintf(headerMsg, userTable), ctrlMsg) |
| 276 | } |
no test coverage detected