Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
# - run: go mod tidy && git diff -s --exit-code go.sum
- run: go mod tidy && git diff -s --exit-code go.sum
- run: make test
build:
runs-on: ubuntu-latest
Expand Down
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
FROM golang:1.13.15-alpine3.11 AS build
FROM golang:1.24-alpine AS build

RUN apk update && apk add git && apk add curl

WORKDIR /go/src/github.com/planetlabs/draino

COPY go.* .
RUN go mod download

COPY . .

RUN CGO_ENABLED=0 go build -o /draino ./cmd/draino

FROM alpine:3.11
FROM alpine:3.21

RUN apk update && apk add ca-certificates
RUN addgroup -S user && adduser -S user -G user
USER user
RUN addgroup -g 65532 -S nonroot && adduser -u 65532 -S nonroot -G nonroot
USER 65532
COPY --from=build /draino /draino
6 changes: 3 additions & 3 deletions cmd/draino/draino.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ import (
"time"

"contrib.go.opencensus.io/exporter/prometheus"
"github.com/alecthomas/kingpin/v2"
"github.com/julienschmidt/httprouter"
"github.com/oklog/run"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
"go.uber.org/zap"
"gopkg.in/alecthomas/kingpin.v2"
client "k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/leaderelection"
"k8s.io/client-go/tools/leaderelection/resourcelock"
"k8s.io/klog"
"k8s.io/klog/v2"

"github.com/planetlabs/draino/internal/kubernetes"
)
Expand Down Expand Up @@ -216,7 +216,7 @@ func main() {
defer cancel()

lock, err := resourcelock.New(
resourcelock.EndpointsResourceLock,
resourcelock.LeasesResourceLock,
*namespace,
*leaderElectionTokenName,
cs.CoreV1(),
Expand Down
99 changes: 67 additions & 32 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,38 +1,73 @@
module github.com/planetlabs/draino

go 1.13

// Kube 1.15.3
replace k8s.io/client-go => k8s.io/client-go v0.0.0-20190819141724-e14f31a72a77

// Kube 1.15.3
replace k8s.io/api => k8s.io/api v0.0.0-20190819141258-3544db3b9e44

// Kube 1.15.3
replace k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d
go 1.24.0

require (
contrib.go.opencensus.io/exporter/prometheus v0.1.0
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc // indirect
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf // indirect
github.com/antonmedv/expr v1.8.8
contrib.go.opencensus.io/exporter/prometheus v0.4.2
github.com/alecthomas/kingpin/v2 v2.4.0
github.com/expr-lang/expr v1.16.9
github.com/go-test/deep v1.0.1
github.com/julienschmidt/httprouter v1.1.0
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/oklog/run v1.0.0
github.com/onsi/ginkgo v1.12.0 // indirect
github.com/onsi/gomega v1.9.0 // indirect
github.com/pkg/errors v0.8.0
github.com/stretchr/testify v1.5.1
go.opencensus.io v0.21.0
go.uber.org/atomic v1.3.2 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.9.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gotest.tools v2.2.0+incompatible
k8s.io/api v0.0.0-20190819141258-3544db3b9e44
k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d
k8s.io/client-go v8.0.0+incompatible
k8s.io/klog v0.3.1
github.com/julienschmidt/httprouter v1.3.0
github.com/oklog/run v1.1.0
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.10.0
go.opencensus.io v0.24.1-0.20230717132223-01e6da5fc01c
go.uber.org/zap v1.27.0
k8s.io/api v0.32.2
k8s.io/apimachinery v0.32.2
k8s.io/client-go v0.32.2
k8s.io/klog/v2 v2.130.1
)

require (
github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.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/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.9 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/mailru/easyjson v0.9.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/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.21.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prometheus/statsd_exporter v0.28.0 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/oauth2 v0.27.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/time v0.10.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.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/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect
k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading