Add: Docker configuration testing in config command

This commit is contained in:
2026-09-04 20:40:53 +05:00
parent 5315a4e0ff
commit 5c2b34b742
+12
View File
@@ -26,10 +26,12 @@ func CmdConfig() *cli.Command {
func CmdTestConfig(_ context.Context, _ *cli.Command) error {
testMain := testMainConfig()
testDocker, _ := testDockerConfig()
fmt.Println(
"***\n"+i18n.Lang.T("cmd.daemon.config.test.settingTitle"),
"\n", testMain,
"\n", testDocker,
"\n***",
)
return nil
@@ -48,6 +50,16 @@ func testMainConfig() string {
return resultOk(configTitle)
}
func testDockerConfig() (message string, dockerSupport bool) {
configTitle := "docker"
_, dockerSupport, err := setting.Config.OtherSettingsPath.ToDockerConfig(setting.Config.BinaryLocations)
if err != nil {
return resultError(configTitle, err), false
}
return resultOk(configTitle), dockerSupport
}
func resultOk(title string) string {
return fmt.Sprintf("%s: \033[32mOk\033[0m", title)
}