refactor: use nginx -s reload instead of systemd

- doc: add comment
This commit is contained in:
2026-08-17 10:10:14 +08:00
parent 79f18fcdea
commit f536987a7e
62 changed files with 2216 additions and 598 deletions
+3
View File
@@ -5,6 +5,7 @@ import (
"testing"
)
// TestDecodeImageLoadResponseConsumesCompleteSuccessStream 验证成功流中的多条消息能被完整消费且不产生错误。
func TestDecodeImageLoadResponseConsumesCompleteSuccessStream(t *testing.T) {
t.Parallel()
input := strings.NewReader("{\"stream\":\"Loaded image: repository:20260814-093609-d7ed70f0-v1.1.8.1\\n\"}\n" +
@@ -14,6 +15,7 @@ func TestDecodeImageLoadResponseConsumesCompleteSuccessStream(t *testing.T) {
}
}
// TestDecodeImageLoadResponseReturnsStreamError 验证包含错误详情字段的消息会被解析为对应错误返回。
func TestDecodeImageLoadResponseReturnsStreamError(t *testing.T) {
t.Parallel()
err := decodeImageLoadResponse(strings.NewReader(`{"errorDetail":{"code":500,"message":"load failed"}}`))
@@ -22,6 +24,7 @@ func TestDecodeImageLoadResponseReturnsStreamError(t *testing.T) {
}
}
// TestDecodeImageLoadResponseRejectsMalformedJSON 验证格式错误的 JSON 输入会返回解码错误。
func TestDecodeImageLoadResponseRejectsMalformedJSON(t *testing.T) {
t.Parallel()
err := decodeImageLoadResponse(strings.NewReader(`{"stream":`))