-
Notifications
You must be signed in to change notification settings - Fork 34
Add podman client #32
base: master
Are you sure you want to change the base?
Conversation
Dockerfile
Outdated
# Copy the package and compile it | ||
ADD . /go/src/github.com/quay/registry-monitor/ | ||
WORKDIR /go/src/github.com/quay/registry-monitor/ | ||
RUN CGO_ENABLED=0 go install github.com/quay/registry-monitor | ||
|
||
# FROM quay.io/podman/stable:v1.9.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably don't need to make these changes. We only care about the artifact from go build
, which is just a binary, and it's already being built and copied to the final container below
monitor.go
Outdated
@@ -151,6 +165,34 @@ func newDockerClient() (*docker.Client, error) { | |||
return docker.NewTLSClient(dockerHost, cert, key, ca) | |||
} | |||
|
|||
func NewPodmanClient() (*podmanClient, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could probably define a simple interface to abstract away the new Podman and old Docker client.
That way, you don't have to have separate code path for each client in your main business logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would start by listing the current set of operations that are being used from the existing docker client, and see if the same thing can be done in the Podman lib. Then you could define a Go interface that abstract both the Docker and your new Podman implementation.
@taowen19 Can you clean your changes a bit. I see there's a lot of commented section, that I'm not sure if they are to be removed or just commented out for testing. |
@taowen19 For testing, I would suggest trying to run it in something like a Fedora VM with podman installed. |
01edc60
to
314a842
Compare
No description provided.