Skip to content

Commit 470399a

Browse files
author
mgianluc
committed
Bump libsveltos
Remove depguard
1 parent fb1036e commit 470399a

17 files changed

+330
-367
lines changed

.github/workflows/main.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: checkout
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1717
- name: Set up Go
18-
uses: actions/setup-go@v4
18+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0
1919
with:
20-
go-version: 1.20.8
20+
go-version: 1.21.5
2121
- name: Build
2222
run: make build
2323
- name: FMT
@@ -32,11 +32,11 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- name: checkout
35-
uses: actions/checkout@v4
35+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3636
- name: Set up Go
37-
uses: actions/setup-go@v4
37+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0
3838
with:
39-
go-version: 1.20.8
39+
go-version: 1.21.5
4040
- name: ut
4141
run: make test
4242
env:
@@ -45,11 +45,11 @@ jobs:
4545
runs-on: ubuntu-latest
4646
steps:
4747
- name: checkout
48-
uses: actions/checkout@v4
48+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4949
- name: Set up Go
50-
uses: actions/setup-go@v4
50+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0
5151
with:
52-
go-version: 1.20.8
52+
go-version: 1.21.5
5353
- name: fv
5454
run: make create-cluster fv
5555
env:

.golangci.yaml

-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
11
linters-settings:
2-
depguard:
3-
list-type: blacklist
4-
packages:
5-
# Following logging implementations are allowed:
6-
# k8s.io/klog
7-
# go.uber.org/zap
8-
# go-logr/logr
9-
#
10-
# note that the following list will grow.
11-
- github.com/google/glog
12-
- log
13-
- github.com/sirupsen/logrus
14-
- github.com/wojas/genericr
15-
- logfmt
16-
packages-with-error-message:
17-
- github.com/google/glog: "Use klog, zap, or logr for logging."
18-
- log: "Use klog, zap, or logr for logging."
19-
- github.com/sirupsen/logrus: "Use klog, zap, or logr for logging."
20-
- github.com/wojas/genericr: "Use klog, zap, or logr for logging."
21-
- logfmt: "Use klog, zap, or logr for logging."
222
dupl:
233
threshold: 200
244
errorlint:
@@ -116,7 +96,6 @@ linters:
11696
- bidichk
11797
- containedctx
11898
- bodyclose
119-
- depguard
12099
- dogsled
121100
- dupl
122101
- durationcheck

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.20 as builder
2+
FROM golang:1.21 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ SETUP_ENVTEST := $(TOOLS_BIN_DIR)/setup_envs
6868
KIND := $(TOOLS_BIN_DIR)/kind
6969
KUBECTL := $(TOOLS_BIN_DIR)/kubectl
7070

71-
GOLANGCI_LINT_VERSION := "v1.52.2"
72-
CLUSTERCTL_VERSION := "v1.5.3"
71+
GOLANGCI_LINT_VERSION := "v1.55.2"
72+
CLUSTERCTL_VERSION := "v1.6.1"
7373

7474
$(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod # Build controller-gen from tools folder.
7575
cd $(TOOLS_DIR); $(GOBUILD) -tags=tools -o $(subst $(TOOLS_DIR)/hack/tools/,,$@) sigs.k8s.io/controller-tools/cmd/controller-gen

config/default/manager_auth_proxy_patch.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ spec:
3636
args:
3737
- "--health-probe-bind-address=:8081"
3838
- "--metrics-bind-address=127.0.0.1:8080"
39-
- "--leader-elect"
4039
- "--v=5"

config/manager/manager.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ spec:
3737
- command:
3838
- /manager
3939
args:
40-
- --leader-elect
4140
- --v=5
4241
image: controller:latest
4342
name: manager

config/rbac/kustomization.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ resources:
77
- service_account.yaml
88
- role.yaml
99
- role_binding.yaml
10-
- leader_election_role.yaml
11-
- leader_election_role_binding.yaml
1210
# Comment the following 4 lines if you want to disable
1311
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
1412
# which protects your /metrics endpoint.

config/rbac/leader_election_role.yaml

-37
This file was deleted.

config/rbac/leader_election_role_binding.yaml

-12
This file was deleted.

controllers/yttsource_predicates_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/go-logr/logr"
2727
corev1 "k8s.io/api/core/v1"
2828
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
29-
"k8s.io/klog/v2/klogr"
29+
"k8s.io/klog/v2/textlogger"
3030
"sigs.k8s.io/controller-runtime/pkg/event"
3131

3232
"github.com/gianlucam76/ytt-controller/controllers"
@@ -37,7 +37,7 @@ var _ = Describe("YttSource Predicates: ConfigMapPredicates", func() {
3737
var configMap *corev1.ConfigMap
3838

3939
BeforeEach(func() {
40-
logger = klogr.New()
40+
logger = textlogger.NewLogger(textlogger.NewConfig())
4141
configMap = &corev1.ConfigMap{
4242
ObjectMeta: metav1.ObjectMeta{
4343
Name: randomString(),
@@ -113,7 +113,7 @@ var _ = Describe("YttSource Predicates: SecretPredicates", func() {
113113
var secret *corev1.Secret
114114

115115
BeforeEach(func() {
116-
logger = klogr.New()
116+
logger = textlogger.NewLogger(textlogger.NewConfig())
117117
secret = &corev1.Secret{
118118
ObjectMeta: metav1.ObjectMeta{
119119
Name: randomString(),
@@ -188,7 +188,7 @@ var _ = Describe("YttSource Predicates: FluxSourcePredicates", func() {
188188
var gitRepository *sourcev1.GitRepository
189189

190190
BeforeEach(func() {
191-
logger = klogr.New()
191+
logger = textlogger.NewLogger(textlogger.NewConfig())
192192
gitRepository = &sourcev1.GitRepository{
193193
ObjectMeta: metav1.ObjectMeta{
194194
Name: "flux" + randomString(),

controllers/yttsource_transformations.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"fmt"
2222

2323
corev1 "k8s.io/api/core/v1"
24-
"k8s.io/klog/v2/klogr"
24+
"k8s.io/klog/v2/textlogger"
2525
ctrl "sigs.k8s.io/controller-runtime"
2626
"sigs.k8s.io/controller-runtime/pkg/client"
2727
"sigs.k8s.io/controller-runtime/pkg/reconcile"
@@ -37,7 +37,7 @@ func (r *YttSourceReconciler) requeueYttSourceForFluxSources(
3737
ctx context.Context, o client.Object,
3838
) []reconcile.Request {
3939

40-
logger := klogr.New().WithValues(
40+
logger := textlogger.NewLogger(textlogger.NewConfig()).WithValues(
4141
"objectMapper",
4242
"requeueYttSourceForFluxSources",
4343
"reference",
@@ -104,7 +104,7 @@ func (r *YttSourceReconciler) requeueYttSourceForReference(
104104
ctx context.Context, o client.Object,
105105
) []reconcile.Request {
106106

107-
logger := klogr.New().WithValues(
107+
logger := textlogger.NewLogger(textlogger.NewConfig()).WithValues(
108108
"objectMapper",
109109
"requeueYttSourceForConfigMap",
110110
"reference",

go.mod

+46-43
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,43 @@
11
module github.com/gianlucam76/ytt-controller
22

3-
go 1.20
3+
go 1.21
4+
5+
toolchain go1.21.5
46

57
require (
68
github.com/TwiN/go-color v1.4.1
7-
github.com/fluxcd/pkg/http/fetch v0.6.0
8-
github.com/fluxcd/pkg/tar v0.3.0
9-
github.com/fluxcd/source-controller/api v1.1.2
10-
github.com/go-logr/logr v1.3.0
11-
github.com/onsi/ginkgo/v2 v2.13.0
12-
github.com/onsi/gomega v1.29.0
9+
github.com/fluxcd/pkg/http/fetch v0.8.0
10+
github.com/fluxcd/pkg/tar v0.4.0
11+
github.com/fluxcd/source-controller/api v1.2.3
12+
github.com/go-logr/logr v1.4.1
13+
github.com/onsi/ginkgo/v2 v2.15.0
14+
github.com/onsi/gomega v1.31.1
1315
github.com/pkg/errors v0.9.1
14-
github.com/projectsveltos/libsveltos v0.19.1-0.20231029140049-048f7f2b4d99
16+
github.com/projectsveltos/libsveltos v0.22.1-0.20240125122253-24c1c8a0b429
1517
github.com/spf13/pflag v1.0.5
16-
github.com/vmware-tanzu/carvel-ytt v0.45.7
17-
k8s.io/api v0.28.2
18-
k8s.io/apiextensions-apiserver v0.28.2
19-
k8s.io/apimachinery v0.28.2
20-
k8s.io/client-go v0.28.2
21-
k8s.io/component-base v0.28.2
22-
k8s.io/klog/v2 v2.100.1
23-
sigs.k8s.io/cluster-api v1.5.3
24-
sigs.k8s.io/controller-runtime v0.15.1
18+
github.com/vmware-tanzu/carvel-ytt v0.47.0
19+
k8s.io/api v0.29.1
20+
k8s.io/apiextensions-apiserver v0.29.1
21+
k8s.io/apimachinery v0.29.1
22+
k8s.io/client-go v0.29.1
23+
k8s.io/component-base v0.29.1
24+
k8s.io/klog/v2 v2.120.1
25+
sigs.k8s.io/cluster-api v1.6.1
26+
sigs.k8s.io/controller-runtime v0.16.3
2527
)
2628

2729
require (
2830
github.com/beorn7/perks v1.0.1 // indirect
29-
github.com/blang/semver v3.5.1+incompatible // indirect
3031
github.com/blang/semver/v4 v4.0.0 // indirect
3132
github.com/cespare/xxhash/v2 v2.2.0 // indirect
3233
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
33-
github.com/davecgh/go-spew v1.1.1 // indirect
34-
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
34+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
35+
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
3536
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
36-
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
37+
github.com/evanphx/json-patch/v5 v5.7.0 // indirect
3738
github.com/fluxcd/pkg/apis/acl v0.1.0 // indirect
38-
github.com/fluxcd/pkg/apis/meta v1.1.2 // indirect
39-
github.com/fsnotify/fsnotify v1.6.0 // indirect
39+
github.com/fluxcd/pkg/apis/meta v1.2.0 // indirect
40+
github.com/fsnotify/fsnotify v1.7.0 // indirect
4041
github.com/go-openapi/jsonpointer v0.19.6 // indirect
4142
github.com/go-openapi/jsonreference v0.20.2 // indirect
4243
github.com/go-openapi/swag v0.22.3 // indirect
@@ -49,47 +50,49 @@ require (
4950
github.com/google/go-cmp v0.6.0 // indirect
5051
github.com/google/gofuzz v1.2.0 // indirect
5152
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
52-
github.com/google/uuid v1.3.0 // indirect
53+
github.com/google/uuid v1.3.1 // indirect
5354
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
54-
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
55+
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
5556
github.com/hashicorp/go-version v1.6.0 // indirect
5657
github.com/imdario/mergo v0.3.13 // indirect
5758
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5859
github.com/josharian/intern v1.0.0 // indirect
5960
github.com/json-iterator/go v1.1.12 // indirect
6061
github.com/k14s/starlark-go v0.0.0-20200720175618-3a5c849cc368 // indirect
62+
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
6163
github.com/mailru/easyjson v0.7.7 // indirect
6264
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
6365
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6466
github.com/modern-go/reflect2 v1.0.2 // indirect
6567
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
6668
github.com/opencontainers/go-digest v1.0.0 // indirect
67-
github.com/opencontainers/go-digest/blake3 v0.0.0-20230801144141-122dc6384261 // indirect
68-
github.com/prometheus/client_golang v1.16.0 // indirect
69-
github.com/prometheus/client_model v0.4.0 // indirect
69+
github.com/opencontainers/go-digest/blake3 v0.0.0-20231025023718-d50d2fec9c98 // indirect
70+
github.com/prometheus/client_golang v1.17.0 // indirect
71+
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
7072
github.com/prometheus/common v0.44.0 // indirect
71-
github.com/prometheus/procfs v0.10.1 // indirect
72-
github.com/spf13/cobra v1.7.0 // indirect
73-
github.com/zeebo/blake3 v0.1.1 // indirect
74-
golang.org/x/net v0.17.0 // indirect
75-
golang.org/x/oauth2 v0.10.0 // indirect
76-
golang.org/x/sys v0.13.0 // indirect
77-
golang.org/x/term v0.13.0 // indirect
78-
golang.org/x/text v0.13.0 // indirect
73+
github.com/prometheus/procfs v0.11.1 // indirect
74+
github.com/spf13/cobra v1.8.0 // indirect
75+
github.com/zeebo/blake3 v0.2.3 // indirect
76+
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
77+
golang.org/x/net v0.19.0 // indirect
78+
golang.org/x/oauth2 v0.14.0 // indirect
79+
golang.org/x/sys v0.15.0 // indirect
80+
golang.org/x/term v0.15.0 // indirect
81+
golang.org/x/text v0.14.0 // indirect
7982
golang.org/x/time v0.3.0 // indirect
80-
golang.org/x/tools v0.12.0 // indirect
81-
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
83+
golang.org/x/tools v0.16.1 // indirect
84+
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
8285
google.golang.org/appengine v1.6.7 // indirect
8386
google.golang.org/protobuf v1.31.0 // indirect
8487
gopkg.in/inf.v0 v0.9.1 // indirect
8588
gopkg.in/yaml.v2 v2.4.0 // indirect
8689
gopkg.in/yaml.v3 v3.0.1 // indirect
87-
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
88-
k8s.io/kubectl v0.28.2 // indirect
89-
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
90+
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
91+
k8s.io/kubectl v0.29.1 // indirect
92+
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
9093
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
91-
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
92-
sigs.k8s.io/yaml v1.3.0 // indirect
94+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
95+
sigs.k8s.io/yaml v1.4.0 // indirect
9396
)
9497

9598
// Replace digest lib to master to gather access to BLAKE3.

0 commit comments

Comments
 (0)