@@ -171,7 +171,7 @@ func Handle(w http.ResponseWriter, r *http.Request) {
171
171
registryClient .namespace = namespace
172
172
173
173
// Get all images
174
- images , err := registryClient .ListImages (context .Background ())
174
+ images , err := registryClient .listImages (context .Background ())
175
175
if err != nil {
176
176
slog .Error (fmt .Sprintf ("failed to get images from namespace: %w." , err ))
177
177
panic (err )
@@ -185,7 +185,7 @@ func Handle(w http.ResponseWriter, r *http.Request) {
185
185
// Process each image
186
186
for _ , image := range images {
187
187
// List tags for the image
188
- tags , err := registryClient .ListTags (context .Background (), image )
188
+ tags , err := registryClient .listTags (context .Background (), image )
189
189
if err != nil {
190
190
slog .Error (fmt .Sprintf ("Failed to list tags for image %s: %v" , image .ID , err ))
191
191
errorImages ++
@@ -206,7 +206,7 @@ func Handle(w http.ResponseWriter, r *http.Request) {
206
206
} else {
207
207
slog .Debug (fmt .Sprintf ("Tag %s doesn't match protection pattern." , tag .Name ))
208
208
// Delete tag if not dry run
209
- if err := registryClient .DeleteTag (context .Background (), tag ); err != nil {
209
+ if err := registryClient .deleteTag (context .Background (), tag ); err != nil {
210
210
slog .Error (fmt .Sprintf ("Failed to delete tag %s (%s): %v" , tag .Name , tag .ID , err ))
211
211
errorTags ++
212
212
continue
@@ -230,8 +230,8 @@ func Handle(w http.ResponseWriter, r *http.Request) {
230
230
// deletedImages, skippedImages, preservedImages, errorImages))
231
231
}
232
232
233
- // DeleteTag deletes a tag
234
- func (r * RegistryClient ) DeleteTag (ctx context.Context , tag * registry.Tag ) error {
233
+ // deleteTag deletes a tag
234
+ func (r * RegistryClient ) deleteTag (ctx context.Context , tag * registry.Tag ) error {
235
235
if r .config .DryRun {
236
236
slog .Info (fmt .Sprintf ("[DRY RUN] Would delete tag: %s (%s)" , tag .Name , tag .ID ))
237
237
return nil
@@ -272,8 +272,8 @@ func (r *RegistryClient) getNamespace(ctx context.Context) (*registry.Namespace,
272
272
return res .Namespaces [0 ], nil
273
273
}
274
274
275
- // ListImages lists all images in the registry namespace
276
- func (r * RegistryClient ) ListImages (ctx context.Context ) ([]* registry.Image , error ) {
275
+ // listImages lists all images in the registry namespace
276
+ func (r * RegistryClient ) listImages (ctx context.Context ) ([]* registry.Image , error ) {
277
277
slog .Info (fmt .Sprintf ("Listing images in namespace: %s" , r .namespace .Name ))
278
278
279
279
var allImages []* registry.Image
@@ -306,8 +306,8 @@ func (r *RegistryClient) ListImages(ctx context.Context) ([]*registry.Image, err
306
306
return allImages , nil
307
307
}
308
308
309
- // ListTags lists all tags for an image
310
- func (r * RegistryClient ) ListTags (ctx context.Context , image * registry.Image ) ([]* registry.Tag , error ) {
309
+ // listTags lists all tags for an image
310
+ func (r * RegistryClient ) listTags (ctx context.Context , image * registry.Image ) ([]* registry.Tag , error ) {
311
311
slog .Info (fmt .Sprintf ("Listing tags for image: %s" , image .Name ))
312
312
313
313
var allTags []* registry.Tag
0 commit comments