Add proof of concept server ls comand #2
No reviewers
Labels
No Milestone
No project
No Assignees
3 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/go-abra#2
Loading…
Reference in New Issue
No description provided.
Delete Branch "knoflook/go-abra:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi knoflook, thanks for the pull request. Thanks for looking into this at such an early stage and for what would be a good patch if it wasn't for these requirements that aren't clear atm since the package is vnew. <3
Sadly before this can be merged, I have a few issues with it. The main one is we will be using the docker sdk to run docker commands vs running commands via bash. This means I would have to edit most of the code you have introduced. You couldn't have know we are doing that so that's just unfortunate really.
The second is that we will also be using the colours lib already in the go.mod file for colours and terminal codes vs just printing the bare codes so that the code is easier to maintain.
Heyy, thanks for your reply :) i knew we don't have an agreement on what we'll be using. I just wanted to write anything to play with go and feel what it's like to develop in it hahah I'm happy to edit this PR, but I'm not sure if I'll be able to in the upcoming 2 weeks bc I'm going on vacation. If somebody picks it up it's cool too :) I was looking into Docker go SDK(https://pkg.go.dev/github.com/docker/docker/client) but I haven't found any mention of
docker context
. Could you point me to the function that I should use, or better yet: tell me how to find it? I don't understand those docs XD When I know that I can fix this and make future PR's properly!Oh god this led down to a 3 hour search I have actuallly had to record me retelling to another comrade of Autonomic. Basically you don't. The API only has the focus of the Docker daemon's sock file. The CLI itself sorta hacks on this to allow for context. I now have the way of mixing the CLI's "hack" and the Golang clent and will add it to abra in a bit.
How Abra will deal with this external to running docker commands I don't know. The two main ones is we use the CLI now being a lib to steal some functions from that will allow us to access the already defined Docker contexts and how the CLI deals with it. Or we just do something ourselves.
If you are going on holiday for the next 2 weeks then I will probably have this function done before you get back haha. I don't know what to do about this PR just yet though.
5e1b076bf9
So, the scaffolding is up now and the TODO list is out for what can be taken on now over in https://git.autonomic.zone/coop-cloud/go-abra/src/branch/main/TODO.md. The
server ls
command got written inc9ba7aef20/cli/server.go (L12)
using the approach @roxxers was aiming to wire up. Will close this off then? Thanks for taking a run at this @knoflook and see you somewhere in the TODO.md 🙏