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
28 changes: 28 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "2"
linters:
default: standard
enable:
- unparam

formatters:
enable:
- gofmt
- goimports
settings:
gofmt:
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'

issues:
max-same-issues: 100

exclude-files:
- generated.*\\.go

exclude-dirs:
- client
- vendor

run:
timeout: 10m
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,6 @@ unit-tests: $(BUILD_DIRS)
./hack/test.sh $(SRC_PKGS) \
"

ADDTL_LINTERS := gofmt,goimports,unparam

.PHONY: lint
lint: $(BUILD_DIRS)
@echo "running linter"
Expand All @@ -410,7 +408,7 @@ lint: $(BUILD_DIRS)
--env GO111MODULE=on \
--env GOFLAGS="-mod=vendor" \
$(BUILD_IMAGE) \
golangci-lint run --enable $(ADDTL_LINTERS) --max-same-issues=100 --timeout=60m --exclude-files="generated.*\.go$\" --exclude-dirs-use-default --exclude-dirs=client,vendor
golangci-lint run

$(BUILD_DIRS):
@mkdir -p $@
Expand Down
4 changes: 2 additions & 2 deletions apis/core/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
)

// Funcs returns the fuzzer functions for this api group.
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
var Funcs = func(codecs runtimeserializer.CodecFactory) []any {
return []any{
// v1alpha1
func(s *v1alpha1.PodView, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
Expand Down
4 changes: 2 additions & 2 deletions apis/identity/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
)

// Funcs returns the fuzzer functions for this api group.
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
var Funcs = func(codecs runtimeserializer.CodecFactory) []any {
return []any{
// v1alpha1
func(s *v1alpha1.ClusterIdentity, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
Expand Down
4 changes: 2 additions & 2 deletions apis/management/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
)

// Funcs returns the fuzzer functions for this api group.
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
var Funcs = func(codecs runtimeserializer.CodecFactory) []any {
return []any{
func(s *v1alpha1.ProjectQuota, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
},
Expand Down
4 changes: 2 additions & 2 deletions apis/meta/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
)

// Funcs returns the fuzzer functions for this api group.
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
var Funcs = func(codecs runtimeserializer.CodecFactory) []any {
return []any{
func(s *v1alpha1.ResourceDescriptor, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
},
Expand Down
2 changes: 1 addition & 1 deletion apis/meta/v1alpha1/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func FormatMetadata(data []byte) ([]byte, error) {
return yaml.Marshal(root)
}

func find(node yaml.MapSlice, key string) interface{} {
func find(node yaml.MapSlice, key string) any {
for i := range node {
if node[i].Key.(string) == key {
return node[i].Value
Expand Down
4 changes: 2 additions & 2 deletions apis/meta/v1alpha1/table_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ type TableCell struct {
// cells will be as wide as the column definitions array and may contain strings, numbers (float64 or
// int64), booleans, simple maps, lists, or null. See the type field of the column definition for a
// more detailed description.
Data interface{} `json:"data"`
Data any `json:"data"`
// +optional
Sort interface{} `json:"sort,omitempty"`
Sort any `json:"sort,omitempty"`
// +optional
Link string `json:"link,omitempty"`
// +optional
Expand Down
4 changes: 2 additions & 2 deletions apis/node/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
)

// Funcs returns the fuzzer functions for this api group.
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
var Funcs = func(codecs runtimeserializer.CodecFactory) []any {
return []any{
func(s *v1alpha1.NodeTopology, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
},
Expand Down
11 changes: 6 additions & 5 deletions apis/shared/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ const (
)

var pool = sync.Pool{
New: func() interface{} {
New: func() any {
return new(bytes.Buffer)
},
}

func (r ResourceLocator) GraphQuery(oid kmapi.OID) (string, map[string]interface{}, error) {
if r.Query.Type == GraphQLQuery {
vars := map[string]interface{}{
func (r ResourceLocator) GraphQuery(oid kmapi.OID) (string, map[string]any, error) {
switch r.Query.Type {
case GraphQLQuery:
vars := map[string]any{
GraphQueryVarSource: string(oid),
GraphQueryVarTargetGroup: r.Ref.Group,
GraphQueryVarTargetKind: r.Ref.Kind,
Expand All @@ -61,7 +62,7 @@ func (r ResourceLocator) GraphQuery(oid kmapi.OID) (string, map[string]interface
}
}
}`, r.Query.ByLabel), vars, nil
} else if r.Query.Type == RESTQuery {
case RESTQuery:
if r.Query.Raw == "" || !strings.Contains(r.Query.Raw, "{{") {
return r.Query.Raw, nil, nil
}
Expand Down
4 changes: 2 additions & 2 deletions apis/ui/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
)

// Funcs returns the fuzzer functions for this api group.
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
var Funcs = func(codecs runtimeserializer.CodecFactory) []any {
return []any{
func(s *v1alpha1.ResourceDashboard, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
},
Expand Down
2 changes: 1 addition & 1 deletion apis/ui/v1alpha1/feature_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (v Feature) CustomResourceDefinition() *apiextensions.CustomResourceDefinit
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceFeatures))
}

func (_ Feature) FormatLabels(featureSet string) labels.Selector {
func (Feature) FormatLabels(featureSet string) labels.Selector {
return labels.SelectorFromSet(map[string]string{
ui.LabelFeatureSet: featureSet,
})
Expand Down
2 changes: 1 addition & 1 deletion apis/ui/v1alpha1/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func FormatMetadata(data []byte) ([]byte, error) {
return yaml.Marshal(root)
}

func find(node yaml.MapSlice, key string) interface{} {
func find(node yaml.MapSlice, key string) any {
for i := range node {
if node[i].Key.(string) == key {
return node[i].Value
Expand Down
4 changes: 2 additions & 2 deletions cmd/jsonpath-checker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//nolint:deadcode,unused,varcheck
//nolint:unused
package main

import (
Expand Down Expand Up @@ -165,7 +165,7 @@ func main() {
os.Exit(1)
}

var input interface{}
var input any
err := yaml.Unmarshal([]byte(yamlSecret), &input)
if err != nil {
fmt.Fprintln(os.Stderr, err)
Expand Down
6 changes: 3 additions & 3 deletions cmd/resource-fmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func check(typ reflect.Type, filename string, fix bool) (string, error) {
return "", err
}

var original map[string]interface{}
var original map[string]any
err = yaml.Unmarshal(data, &original)
if err != nil {
return "", err
Expand Down Expand Up @@ -111,7 +111,7 @@ func check(typ reflect.Type, filename string, fix bool) (string, error) {
return "", nil
}

func checkType(t interface{}, plural string, fix bool) error {
func checkType(t any, plural string, fix bool) error {
return filepath.Walk(fmt.Sprintf("./hub/%s/", plural), func(path string, info fs.FileInfo, err error) error {
if err != nil {
return err
Expand All @@ -135,7 +135,7 @@ func checkType(t interface{}, plural string, fix bool) error {
})
}

func MustCheckType(t interface{}, plural string, fix bool) {
func MustCheckType(t any, plural string, fix bool) {
if err := checkType(t, plural, fix); err != nil {
klog.ErrorS(err, "failed to check "+plural)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/ui-updater/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func check(filename string) (string, error) {
return "", err
}

var original map[string]interface{}
var original map[string]any
err = yaml.Unmarshal(data, &original)
if err != nil {
return "", err
Expand Down
2 changes: 1 addition & 1 deletion crds/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
//go:embed *.yaml
var fs embed.FS

func load(filename string, o interface{}) error {
func load(filename string, o any) error {
data, err := fs.ReadFile(filename)
if err != nil {
return err
Expand Down
20 changes: 9 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
module kmodules.xyz/resource-metadata

go 1.23.0

toolchain go1.24.0
go 1.24.0

require (
github.com/Masterminds/sprig/v3 v3.3.0
github.com/Masterminds/sprig/v3 v3.2.0
github.com/fluxcd/source-controller/api v1.5.0
github.com/gobuffalo/flect v1.0.3
github.com/google/go-containerregistry v0.20.3
Expand All @@ -16,8 +14,8 @@ require (
github.com/spf13/pflag v1.0.6
github.com/stretchr/testify v1.10.0
github.com/yudai/gojsondiff v1.0.0
go.bytebuilders.dev/license-verifier v0.14.9
golang.org/x/net v0.38.0
go.bytebuilders.dev/license-verifier v0.14.10
golang.org/x/net v0.47.0
gomodules.xyz/encoding v0.0.8
gomodules.xyz/jsonpath v0.0.2
gomodules.xyz/x v0.0.17
Expand Down Expand Up @@ -110,12 +108,12 @@ require (
github.com/x448/float16 v0.8.4 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/oauth2 v0.27.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/sync v0.18.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/term v0.37.0 // indirect
golang.org/x/text v0.31.0 // indirect
golang.org/x/time v0.10.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
gomodules.xyz/mergo v0.3.13 // indirect
Expand Down
32 changes: 16 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
go.bytebuilders.dev/license-verifier v0.14.9 h1:EwwhYdHs5I3B+OrVO4fGFfFiEtIKVpqem2jtYb+Lek0=
go.bytebuilders.dev/license-verifier v0.14.9/go.mod h1:BviSsSxXgXVXBSCXvYmftuTEtxchb04G0cV/AlD/Tu8=
go.bytebuilders.dev/license-verifier v0.14.10 h1:K4VZjaoDXQde8QtL2kzpgk0jHw3W5CxFK9vh78RbDbQ=
go.bytebuilders.dev/license-verifier v0.14.10/go.mod h1:+cr+kft45r9BbsmZ9D5MGK9CrOf0VL3kBuOd/MiahdA=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
Expand All @@ -229,45 +229,45 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4=
golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
2 changes: 1 addition & 1 deletion hub/clusterprofiles/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func List(kc client.Reader) ([]v1alpha1.ClusterProfile, error) {

var list v1alpha1.ClusterProfileList
err := kc.List(context.TODO(), &list)
if err != nil && !(meta.IsNoMatchError(err) || apierrors.IsNotFound(err)) {
if err != nil && (!meta.IsNoMatchError(err) && !apierrors.IsNotFound(err)) {
return nil, err
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/identity/b3.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (c *Client) Identify(clusterUID string) (*kmapi.ClusterMetadata, error) {
}
return nil, err
}
defer resp.Body.Close()
defer resp.Body.Close() // nolint:errcheck

body, err := io.ReadAll(resp.Body)
if err != nil {
Expand Down Expand Up @@ -185,7 +185,7 @@ func (c *Client) GetToken() (*identityapi.InboxTokenRequestResponse, error) {
}
return nil, err
}
defer resp.Body.Close()
defer resp.Body.Close() // nolint:errcheck
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
Expand Down
Loading
Loading