Add proof of concept server ls comand #2

Closed
knoflook wants to merge 2 commits from knoflook/go-abra:main into main
Member
No description provided.
knoflook added 1 commit 2021-07-15 15:06:17 +00:00
continuous-integration/drone/pr Build is passing Details
2e7da361a6
Add proof of concept server ls comand
Owner

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.

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.
Author
Member

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!

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!
knoflook added 1 commit 2021-07-16 07:26:40 +00:00
continuous-integration/drone/pr Build is failing Details
e76d996943
Merge branch 'main' into main
Owner

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.

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 :)

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.

> 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. > 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 :) 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.
Owner
https://git.autonomic.zone/coop-cloud/go-abra/commit/5e1b076bf97f9f5ba89dd857b495a8bb5e1e2169
Owner

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 in c9ba7aef20/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 🙏

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 in https://git.autonomic.zone/coop-cloud/go-abra/src/commit/c9ba7aef208218f4293ac44e0638ab7766ec6340/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](https://git.autonomic.zone/coop-cloud/go-abra/src/branch/main/TODO.md) 🙏
decentral1se closed this pull request 2021-07-20 21:21:25 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.