Skip to content

Commit

Permalink
Go 1.21 fixes for e2e tests
Browse files Browse the repository at this point in the history
- Updated some dependencies so they work with 1.21
- Changed the minio helm chart, as the old one wasn't available anymore
- Changed the installation of the CRDs in the e2e test to a server-side
  apply, because they had a too large annotation otherwise

Signed-off-by: Simon Beck <[email protected]>
  • Loading branch information
Kidswiss committed Mar 7, 2024
1 parent 4e8a420 commit 5a5b511
Show file tree
Hide file tree
Showing 17 changed files with 6,373 additions and 5,756 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ run-restic: run ## Run the restic module. Use ARGS to pass arguments to the com
.PHONY: install
install: export KUBECONFIG = $(KIND_KUBECONFIG)
install: generate kind-setup ## Install CRDs into a cluster
kubectl apply $(KIND_KUBECTL_ARGS) -f $(CRD_ROOT_DIR)/v1
kubectl apply $(KIND_KUBECTL_ARGS) -f $(CRD_ROOT_DIR)/v1 --server-side

.PHONY: uninstall
uninstall: export KUBECONFIG = $(KIND_KUBECONFIG)
Expand Down
1 change: 0 additions & 1 deletion api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"
)

const (
Expand Down Expand Up @@ -98,11 +100,19 @@ func operatorMain(c *cli.Context) error {
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: k8upScheme(),
MetricsBindAddress: cfg.Config.MetricsBindAddress,
Port: 9443,
LeaderElection: cfg.Config.EnableLeaderElection,
LeaderElectionID: leaderElectionID,
Scheme: k8upScheme(),
// MetricsBindAddress: cfg.Config.MetricsBindAddress,
// Port: 9443,
LeaderElection: cfg.Config.EnableLeaderElection,
LeaderElectionID: leaderElectionID,
Metrics: server.Options{
BindAddress: cfg.Config.MetricsBindAddress,
},
WebhookServer: &webhook.DefaultServer{
Options: webhook.Options{
Port: 9443,
},
},
})
if err != nil {
operatorLog.Error(err, "unable to initialize operator mode", "step", "manager")
Expand Down
438 changes: 259 additions & 179 deletions config/crd/apiextensions.k8s.io/v1/k8up.io_archives.yaml

Large diffs are not rendered by default.

427 changes: 251 additions & 176 deletions config/crd/apiextensions.k8s.io/v1/k8up.io_backups.yaml

Large diffs are not rendered by default.

417 changes: 246 additions & 171 deletions config/crd/apiextensions.k8s.io/v1/k8up.io_checks.yaml

Large diffs are not rendered by default.

6,894 changes: 3,599 additions & 3,295 deletions config/crd/apiextensions.k8s.io/v1/k8up.io_prebackuppods.yaml

Large diffs are not rendered by default.

423 changes: 249 additions & 174 deletions config/crd/apiextensions.k8s.io/v1/k8up.io_prunes.yaml

Large diffs are not rendered by default.

443 changes: 262 additions & 181 deletions config/crd/apiextensions.k8s.io/v1/k8up.io_restores.yaml

Large diffs are not rendered by default.

2,201 changes: 1,265 additions & 936 deletions config/crd/apiextensions.k8s.io/v1/k8up.io_schedules.yaml

Large diffs are not rendered by default.

25 changes: 15 additions & 10 deletions config/crd/apiextensions.k8s.io/v1/k8up.io_snapshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: snapshots.k8up.io
spec:
group: k8up.io
Expand Down Expand Up @@ -34,20 +33,26 @@ spec:
description: Snapshot is the Schema for the snapshots API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: SnapshotSpec contains all information needed about a restic
snapshot so it can be restored.
description: |-
SnapshotSpec contains all information needed about a restic snapshot so it
can be restored.
properties:
date:
format: date-time
Expand Down
1 change: 0 additions & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
Expand Down
7 changes: 3 additions & 4 deletions e2e/definitions/minio/helm.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
users:
- accessKey: myaccesskey
secretKey: mysecretkey
policy: consoleAdmin
replicas: 1
mode: standalone
resources:
Expand All @@ -13,3 +9,6 @@ buckets:
- name: backup
policy: none
purge: false
mode: standalone
rootUser: minioadmin
rootPassword: minioadmin
4 changes: 2 additions & 2 deletions e2e/definitions/secrets/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
namespace: k8up-e2e-subject
type: Opaque
stringData:
username: myaccesskey
password: mysecretkey
username: minioadmin
password: minioadmin
---
apiVersion: v1
kind: Secret
Expand Down
4 changes: 2 additions & 2 deletions e2e/lib/k8up.bash
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ restic() {
--restart Never \
--namespace "${DETIK_CLIENT_NAMESPACE-"k8up-system"}" \
--image "${E2E_IMAGE}" \
--env "AWS_ACCESS_KEY_ID=myaccesskey" \
--env "AWS_SECRET_ACCESS_KEY=mysecretkey" \
--env "AWS_ACCESS_KEY_ID=minioadmin" \
--env "AWS_SECRET_ACCESS_KEY=minioadmin" \
--env "RESTIC_PASSWORD=myreposecret" \
--pod-running-timeout 10s \
--quiet \
Expand Down
116 changes: 58 additions & 58 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,100 +1,100 @@
module github.com/k8up-io/k8up/v2

go 1.19
go 1.21

toolchain go1.22.1

require (
github.com/firepear/qsplit/v2 v2.5.0
github.com/go-logr/logr v1.3.0
github.com/go-logr/zapr v1.2.3
github.com/go-logr/logr v1.4.1
github.com/go-logr/zapr v1.3.0
github.com/imdario/mergo v0.3.16
github.com/minio/minio-go/v7 v7.0.61
github.com/prometheus/client_golang v1.14.0
github.com/prometheus/client_golang v1.19.0
github.com/restic/restic v0.16.0
github.com/robfig/cron/v3 v3.0.1
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.23.7
go.uber.org/zap v1.24.0
golang.org/x/net v0.12.0
k8s.io/api v0.25.3
k8s.io/apimachinery v0.25.3
k8s.io/client-go v0.25.3
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448
sigs.k8s.io/controller-runtime v0.13.1
sigs.k8s.io/controller-tools v0.10.0
go.uber.org/zap v1.26.0
golang.org/x/net v0.22.0
k8s.io/api v0.29.2
k8s.io/apimachinery v0.29.2
k8s.io/client-go v0.29.2
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
sigs.k8s.io/controller-runtime v0.17.2
sigs.k8s.io/controller-tools v0.14.0
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/benbjohnson/clock v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fatih/color v1.12.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gobuffalo/flect v0.2.5 // indirect
github.com/emicklei/go-restful/v3 v3.11.3 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-openapi/jsonpointer v0.20.3 // indirect
github.com/go-openapi/jsonreference v0.20.5 // indirect
github.com/go-openapi/swag v0.22.10 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // 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/gorilla/websocket v1.5.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/moby/spdystream v0.2.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/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.49.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
golang.org/x/tools v0.6.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.18.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.25.0 // indirect
k8s.io/component-base v0.25.0 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
k8s.io/apiextensions-apiserver v0.29.2 // indirect
k8s.io/component-base v0.29.2 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // 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
)
Loading

0 comments on commit 5a5b511

Please sign in to comment.