Comments (3)
I would suggest;
- (if possible); check if the repo exists before prompting, and print a error "tag/image
foo:bar
does not exist" - For removing a single tag, perhaps a
[yN]
is sufficient (I can see having to type the whole name being more useful for removing a whole repository (if it has multiple tags) --force
should just do that; remove if exists, and ignore if it was found already (same asrm -f nosuchfile
ignores non-existing files/directories)
For the warning printed, make it more clear that it's a destructive operation; something like
WARNING: you are about to permanently delete foo:bar.
This operation cannot be reversed!
Are you sure you want to continue? [yN]
from hub-tool.
Looks like the same issue exists for repo rm
. I'm working out how best to fix this (i.e.: in the client or in the CLI)
from hub-tool.
When using -f
the command should really exit with exit code 0, if the tag does not exist, so that this can easily be used in automation.
hub-tool tag rm -f user/tool:tag
Maybe with something like this:
diff -ur hub-tool/internal/commands/tag/rm.go hub-tool-envlogin/internal/commands/tag/rm.go
--- hub-tool/internal/commands/tag/rm.go 2022-01-05 13:04:09.000000000 -0800
+++ hub-tool-envlogin/internal/commands/tag/rm.go 2022-01-05 13:04:58.000000000 -0800
@@ -96,7 +96,12 @@
}
if err := hubClient.RemoveTag(reference.FamiliarName(ref), ref.Tag()); err != nil {
- return err
+ if strings.Contains(err.Error(), "404 NOT FOUND") {
+ fmt.Fprintln(streams.Out(), "Not Found", image)
+ return nil
+ } else {
+ return err
+ }
}
fmt.Fprintln(streams.Out(), "Deleted", image)
return nil
from hub-tool.
Related Issues (20)
- Feature Request: authenticated api/https request HOT 5
- Error: username differs from your username, deletion aborted HOT 1
- Cannot configure a scopes for new personal access token HOT 4
- need my api not the hackers connected
- cannot login: Error: failed to authenticate: bad status code "400 Bad Request": malformed request: EOF HOT 1
- Docker Hub UI Issue
- Release v0.4.4 download links are for v0.4.1 HOT 2
- docker hub login fails HOT 3
- 500 Internal Server Error on `hub-tool tag rm --force <tag name>` HOT 2
- Management of Organizations (Teams & Users) HOT 1
- Feature request: Add non interactive OPTION on remove ( ex: hub-tool tag rm --yes ... ) HOT 1
- login with personal access token fails HOT 1
- make fails for hub-tool
- Monodb version is outdated in docker hub
- Monodb version is outdated in docker hub
- I don't understand the rate limiting... and bulk operations HOT 1
- add unit tests for `plan.go`
- Postman
- GetOrganizations API is returning unmarshal error
- Flag for removing all repos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hub-tool.