Skip to content

Commit

Permalink
Bump k8s.io/* to v0.29.9 (#402)
Browse files Browse the repository at this point in the history
* Bump `k8s.io/*` to v0.29.9

- Bump `k8s.io/*` to v0.29.9
- Bump golang to 1.23
- Bump golangci-lint to 1.61.0
- Bump goimport to v0.25.0

* Fix linting issues
  • Loading branch information
afritzler authored Oct 1, 2024
1 parent a9e6a00 commit 2f2b45a
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
version: v1.61
26 changes: 0 additions & 26 deletions .golangci.yaml

This file was deleted.

61 changes: 61 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
run:
timeout: 10m
allow-parallel-runners: true

issues:
# don't skip warning about doc comments
# don't exclude the default set of lint
exclude-use-default: false
# restore some of the defaults
# (fill in the rest as needed)
exclude-rules:
- path: "clientutils/*"
linters:
- lll
- path: "envtestutils/*"
linters:
- lll
- path: "unstructuredutils/*"
linters:
- lll
- path: "metautils/*"
linters:
- lll
- path: "kustomizeutils/*"
linters:
- lll
- path: "configutils/*"
linters:
- lll
- path: "conditionutils/*"
linters:
- lll
- path: "testutils/*"
linters:
- lll
- path: "cmdutils/*"
linters:
- dupl
linters:
disable-all: true
enable:
- copyloopvar
- dupl
- errcheck
- goconst
- gocyclo
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- ginkgolinter
- lll
- misspell
- nakedret
- prealloc
- staticcheck
- typecheck
- unconvert
- unparam
- unused
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Source: https://github.com/ironcore-dev/controller-utils
Files:
.github/*
.gitignore
.golangci.yaml
.golangci.yml
CODEOWNERS
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ GOLANGCILINT ?= $(LOCALBIN)/golangci-lint

## Tool Versions
ADDLICENSE_VERSION ?= v1.1.1
GOIMPORTS_VERSION ?= v0.22.0
GOIMPORTS_VERSION ?= v0.25.0
MOCKGEN_VERSION ?= v0.4.0
GOLANGCILINT_VERSION ?= v1.59.1
GOLANGCILINT_VERSION ?= v1.61.0

.PHONY: addlicense
addlicense: $(ADDLICENSE) ## Download addlicense locally if necessary.
Expand Down
3 changes: 1 addition & 2 deletions clientutils/clientutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,9 @@ func CreateOrUseAndPatch(
var (
base = obj.DeepCopyObject().(client.Object)
best client.Object
other []client.Object
other = make([]client.Object, 0, len(objects))
)
for _, object := range objects {
object := object
if err := setObject(obj, object); err != nil {
return controllerutil.OperationResultNone, nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion conditionutils/conditionutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func getAndConvertField(v reflect.Value, name string, into interface{}) error {
// Otherwise, it returns a pointer to that value.
func direct(v reflect.Value) reflect.Value {
if v.IsZero() {
return reflect.New(reflect.PtrTo(v.Type())).Elem()
return reflect.New(reflect.PointerTo(v.Type())).Elem()
}

res := reflect.New(v.Type())
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module github.com/ironcore-dev/controller-utils

go 1.22.3
go 1.23.0

require (
github.com/onsi/ginkgo/v2 v2.20.2
github.com/onsi/gomega v1.34.2
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
go.uber.org/mock v0.4.0
k8s.io/api v0.29.7
k8s.io/apiextensions-apiserver v0.29.7
k8s.io/apimachinery v0.29.7
k8s.io/apiserver v0.29.7
k8s.io/client-go v0.29.7
k8s.io/api v0.29.9
k8s.io/apiextensions-apiserver v0.29.9
k8s.io/apimachinery v0.29.9
k8s.io/apiserver v0.29.9
k8s.io/client-go v0.29.9
k8s.io/utils v0.0.0-20231127182322-b307cd553661
sigs.k8s.io/controller-runtime v0.17.5
sigs.k8s.io/controller-runtime v0.17.6
sigs.k8s.io/kustomize/api v0.17.3
sigs.k8s.io/kustomize/kyaml v0.17.2
sigs.k8s.io/yaml v1.4.0
Expand Down Expand Up @@ -91,7 +91,7 @@ require (
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/component-base v0.29.7 // indirect
k8s.io/component-base v0.29.9 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 // indirect
Expand Down
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,18 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.29.7 h1:Q2/thp7YYESgy0MGzxT9RvA/6doLJHBXSFH8GGLxSbc=
k8s.io/api v0.29.7/go.mod h1:mPimdbyuIjwoLtBEVIGVUYb4BKOE+44XHt/n4IqKsLA=
k8s.io/apiextensions-apiserver v0.29.7 h1:X62u7vUGfwW5rYJB5jkZDr0uV2XSyEHJRdxnfD5PaLs=
k8s.io/apiextensions-apiserver v0.29.7/go.mod h1:JzBXxlZKKdtEYGr4yiN+s0eXheCTYgKDay8JXPfSGoQ=
k8s.io/apimachinery v0.29.7 h1:ICXzya58Q7hyEEfnTrbmdfX1n1schSepX2KUfC2/ykc=
k8s.io/apimachinery v0.29.7/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y=
k8s.io/apiserver v0.29.7 h1:yvdZAZJ6Bmih8Iu8CqUB74otyPP0OM3XKzYzAFiWsY4=
k8s.io/apiserver v0.29.7/go.mod h1:MjEld3ySZrQ4eOzf6OKANT/v8GvM3sb1e5vozXoIirs=
k8s.io/client-go v0.29.7 h1:vTtiFrGBKlcBhxaeZC4eDrqui1e108nsTyue/KU63IY=
k8s.io/client-go v0.29.7/go.mod h1:69BvVqdRozgR/9TP45u/oO0tfrdbP+I8RqrcCJQshzg=
k8s.io/component-base v0.29.7 h1:zXLJvZjvvDWdYmZCwZYk95E1Fd2oRXUz71mQukkRk5I=
k8s.io/component-base v0.29.7/go.mod h1:ddLTpIrjazaRI1EG83M41GNcYEAdskuQmx4JOOSXCOg=
k8s.io/api v0.29.9 h1:FwdflpNsfMUYUOblMZNWJ4K/q0OSL5A4jGa0iOgcJco=
k8s.io/api v0.29.9/go.mod h1:fNhmzRfKaSEHCmczA/jRx6CiDKhYOnFLJBERMJAXEk8=
k8s.io/apiextensions-apiserver v0.29.9 h1:EB6RK06kFJjbzBwU1YiVznxrcgBE0hhDWt6EQQIcOy4=
k8s.io/apiextensions-apiserver v0.29.9/go.mod h1:jcaHG6R/bB1iU6XzC1DMhB1x2ktTJLt2KKpg6B65Z2c=
k8s.io/apimachinery v0.29.9 h1:YZ8HUid1TzQVz94cnNlsQjLdH0VoAhWSqz7t0q6B12A=
k8s.io/apimachinery v0.29.9/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y=
k8s.io/apiserver v0.29.9 h1:BiHTZbAYcNYHTE9RlWMBe5AX2XoZbRujy6oo5krU4V8=
k8s.io/apiserver v0.29.9/go.mod h1:3zmBeYworciVZHs8jSfzt/naTpDQb3AM++aYJ5Pkqqo=
k8s.io/client-go v0.29.9 h1:4f/Wz6li3rEyIPFj32XAQMtOGMM1tg7KQi1oeS6ibPg=
k8s.io/client-go v0.29.9/go.mod h1:2N1drQEZ5yiYrWVaE2Un8JiISUhl47D8pyZlYLszke4=
k8s.io/component-base v0.29.9 h1:lPENvp3CCwdeMEWGjiTfn5b287qQYuK7gX32OBOovmA=
k8s.io/component-base v0.29.9/go.mod h1:NGDa6Ih0EdcLA2G4K2ZYySoiB+2Tn+rmSqPyudCPgDY=
k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0=
k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo=
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=
Expand All @@ -253,8 +253,8 @@ k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6R
k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 h1:TgtAeesdhpm2SGwkQasmbeqDo8th5wOBA5h/AjTKA4I=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y=
sigs.k8s.io/controller-runtime v0.17.5 h1:1FI9Lm7NiOOmBsgTV36/s2XrEFXnO2C4sbg/Zme72Rw=
sigs.k8s.io/controller-runtime v0.17.5/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY=
sigs.k8s.io/controller-runtime v0.17.6 h1:12IXsozEsIXWAMRpgRlYS1jjAHQXHtWEOMdULh3DbEw=
sigs.k8s.io/controller-runtime v0.17.6/go.mod h1:N0jpP5Lo7lMTF9aL56Z/B2oWBJjey6StQM0jRbKQXtY=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/kustomize/api v0.17.3 h1:6GCuHSsxq7fN5yhF2XrC+AAr8gxQwhexgHflOAD/JJU=
Expand Down
7 changes: 3 additions & 4 deletions metautils/metautils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ func ConvertAndSetList(scheme *runtime.Scheme, list runtime.Object, objs []runti
return err
}

var converted []runtime.Object
for _, obj := range objs {
converted := make([]runtime.Object, len(objs))
for i, obj := range objs {
into := reflect.New(elemType).Interface()
if err := scheme.Convert(obj, into, nil); err != nil {
return err
}

converted = append(converted, into.(runtime.Object))
converted[i] = into.(runtime.Object)
}
return meta.SetList(list, converted)
}
Expand Down
1 change: 0 additions & 1 deletion modutils/modutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func (e *Executor) GetE(name string) (*Module, error) {
continue
}

mod := mod
return &mod, nil
}
return nil, fmt.Errorf("module %q not found", name)
Expand Down
3 changes: 1 addition & 2 deletions unstructuredutils/unstructuredutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func Read(r io.Reader) ([]unstructured.Unstructured, error) {
for {
ext := runtime.RawExtension{}
if err := d.Decode(&ext); err != nil {
if !errors.Is(io.EOF, err) {
if !errors.Is(err, io.EOF) {
return nil, fmt.Errorf("error parsing: %w", err)
}
return objs, nil
Expand Down Expand Up @@ -107,7 +107,6 @@ func UnstructuredSliceToObjectSlice(unstructureds []unstructured.Unstructured) [
}
res := make([]client.Object, 0, len(unstructureds))
for _, u := range unstructureds {
u := u
res = append(res, &u)
}
return res
Expand Down

0 comments on commit 2f2b45a

Please sign in to comment.