-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client code refactor and update dependencies
Refactor client code to accept multiple container runtimes, e.g. Docker. This is not complete yet, though
- Loading branch information
1 parent
9abc226
commit cdd39c7
Showing
12 changed files
with
999 additions
and
894 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Docker Build | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
jobs: | ||
BuildDocker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
pull: true | ||
push: true | ||
tags: ghcr.io/patrick246/k8s-outdated-image-exporter:${{ github.sha }} | ||
platforms: linux/amd64,linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
FROM golang:1.16 as builder | ||
# syntax=docker/dockerfile:1.4 | ||
FROM --platform=$BUILDPLATFORM golang:1.22.2 as builder | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
WORKDIR /go/app | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
RUN go mod download | ||
|
||
COPY . . | ||
RUN CGO_ENABLED=0 go build -o ./bin -ldflags="-extldflags=-static" ./cmd/... | ||
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o ./bin -ldflags="-extldflags=-static" ./cmd/... | ||
|
||
FROM gcr.io/distroless/static | ||
FROM gcr.io/distroless/static:nonroot | ||
LABEL org.opencontainers.image.source=https://github.com/patrick246/k8s-outdated-image-exporter | ||
LABEL org.opencontainers.image.licenses="AGPL-3.0" | ||
LABEL org.opencontainers.image.authors="https://github.com/patrick246" | ||
LABEL org.opencontainers.image.url="https://github.com/patrick246/k8s-outdated-image-exporter/pkgs/container/k8s-outdated-image-exporter" | ||
COPY --from=builder /go/app/bin/outdated-image-exporter /outdated-image-exporter | ||
COPY --from=builder --link /go/app/bin/outdated-image-exporter /outdated-image-exporter | ||
ENTRYPOINT ["/outdated-image-exporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,88 @@ | ||
module github.com/patrick246/k8s-outdated-image-exporter | ||
|
||
go 1.16 | ||
go 1.22.0 | ||
|
||
toolchain go1.22.2 | ||
|
||
require ( | ||
github.com/docker/docker v26.1.1+incompatible | ||
github.com/google/go-containerregistry v0.19.1 | ||
github.com/hashicorp/go-version v1.6.0 | ||
github.com/prometheus/client_golang v1.19.0 | ||
github.com/stretchr/testify v1.9.0 | ||
k8s.io/api v0.30.0 | ||
k8s.io/apimachinery v0.30.0 | ||
k8s.io/client-go v0.30.0 | ||
) | ||
|
||
require ( | ||
github.com/google/go-containerregistry v0.5.0 | ||
github.com/hashicorp/go-version v1.3.0 | ||
github.com/prometheus/client_golang v0.9.3 | ||
github.com/stretchr/testify v1.6.1 | ||
k8s.io/api v0.20.0 | ||
k8s.io/apimachinery v0.20.0 | ||
k8s.io/client-go v0.20.0 | ||
github.com/Microsoft/go-winio v0.6.2 // indirect | ||
github.com/beorn7/perks v1.0.1 // indirect | ||
github.com/cespare/xxhash/v2 v2.3.0 // indirect | ||
github.com/containerd/log v0.1.0 // indirect | ||
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/distribution/reference v0.6.0 // indirect | ||
github.com/docker/cli v26.1.1+incompatible // indirect | ||
github.com/docker/distribution v2.8.3+incompatible // indirect | ||
github.com/docker/docker-credential-helpers v0.8.1 // indirect | ||
github.com/docker/go-connections v0.5.0 // indirect | ||
github.com/docker/go-units v0.5.0 // indirect | ||
github.com/emicklei/go-restful/v3 v3.12.0 // indirect | ||
github.com/felixge/httpsnoop v1.0.4 // indirect | ||
github.com/go-logr/logr v1.4.1 // indirect | ||
github.com/go-logr/stdr v1.2.2 // indirect | ||
github.com/go-openapi/jsonpointer v0.21.0 // indirect | ||
github.com/go-openapi/jsonreference v0.21.0 // indirect | ||
github.com/go-openapi/swag v0.23.0 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/golang/protobuf v1.5.4 // indirect | ||
github.com/google/gnostic-models v0.6.8 // indirect | ||
github.com/google/go-cmp v0.6.0 // indirect | ||
github.com/google/gofuzz v1.2.0 // indirect | ||
github.com/google/uuid v1.6.0 // indirect | ||
github.com/imdario/mergo v0.3.16 // indirect | ||
github.com/josharian/intern v1.0.0 // indirect | ||
github.com/json-iterator/go v1.1.12 // indirect | ||
github.com/klauspost/compress v1.17.8 // indirect | ||
github.com/mailru/easyjson v0.7.7 // indirect | ||
github.com/mitchellh/go-homedir v1.1.0 // indirect | ||
github.com/moby/docker-image-spec v1.3.1 // indirect | ||
github.com/moby/term v0.5.0 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | ||
github.com/opencontainers/go-digest v1.0.0 // indirect | ||
github.com/opencontainers/image-spec v1.1.0 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/prometheus/client_model v0.6.1 // indirect | ||
github.com/prometheus/common v0.53.0 // indirect | ||
github.com/prometheus/procfs v0.14.0 // indirect | ||
github.com/sirupsen/logrus v1.9.3 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
github.com/vbatts/tar-split v0.11.5 // indirect | ||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect | ||
go.opentelemetry.io/otel v1.26.0 // indirect | ||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 // indirect | ||
go.opentelemetry.io/otel/metric v1.26.0 // indirect | ||
go.opentelemetry.io/otel/sdk v1.26.0 // indirect | ||
go.opentelemetry.io/otel/trace v1.26.0 // indirect | ||
golang.org/x/net v0.24.0 // indirect | ||
golang.org/x/oauth2 v0.19.0 // indirect | ||
golang.org/x/sync v0.7.0 // indirect | ||
golang.org/x/sys v0.19.0 // indirect | ||
golang.org/x/term v0.19.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
golang.org/x/time v0.5.0 // indirect | ||
google.golang.org/protobuf v1.34.0 // indirect | ||
gopkg.in/inf.v0 v0.9.1 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
k8s.io/klog/v2 v2.120.1 // indirect | ||
k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f // indirect | ||
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect | ||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect | ||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect | ||
sigs.k8s.io/yaml v1.4.0 // indirect | ||
) |
Oops, something went wrong.