Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Add podman client #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add podman client #32

wants to merge 2 commits into from

Conversation

taowen19
Copy link

No description provided.

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
Copy link
Member

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) {
Copy link
Member

@kleesc kleesc Jul 30, 2021

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.

Copy link
Member

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.

@kleesc
Copy link
Member

kleesc commented Jul 30, 2021

@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.

@kleesc
Copy link
Member

kleesc commented Jul 30, 2021

@taowen19 For testing, I would suggest trying to run it in something like a Fedora VM with podman installed.
We can worry about deploying it to Openshift/ROSA after, since it probably require some extra permissions from the cluster.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants