Skip to content

Commit 98db57c

Browse files
committed
[kube-fip-controller] bump k8s deps to v1.25, go 1.19
1 parent 5753ac2 commit 98db57c

File tree

12 files changed

+561
-79
lines changed

12 files changed

+561
-79
lines changed

kube-fip-controller/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
FROM golang:1.13.4-alpine3.10 as builder
1+
FROM golang:1.19.3-alpine3.16 as builder
22
WORKDIR /go/src/github.com/sapcc/kubernetes-operators/kube-fip-controller
33
RUN apk add --no-cache make
44
COPY . .
55
ARG VERSION
66
RUN make all
77

8-
FROM alpine:3.10
8+
FROM alpine:3.16
99
MAINTAINER Arno Uhlig <arno.uhlig@@sap.com>
1010
LABEL source_repository="https://github.com/sapcc/kubernetes-operators"
1111

1212
RUN apk add --no-cache ca-certificates curl tini
1313
COPY --from=builder /go/src/github.com/sapcc/kubernetes-operators/kube-fip-controller/bin/linux/controller /usr/local/bin/
14+
RUN ["controller", "--version"]
15+
1416
ENTRYPOINT ["tini", "--"]
1517
CMD ["controller"]

kube-fip-controller/Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ VERSION = v$(DATE)
44
GOOS ?= $(shell go env | grep GOOS | cut -d'"' -f2)
55
BINARY := controller
66

7-
LDFLAGS := -X github.com/sapcc/kubernetes-operators/kube-fip-controller/pkg/controller.VERSION=$(VERSION)
8-
GOFLAGS := -ldflags "$(LDFLAGS)"
9-
107
SRCDIRS := cmd pkg
118
PACKAGES := $(shell find $(SRCDIRS) -type d)
129
GO_PKG := github.com/sapcc/kubernetes-operators/kube-fip-controller
@@ -17,10 +14,12 @@ GOFILES := $(wildcard $(GOFILES))
1714

1815
all: bin/$(GOOS)/$(BINARY)
1916

17+
bin/%/$(BINARY): GIT_COMMIT = $(shell git rev-parse --short HEAD)
18+
bin/%/$(BINARY): BUILD_DATE = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
2019
bin/%/$(BINARY): $(GOFILES) Makefile
21-
GOOS=$* GOARCH=amd64 go build $(GOFLAGS) -mod vendor -v -i -o bin/$*/$(BINARY) ./cmd/main.go && chmod +x bin/$*/$(BINARY)
20+
GOOS=$* GOARCH=amd64 go build -ldflags '-X github.com/sapcc/kubernetes-operators/kube-fip-controller/cmd.BuildCommit=$(GIT_COMMIT) -X github.com/sapcc/kubernetes-operators/kube-fip-controller/cmd.BuildDate=$(BUILD_DATE)' -mod vendor -v -o bin/$*/$(BINARY) ./cmd/main.go && chmod +x bin/$*/$(BINARY)
2221

23-
build: bin/linux/$(BINARY)
22+
build:
2423
docker build -t $(IMAGE):$(VERSION) .
2524

2625
static-check:

kube-fip-controller/cmd/main.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
*
3-
* Copyright 2019 SAP SE
3+
* Copyright 2022 SAP SE
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
2020
package main
2121

2222
import (
23+
"fmt"
2324
"os"
2425
"os/signal"
2526
"sync"
@@ -33,7 +34,12 @@ import (
3334
"gopkg.in/alecthomas/kingpin.v2"
3435
)
3536

36-
var opts config.Options
37+
var (
38+
opts config.Options
39+
40+
BuildCommit,
41+
BuildDate string
42+
)
3743

3844
func init() {
3945
kingpin.Flag("kubeconfig", "Absolute path to kubeconfig").StringVar(&opts.KubeConfig)
@@ -45,6 +51,7 @@ func init() {
4551
kingpin.Flag("default-floating-network", "Name of the default Floating IP network.").Required().StringVar(&opts.DefaultFloatingNetwork)
4652
kingpin.Flag("default-floating-subnet", "Name of the default Floating IP subnet.").Required().StringVar(&opts.DefaultFloatingSubnet)
4753
kingpin.Flag("config", "Absolute path to configuration file.").Required().StringVar(&opts.ConfigPath)
54+
kingpin.Version(fmt.Sprintf("%s (%s)", BuildCommit, BuildDate))
4855
}
4956

5057
func main() {

kube-fip-controller/go.mod

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,72 @@
11
module github.com/sapcc/kubernetes-operators/kube-fip-controller
22

3-
go 1.13
3+
go 1.19
4+
5+
replace (
6+
// Keep k8s dependencies in sync.
7+
k8s.io/api => k8s.io/api v0.25.4
8+
k8s.io/apimachinery => k8s.io/apimachinery v0.25.4
9+
k8s.io/client-go => k8s.io/client-go v0.25.4
10+
)
411

512
require (
6-
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
713
github.com/go-kit/kit v0.9.0
814
github.com/gophercloud/gophercloud v0.6.0
9-
github.com/pkg/errors v0.8.1
15+
github.com/pkg/errors v0.9.1
1016
github.com/prometheus/client_golang v1.2.1
1117
gopkg.in/alecthomas/kingpin.v2 v2.2.6
12-
gopkg.in/yaml.v2 v2.2.4
13-
k8s.io/api v0.0.0-20190819141258-3544db3b9e44
14-
k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d
18+
gopkg.in/yaml.v2 v2.4.0
19+
k8s.io/api v0.25.4
20+
k8s.io/apimachinery v0.25.4
1521
k8s.io/client-go v0.0.0-20190819141724-e14f31a72a77
1622
)
23+
24+
require (
25+
github.com/PuerkitoBio/purell v1.1.1 // indirect
26+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
27+
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
28+
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
29+
github.com/beorn7/perks v1.0.1 // indirect
30+
github.com/cespare/xxhash/v2 v2.1.0 // indirect
31+
github.com/davecgh/go-spew v1.1.1 // indirect
32+
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
33+
github.com/go-logfmt/logfmt v0.4.0 // indirect
34+
github.com/go-logr/logr v1.2.3 // indirect
35+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
36+
github.com/go-openapi/jsonreference v0.19.5 // indirect
37+
github.com/go-openapi/swag v0.19.14 // indirect
38+
github.com/gogo/protobuf v1.3.2 // indirect
39+
github.com/golang/protobuf v1.5.2 // indirect
40+
github.com/google/gnostic v0.5.7-v3refs // indirect
41+
github.com/google/go-cmp v0.5.8 // indirect
42+
github.com/google/gofuzz v1.1.0 // indirect
43+
github.com/imdario/mergo v0.3.6 // indirect
44+
github.com/josharian/intern v1.0.0 // indirect
45+
github.com/json-iterator/go v1.1.12 // indirect
46+
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 // indirect
47+
github.com/mailru/easyjson v0.7.6 // indirect
48+
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
49+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
50+
github.com/modern-go/reflect2 v1.0.2 // indirect
51+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
52+
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect
53+
github.com/prometheus/common v0.7.0 // indirect
54+
github.com/prometheus/procfs v0.0.5 // indirect
55+
github.com/spf13/pflag v1.0.5 // indirect
56+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
57+
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
58+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
59+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
60+
golang.org/x/text v0.3.7 // indirect
61+
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
62+
google.golang.org/appengine v1.6.7 // indirect
63+
google.golang.org/protobuf v1.28.0 // indirect
64+
gopkg.in/inf.v0 v0.9.1 // indirect
65+
gopkg.in/yaml.v3 v3.0.1 // indirect
66+
k8s.io/klog/v2 v2.70.1 // indirect
67+
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
68+
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
69+
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
70+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
71+
sigs.k8s.io/yaml v1.2.0 // indirect
72+
)

0 commit comments

Comments
 (0)