diff --git a/grails-app/controllers/docker/registry/web/RepositoryController.groovy b/grails-app/controllers/docker/registry/web/RepositoryController.groovy index fee2a90..7951815 100644 --- a/grails-app/controllers/docker/registry/web/RepositoryController.groovy +++ b/grails-app/controllers/docker/registry/web/RepositoryController.groovy @@ -136,10 +136,25 @@ class RepositoryController { } */ log.info "Deleting manifest" - restService.delete("${name}/manifests/${digest}") - //todo: show error/success - } else + def result = restService.delete("${name}/manifests/${digest}") + if (!result.deleted) { + def text = '' + try { + boolean unsupported = result.response.json.errors[0].code == 'UNSUPPORTED' + text = unsupported ? "Deletion disabled in registry, more info." : result.text + } catch (e) { + text = result.text + } + flash.message = "Error deleting ${name}:${tag}: ${text}" + } else { + flash.message = "Tag ${name}:${tag} has been deleted" + flash.success = true + } + } else { log.warn 'Readonly mode!' + flash.message = "Readonly mode!" + } + flash.deleteAction = true redirect action: 'tags', id: params.name } } diff --git a/grails-app/services/docker/registry/web/RestService.groovy b/grails-app/services/docker/registry/web/RestService.groovy index 563fac1..ff6f177 100644 --- a/grails-app/services/docker/registry/web/RestService.groovy +++ b/grails-app/services/docker/registry/web/RestService.groovy @@ -40,7 +40,10 @@ class RestService { def delete(String path) { def rest = new RestBuilder() def res = rest.delete("${registryUrl}/${path}", requestCustomizer) - log.info res.statusCode + + def statusCode = res.statusCode + log.info statusCode + [deleted: statusCode.'2xxSuccessful', response: res] } void init() { diff --git a/grails-app/views/repository/tags.gsp b/grails-app/views/repository/tags.gsp index e05ec40..db1126e 100644 --- a/grails-app/views/repository/tags.gsp +++ b/grails-app/views/repository/tags.gsp @@ -30,7 +30,11 @@
  • Home
  • ${params.id.decodeURL()}
  • - + + +