Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main] Upgrade to latest dependencies #403

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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ require (
k8s.io/api v0.29.2
k8s.io/apimachinery v0.29.2
k8s.io/client-go v0.29.2
knative.dev/eventing v0.41.1-0.20240625075859-63527845df49
knative.dev/eventing v0.41.1-0.20240625163858-0f71292d9887
knative.dev/hack v0.0.0-20240607132042-09143140a254
knative.dev/pkg v0.0.0-20240625072707-8535fcc248ae
knative.dev/pkg v0.0.0-20240625144936-ee1db869c7ef
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -645,12 +645,12 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/eventing v0.41.1-0.20240625075859-63527845df49 h1:b8qgWh//71GgHa0MYgOEVoC5aawBPjiYIOZ+9NUo90I=
knative.dev/eventing v0.41.1-0.20240625075859-63527845df49/go.mod h1:/Q9Rz1yGqMpu80b0N8iZ+MEbuC07kcDvQx41Xo9nuek=
knative.dev/eventing v0.41.1-0.20240625163858-0f71292d9887 h1:FN6LBAZIn4wY/LC5Lq9oJ+D9uYiyP6VA3uvnGEPzL7I=
knative.dev/eventing v0.41.1-0.20240625163858-0f71292d9887/go.mod h1:NTmiME/0iU5TkrmR9OeRFh3xpnio2SG9aWsFgvCsxMA=
knative.dev/hack v0.0.0-20240607132042-09143140a254 h1:1YFnu3U6dWZg0oxm6GU8kEdA9A+BvSWKJO7sg3N0kq8=
knative.dev/hack v0.0.0-20240607132042-09143140a254/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/pkg v0.0.0-20240625072707-8535fcc248ae h1:unXplcQLqwO+QtSepyRI2zy4ZD/tciPro9Y4uVG6n6g=
knative.dev/pkg v0.0.0-20240625072707-8535fcc248ae/go.mod h1:Wikg4u73T6vk9TctrxZt60VXzqmGEQIx0iKfk1+9o4c=
knative.dev/pkg v0.0.0-20240625144936-ee1db869c7ef h1:EAYfNP+YJ3f4KeLpXEIm3KQFN7BXla9SVD81JzzbzFo=
knative.dev/pkg v0.0.0-20240625144936-ee1db869c7ef/go.mod h1:Wikg4u73T6vk9TctrxZt60VXzqmGEQIx0iKfk1+9o4c=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
3 changes: 2 additions & 1 deletion vendor/knative.dev/pkg/apis/condition_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package apis

import (
"errors"
"fmt"
"reflect"
"sort"
Expand Down Expand Up @@ -233,7 +234,7 @@ func (r conditionsImpl) ClearCondition(t ConditionType) error {
}
// Terminal conditions are not handled as they can't be nil
if r.isTerminal(t) {
return fmt.Errorf("clearing terminal conditions not implemented")
return errors.New("clearing terminal conditions not implemented")
}
cond := r.GetCondition(t)
if cond == nil {
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/apis/deprecated.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func getPrefixedNamedFieldValues(prefix string, obj interface{}) (map[string]ref
return fields, inlined
}

for i := 0; i < objValue.NumField(); i++ {
for i := range objValue.NumField() {
tf := objValue.Type().Field(i)
if v := objValue.Field(i); v.IsValid() {
jTag := tf.Tag.Get("json")
Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/pkg/apis/duck/v1/destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ func (d *Destination) SetDefaults(ctx context.Context) {
}
}

func validateCACerts(CACert *string) *apis.FieldError {
func validateCACerts(caCert *string) *apis.FieldError {
// Check the object.
var errs *apis.FieldError

block, err := pem.Decode([]byte(*CACert))
block, err := pem.Decode([]byte(*caCert))
if err != nil && block == nil {
errs = errs.Also(apis.ErrInvalidValue("CA Cert provided is invalid", "caCert"))
return errs
Expand Down
1 change: 0 additions & 1 deletion vendor/knative.dev/pkg/apis/duck/v1/knative_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func (kr *KReference) Validate(ctx context.Context) *apis.FieldError {
Details: fmt.Sprintf("parent namespace: %q does not match ref: %q", parentNS, kr.Namespace),
})
}

}
}
return errs
Expand Down
2 changes: 2 additions & 0 deletions vendor/knative.dev/pkg/apis/duck/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
(&KResource{}).GetListType(),
&AddressableType{},
(&AddressableType{}).GetListType(),
&AuthenticatableType{},
(&AuthenticatableType{}).GetListType(),
&Source{},
(&Source{}).GetListType(),
&WithPod{},
Expand Down
1 change: 0 additions & 1 deletion vendor/knative.dev/pkg/apis/duck/v1/status_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func (s *Status) ConvertTo(ctx context.Context, sink *Status, predicates ...func

conditions := make(apis.Conditions, 0, len(s.Conditions))
for _, c := range s.Conditions {

// Copy over the "happy" condition, which is the only condition that
// we can reliably transfer.
if c.Type == apis.ConditionReady || c.Type == apis.ConditionSucceeded {
Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/pkg/apis/duck/v1beta1/destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ func validateDestinationRef(ref corev1.ObjectReference) *apis.FieldError {
return errs
}

func validateCACerts(CACert *string) *apis.FieldError {
func validateCACerts(caCert *string) *apis.FieldError {
// Check the object.
var errs *apis.FieldError

block, err := pem.Decode([]byte(*CACert))
block, err := pem.Decode([]byte(*caCert))
if err != nil && block == nil {
errs = errs.Also(apis.ErrInvalidValue("CA Cert provided is invalid", "caCert"))
return errs
Expand Down
5 changes: 2 additions & 3 deletions vendor/knative.dev/pkg/apis/kind2resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package apis

import (
"fmt"
"strings"

"k8s.io/apimachinery/pkg/runtime/schema"
Expand All @@ -41,7 +40,7 @@ func KindToResource(gvk schema.GroupVersionKind) schema.GroupVersionResource {
func pluralizeKind(kind string) string {
ret := strings.ToLower(kind)
if strings.HasSuffix(ret, "s") {
return fmt.Sprintf("%ses", ret)
return ret + "es"
}
return fmt.Sprintf("%ss", ret)
return ret + "s"
}
8 changes: 4 additions & 4 deletions vendor/knative.dev/pkg/codegen/cmd/injection-gen/args/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package args

import (
"fmt"
"errors"

"github.com/spf13/pflag"
"k8s.io/gengo/args"
Expand Down Expand Up @@ -59,13 +59,13 @@ func Validate(genericArgs *args.GeneratorArgs) error {
customArgs := genericArgs.CustomArgs.(*CustomArgs)

if len(genericArgs.OutputPackagePath) == 0 {
return fmt.Errorf("output package cannot be empty")
return errors.New("output package cannot be empty")
}
if len(customArgs.VersionedClientSetPackage) == 0 {
return fmt.Errorf("versioned clientset package cannot be empty")
return errors.New("versioned clientset package cannot be empty")
}
if len(customArgs.ExternalVersionsInformersPackage) == 0 {
return fmt.Errorf("external versions informers package cannot be empty")
return errors.New("external versions informers package cannot be empty")
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
klog.Fatalf("Wrong CustomArgs type: %T", arguments.CustomArgs)
}

versionPackagePath := filepath.Join(arguments.OutputPackagePath)
versionPackagePath := filepath.Clean(arguments.OutputPackagePath)

var packageList generator.Packages

Expand Down Expand Up @@ -389,8 +389,6 @@ func versionInformerPackages(basePackage string, groupPkgName string, gv clientg
vers := make([]generator.Package, 0, 2*len(typesToGenerate))

for _, t := range typesToGenerate {
// Fix for golang iterator bug.
t := t
packagePath := packagePath + "/" + strings.ToLower(t.Name.Name)
typedInformerPackage := typedInformerPackage(groupPkgName, gv, customArgs.ExternalVersionsInformersPackage)

Expand Down Expand Up @@ -501,7 +499,6 @@ func versionInformerPackages(basePackage string, groupPkgName string, gv clientg
return tags.NeedsInformerInjection()
},
})

}
return vers
}
Expand All @@ -513,8 +510,6 @@ func reconcilerPackages(basePackage string, groupPkgName string, gv clientgentyp
vers := make([]generator.Package, 0, 4*len(typesToGenerate))

for _, t := range typesToGenerate {
// Fix for golang iterator bug.
t := t
extracted := extractCommentTags(t)
reconcilerClasses, hasReconcilerClass := extractReconcilerClassesTag(extracted)
nonNamespaced := isNonNamespaced(extracted)
Expand Down Expand Up @@ -677,7 +672,6 @@ func versionDuckPackages(basePackage string, groupPkgName string, gv clientgenty

for _, t := range typesToGenerate {
// Fix for golang iterator bug.
t := t
packagePath := filepath.Join(packagePath, strings.ToLower(t.Name.Name))

// Impl
Expand Down
8 changes: 4 additions & 4 deletions vendor/knative.dev/pkg/configmap/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package configmap

import (
"fmt"
"errors"
"reflect"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -58,17 +58,17 @@ func ValidateConstructor(constructor interface{}) error {
cType := reflect.TypeOf(constructor)

if cType.Kind() != reflect.Func {
return fmt.Errorf("config constructor must be a function")
return errors.New("config constructor must be a function")
}

if cType.NumIn() != 1 || cType.In(0) != reflect.TypeOf(&corev1.ConfigMap{}) {
return fmt.Errorf("config constructor must be of the type func(*k8s.io/api/core/v1/ConfigMap) (..., error)")
return errors.New("config constructor must be of the type func(*k8s.io/api/core/v1/ConfigMap) (..., error)")
}

errorType := reflect.TypeOf((*error)(nil)).Elem()

if cType.NumOut() != 2 || !cType.Out(1).Implements(errorType) {
return fmt.Errorf("config constructor must be of the type func(*k8s.io/api/core/v1/ConfigMap) (..., error)")
return errors.New("config constructor must be of the type func(*k8s.io/api/core/v1/ConfigMap) (..., error)")
}
return nil
}
4 changes: 2 additions & 2 deletions vendor/knative.dev/pkg/configmap/informer/synced_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
package informer

import (
"context"
"sync"

"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/wait"
)

// namedWaitGroup is used to increment and decrement a WaitGroup by name
Expand Down Expand Up @@ -107,6 +107,6 @@ func (s *syncedCallback) WaitForAllKeys(stopCh <-chan struct{}) error {
case <-c:
return nil
case <-stopCh:
return wait.ErrWaitTimeout
return context.DeadlineExceeded
}
}
15 changes: 5 additions & 10 deletions vendor/knative.dev/pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ type Impl struct {

// ControllerOptions encapsulates options for creating a new controller,
// including throttling and stats behavior.
type ControllerOptions struct { //nolint // for backcompat.
type ControllerOptions struct {
WorkQueueName string
Logger *zap.SugaredLogger
Reporter StatsReporter
Expand Down Expand Up @@ -482,7 +482,7 @@ func (c *Impl) RunContext(ctx context.Context, threadiness int) error {

// Launch workers to process resources that get enqueued to our workqueue.
c.logger.Info("Starting controller and workers")
for i := 0; i < threadiness; i++ {
for range threadiness {
sg.Add(1)
go func() {
defer sg.Done()
Expand Down Expand Up @@ -623,7 +623,6 @@ func IsSkipKey(err error) bool {
// Is implements the Is() interface of error. It returns whether the target
// error can be treated as equivalent to a permanentError.
func (skipKeyError) Is(target error) bool {
//nolint: errorlint // This check is actually fine.
_, ok := target.(skipKeyError)
return ok
}
Expand All @@ -650,7 +649,6 @@ func IsPermanentError(err error) bool {
// Is implements the Is() interface of error. It returns whether the target
// error can be treated as equivalent to a permanentError.
func (permanentError) Is(target error) bool {
//nolint: errorlint // This check is actually fine.
_, ok := target.(permanentError)
return ok
}
Expand Down Expand Up @@ -710,7 +708,6 @@ func IsRequeueKey(err error) (bool, time.Duration) {
// Is implements the Is() interface of error. It returns whether the target
// error can be treated as equivalent to a requeueKeyError.
func (requeueKeyError) Is(target error) bool {
//nolint: errorlint // This check is actually fine.
_, ok := target.(requeueKeyError)
return ok
}
Expand All @@ -726,7 +723,6 @@ type Informer interface {
// of them to synchronize.
func StartInformers(stopCh <-chan struct{}, informers ...Informer) error {
for _, informer := range informers {
informer := informer
go informer.Run(stopCh)
}

Expand All @@ -744,7 +740,6 @@ func RunInformers(stopCh <-chan struct{}, informers ...Informer) (func(), error)
var wg sync.WaitGroup
wg.Add(len(informers))
for _, informer := range informers {
informer := informer
go func() {
defer wg.Done()
informer.Run(stopCh)
Expand All @@ -762,16 +757,16 @@ func RunInformers(stopCh <-chan struct{}, informers ...Informer) (func(), error)
// WaitForCacheSyncQuick is the same as cache.WaitForCacheSync but with a much reduced
// check-rate for the sync period.
func WaitForCacheSyncQuick(stopCh <-chan struct{}, cacheSyncs ...cache.InformerSynced) bool {
err := wait.PollImmediateUntil(time.Millisecond,
func() (bool, error) {
err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), time.Millisecond, true,
func(context.Context) (bool, error) {
for _, syncFunc := range cacheSyncs {
if !syncFunc() {
return false, nil
}
}
return true, nil
},
stopCh)
)
return err == nil
}

Expand Down
23 changes: 23 additions & 0 deletions vendor/knative.dev/pkg/hack/format-code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# Copyright 2024 The Knative Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail


go run mvdan.cc/gofumpt@latest -l -w .

2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/injection/informers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//nolint:fatcontext
package injection

import (
Expand Down Expand Up @@ -93,7 +94,6 @@ func (i *impl) SetupInformers(ctx context.Context, cfg *rest.Config) (context.Co
for _, fii := range i.GetFilteredInformers() {
ctx, filteredinfs = fii(ctx)
informers = append(informers, filteredinfs...)

}
return ctx, informers
}
3 changes: 2 additions & 1 deletion vendor/knative.dev/pkg/kmeta/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package kmeta

import (
"crypto/md5" //nolint:gosec // No strong cryptography needed.
"encoding/hex"
"fmt"
"regexp"
)
Expand Down Expand Up @@ -53,7 +54,7 @@ func ChildName(parent, suffix string) string {
// Format the return string, if it's shorter than longest: pad with
// beginning of the suffix. This happens, for example, when parent is
// short, but the suffix is very long.
ret := parent + fmt.Sprintf("%x", h)
ret := parent + hex.EncodeToString(h[:])
if d := longest - len(ret); d > 0 {
ret += suffix[:d]
}
Expand Down
Loading
Loading