Skip to content

Commit c376477

Browse files
committed
Simplify async API: remove sse for now
1 parent 4e13b7c commit c376477

File tree

11 files changed

+170
-929
lines changed

11 files changed

+170
-929
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ sudo mkdir /var/lib/hypeman
3333
sudo chown $USER:$USER /var/lib/hypeman
3434
```
3535

36+
#### Dockerhub login
37+
38+
Requires Docker Hub authentication to avoid rate limits when running the tests:
39+
```bash
40+
docker login
41+
```
42+
43+
Docker itself isn't required to be installed. `~/.docker/config.json` is a standard used for handling registry authentication.
44+
3645
### Build
3746

3847
```bash

cmd/api/api/images.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -70,33 +70,6 @@ func (s *ApiService) GetImage(ctx context.Context, request oapi.GetImageRequestO
7070
return oapi.GetImage200JSONResponse(*img), nil
7171
}
7272

73-
// GetImageProgress streams build progress via SSE
74-
func (s *ApiService) GetImageProgress(ctx context.Context, request oapi.GetImageProgressRequestObject) (oapi.GetImageProgressResponseObject, error) {
75-
log := logger.FromContext(ctx)
76-
77-
progressChan, err := s.ImageManager.GetProgress(ctx, request.Id)
78-
if err != nil {
79-
switch {
80-
case errors.Is(err, images.ErrNotFound):
81-
return oapi.GetImageProgress404JSONResponse{
82-
Code: "not_found",
83-
Message: "image not found",
84-
}, nil
85-
default:
86-
log.Error("failed to get progress", "error", err, "id", request.Id)
87-
return oapi.GetImageProgress500JSONResponse{
88-
Code: "internal_error",
89-
Message: "failed to get progress",
90-
}, nil
91-
}
92-
}
93-
94-
// Return SSE stream (uses helper from progress.go)
95-
return oapi.GetImageProgress200TexteventStreamResponse{
96-
Body: images.ToSSEReader(progressChan),
97-
}, nil
98-
}
99-
10073
// DeleteImage deletes an image
10174
func (s *ApiService) DeleteImage(ctx context.Context, request oapi.DeleteImageRequestObject) (oapi.DeleteImageResponseObject, error) {
10275
log := logger.FromContext(ctx)

cmd/api/api/images_test.go

Lines changed: 0 additions & 154 deletions
This file was deleted.

lib/images/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,16 @@ OCI Registry → containers/image → OCI Layout → umoci → rootfs/ → mkfs.
6868

6969
Requires `-tags containers_image_openpgp` to avoid C dependency on gpgme. This is a build-time option of the containers/image project to select between gpgme C library with go bindings or the pure Go OpenPGP implementation (slightly slower but doesn't need external system dependency).
7070

71-
## Testing
71+
## Registry Authentication
7272

73-
Integration tests pull alpine:latest (~7MB) and verify full pipeline. No special permissions required.
73+
containers/image automatically uses `~/.docker/config.json` for registry authentication.
7474

75+
```bash
76+
# Login to Docker Hub (avoid rate limits)
77+
docker login
78+
79+
# Works for any registry
80+
docker login ghcr.io
81+
```
82+
83+
No code changes needed - credentials are automatically discovered.

0 commit comments

Comments
 (0)