Skip to content

Commit

Permalink
[main] Upgrade to latest dependencies (#8029)
Browse files Browse the repository at this point in the history
upgrade to latest dependencies

bumping knative.dev/pkg fc0720b...8535fcc:
  > 8535fcc gofumpt the repo (# 3067)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Jun 25, 2024
1 parent 9cf272a commit 0f71292
Show file tree
Hide file tree
Showing 62 changed files with 144 additions and 138 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ require (
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
knative.dev/hack v0.0.0-20240607132042-09143140a254
knative.dev/hack/schema v0.0.0-20240607132042-09143140a254
knative.dev/pkg v0.0.0-20240621201938-fc0720b7a660
knative.dev/pkg v0.0.0-20240625072707-8535fcc248ae
knative.dev/reconciler-test v0.0.0-20240618170853-5bf0b86114f8
sigs.k8s.io/yaml v1.4.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,8 @@ knative.dev/hack v0.0.0-20240607132042-09143140a254 h1:1YFnu3U6dWZg0oxm6GU8kEdA9
knative.dev/hack v0.0.0-20240607132042-09143140a254/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/hack/schema v0.0.0-20240607132042-09143140a254 h1:b9hFHGtxx0Kpm4EEjSD72lL0jms91To3OEVBTbqfOYI=
knative.dev/hack/schema v0.0.0-20240607132042-09143140a254/go.mod h1:3pWwBLnTZSM9psSgCAvhKOHIPTzqfEMlWRpDu6IYhK0=
knative.dev/pkg v0.0.0-20240621201938-fc0720b7a660 h1:SYPUGNPA/egS+u6oa6q1kN3Ec+z+we/hPrWie7qhLUg=
knative.dev/pkg v0.0.0-20240621201938-fc0720b7a660/go.mod h1:Wikg4u73T6vk9TctrxZt60VXzqmGEQIx0iKfk1+9o4c=
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/reconciler-test v0.0.0-20240618170853-5bf0b86114f8 h1:A+rsitEiTX3GudM51g7zUMza+Ripj+boncmlJ2jZp50=
knative.dev/reconciler-test v0.0.0-20240618170853-5bf0b86114f8/go.mod h1:2uUx3U6kdIzgJgMGgrGmdDdcFrFiex/DjuI2gM7Tte8=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
3 changes: 1 addition & 2 deletions vendor/knative.dev/pkg/apis/condition_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ limitations under the License.
package apis

import (
"fmt"
"reflect"
"sort"
"time"

"fmt"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
2 changes: 0 additions & 2 deletions vendor/knative.dev/pkg/apis/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func ConvertToViaProxy(
ctx context.Context,
source, proxy, sink Convertible,
) error {

if err := source.ConvertTo(ctx, proxy); err != nil {
return err
}
Expand All @@ -38,7 +37,6 @@ func ConvertFromViaProxy(
ctx context.Context,
source, proxy, sink Convertible,
) error {

if err := proxy.ConvertFrom(ctx, source); err != nil {
return err
}
Expand Down
6 changes: 2 additions & 4 deletions vendor/knative.dev/pkg/apis/duck/v1/addressable_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ type Addressable struct {
Audience *string `json:"audience,omitempty"`
}

var (
// Addressable is a Convertible type.
_ apis.Convertible = (*Addressable)(nil)
)
// Addressable is a Convertible type.
var _ apis.Convertible = (*Addressable)(nil)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/apis/duck/v1/kresource_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (t *KResource) Populate() {
// Populate ALL fields
Type: "Birthday",
Status: corev1.ConditionTrue,
LastTransitionTime: apis.VolatileTime{Inner: metav1.NewTime(time.Date(1984, 02, 28, 18, 52, 00, 00, time.UTC))},
LastTransitionTime: apis.VolatileTime{Inner: metav1.NewTime(time.Date(1984, 2, 28, 18, 52, 0, 0, time.UTC))},
Reason: "Celebrate",
Message: "n3wScott, find your party hat :tada:",
}}
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/apis/duck/v1/source_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (s *Source) Populate() {
// Populate ALL fields
Type: SourceConditionSinkProvided,
Status: corev1.ConditionTrue,
LastTransitionTime: apis.VolatileTime{Inner: metav1.NewTime(time.Date(1984, 02, 28, 18, 52, 00, 00, time.UTC))},
LastTransitionTime: apis.VolatileTime{Inner: metav1.NewTime(time.Date(1984, 2, 28, 18, 52, 0, 0, time.UTC))},
}}
s.Status.SinkURI = &apis.URL{
Scheme: "https",
Expand Down
1 change: 1 addition & 0 deletions vendor/knative.dev/pkg/apis/duck/v1beta1/destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func validateDestinationRef(ref corev1.ObjectReference) *apis.FieldError {

return errs
}

func validateCACerts(CACert *string) *apis.FieldError {
// Check the object.
var errs *apis.FieldError
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/apis/duck/v1beta1/source_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (s *Source) Populate() {
// Populate ALL fields
Type: SourceConditionSinkProvided,
Status: corev1.ConditionTrue,
LastTransitionTime: apis.VolatileTime{Inner: metav1.NewTime(time.Date(1984, 02, 28, 18, 52, 00, 00, time.UTC))},
LastTransitionTime: apis.VolatileTime{Inner: metav1.NewTime(time.Date(1984, 2, 28, 18, 52, 0, 0, time.UTC))},
}}
s.Status.SinkURI = &apis.URL{
Scheme: "https",
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/apis/duck/v1beta1/status_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (t *KResource) Populate() {
// Populate ALL fields
Type: "Birthday",
Status: corev1.ConditionTrue,
LastTransitionTime: apis.VolatileTime{Inner: metav1.NewTime(time.Date(1984, 02, 28, 18, 52, 00, 00, time.UTC))},
LastTransitionTime: apis.VolatileTime{Inner: metav1.NewTime(time.Date(1984, 2, 28, 18, 52, 0, 0, time.UTC))},
Reason: "Celebrate",
Message: "n3wScott, find your party hat :tada:",
}}
Expand Down
6 changes: 4 additions & 2 deletions vendor/knative.dev/pkg/apis/duck/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ import (
"knative.dev/pkg/kmp"
)

type Implementable = ducktypes.Implementable
type Populatable = ducktypes.Populatable
type (
Implementable = ducktypes.Implementable
Populatable = ducktypes.Populatable
)

// VerifyType verifies that a particular concrete resource properly implements
// the provided Implementable duck type. It is expected that under the resource
Expand Down
2 changes: 0 additions & 2 deletions vendor/knative.dev/pkg/apis/testing/roundtrip/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ func objForGVK(t *testing.T,
gvk schema.GroupVersionKind,
scheme *runtime.Scheme,
) convertibleObject {

t.Helper()

obj, err := scheme.New(gvk)
Expand Down Expand Up @@ -235,7 +234,6 @@ func hubInstanceForGK(t *testing.T,
hubs *runtime.Scheme,
gk schema.GroupKind,
) (apis.Convertible, schema.GroupVersionKind) {

t.Helper()

for hubGVK := range hubs.AllKnownTypes() {
Expand Down
6 changes: 2 additions & 4 deletions vendor/knative.dev/pkg/configmap/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ const (
ExampleChecksumAnnotation = "knative.dev/example-checksum"
)

var (
// Allows for normalizing by collapsing newlines.
sequentialNewlines = regexp.MustCompile("(?:\r?\n)+")
)
// Allows for normalizing by collapsing newlines.
var sequentialNewlines = regexp.MustCompile("(?:\r?\n)+")

// Checksum generates a checksum for the example value to be compared against
// a respective annotation.
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/configmap/hash-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func processFile(fileName string) error {
}

//nolint:gosec // This is not security critical so open permissions are fine.
if err := os.WriteFile(fileName, out, 0644); err != nil {
if err := os.WriteFile(fileName, out, 0o644); err != nil {
return fmt.Errorf("failed to write file: %w", err)
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/pkg/configmap/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func NewUntypedStore(
name string,
logger Logger,
constructors Constructors,
onAfterStore ...func(name string, value interface{})) *UntypedStore {

onAfterStore ...func(name string, value interface{}),
) *UntypedStore {
store := &UntypedStore{
name: name,
logger: logger,
Expand Down
14 changes: 6 additions & 8 deletions vendor/knative.dev/pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ const (
DefaultResyncPeriod = 10 * time.Hour
)

var (
// DefaultThreadsPerController is the number of threads to use
// when processing the controller's workqueue. Controller binaries
// may adjust this process-wide default. For finer control, invoke
// Run on the controller directly.
// TODO rename the const to Concurrency and deprecated this
DefaultThreadsPerController = 2
)
// DefaultThreadsPerController is the number of threads to use
// when processing the controller's workqueue. Controller binaries
// may adjust this process-wide default. For finer control, invoke
// Run on the controller directly.
// TODO rename the const to Concurrency and deprecated this
var DefaultThreadsPerController = 2

// Reconciler is the interface that controller implementations are expected
// to implement, so that the shared controller.Impl can drive work through it.
Expand Down
1 change: 0 additions & 1 deletion vendor/knative.dev/pkg/controller/stats_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ func (r *reporter) ReportReconcile(duration time.Duration, success string, key t
tag.Insert(successTagKey, success),
tag.Insert(NamespaceTagKey, key.Namespace),
)

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion vendor/knative.dev/pkg/environment/client_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func (c *ClientConfig) GetRESTConfig() (*rest.Config, error) {
loadingRules,
overrides,
).ClientConfig()

if err != nil {
return nil, fmt.Errorf("failed to create client config: %w", err)
}
Expand Down
5 changes: 2 additions & 3 deletions vendor/knative.dev/pkg/injection/sharedmain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ var (
// In addition to the MainWithConfig flow, it defines a `disabled-controllers` flag that allows disabling controllers
// by name.
func MainNamed(ctx context.Context, component string, ctors ...injection.NamedControllerConstructor) {

disabledControllers := flag.String("disable-controllers", "", "Comma-separated list of disabled controllers.")

// HACK: This parses flags, so the above should be set once this runs.
Expand Down Expand Up @@ -456,8 +455,8 @@ func SecretFetcher(ctx context.Context) metrics.SecretFetcher {
// of the webhooks created from the given constructors.
func ControllersAndWebhooksFromCtors(ctx context.Context,
cmw *cminformer.InformedWatcher,
ctors ...injection.ControllerConstructor) ([]*controller.Impl, []interface{}) {

ctors ...injection.ControllerConstructor,
) ([]*controller.Impl, []interface{}) {
// Check whether the context has been infused with a leader elector builder.
// If it has, then every reconciler we plan to start MUST implement LeaderAware.
leEnabled := leaderelection.HasLeaderElection(ctx)
Expand Down
3 changes: 2 additions & 1 deletion vendor/knative.dev/pkg/leaderelection/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ type standardBuilder struct {
}

func (b *standardBuilder) buildElector(ctx context.Context, la reconciler.LeaderAware,
queueName string, enq func(reconciler.Bucket, types.NamespacedName)) (Elector, error) {
queueName string, enq func(reconciler.Bucket, types.NamespacedName),
) (Elector, error) {
logger := logging.FromContext(ctx)

id := b.lec.Identity
Expand Down
3 changes: 2 additions & 1 deletion vendor/knative.dev/pkg/logging/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ func levelFromString(level string) (*zapcore.Level, error) {
// UpdateLevelFromConfigMap returns a helper func that can be used to update the logging level
// when a config map is updated
func UpdateLevelFromConfigMap(logger *zap.SugaredLogger, atomicLevel zap.AtomicLevel,
levelKey string) func(configMap *corev1.ConfigMap) {
levelKey string,
) func(configMap *corev1.ConfigMap) {
return func(configMap *corev1.ConfigMap) {
config, err := NewConfigFromConfigMap(configMap)
if err != nil {
Expand Down
8 changes: 3 additions & 5 deletions vendor/knative.dev/pkg/metrics/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ const (
prometheusHostEnvName = "METRICS_PROMETHEUS_HOST"
)

var (
// TestOverrideBundleCount is a variable for testing to reduce the size (number of metrics) buffered before
// OpenCensus will send a bundled metric report. Only applies if non-zero.
TestOverrideBundleCount = 0
)
// TestOverrideBundleCount is a variable for testing to reduce the size (number of metrics) buffered before
// OpenCensus will send a bundled metric report. Only applies if non-zero.
var TestOverrideBundleCount = 0

// Metrics backend "enum".
const (
Expand Down
3 changes: 1 addition & 2 deletions vendor/knative.dev/pkg/metrics/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ func flushGivenExporter(e view.Exporter) bool {
return false
}

type noneExporter struct {
}
type noneExporter struct{}

// NoneExporter implements view.Exporter in the nil case.
func (*noneExporter) ExportView(*view.Data) {
Expand Down
4 changes: 1 addition & 3 deletions vendor/knative.dev/pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ type resultMetric struct {
measure *stats.Int64Measure
}

var (
_ metrics.ResultMetric = (*resultMetric)(nil)
)
var _ metrics.ResultMetric = (*resultMetric)(nil)

// Increment implements ResultMetric
func (m resultMetric) Increment(ctx context.Context, code, method, host string) {
Expand Down
1 change: 0 additions & 1 deletion vendor/knative.dev/pkg/metrics/metricstest/metricstest.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func CheckDistributionCount(t ti, name string, wantTags map[string]string, expec
} else if s.Count != expectedCount {
t.Error("reporter count wrong", "metric", name, "got", s.Count, "want", expectedCount)
}

}

// GetLastValueData returns the last value for the given metric, verifying tags.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ func DistributionCountOnlyMetric(name string, count int64, tags map[string]strin
Values: []Value{{
Distribution: &metricdata.Distribution{Count: count},
Tags: tags,
VerifyDistributionCountOnly: true}},
VerifyDistributionCountOnly: true,
}},
}
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/metrics/prometheus_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func startNewPromSrv(e *prom.Exporter, host string, port int) *http.Server {
curPromSrv = &http.Server{
Addr: host + ":" + strconv.Itoa(port),
Handler: sm,
ReadHeaderTimeout: time.Minute, //https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
ReadHeaderTimeout: time.Minute, // https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
}
return curPromSrv
}
25 changes: 16 additions & 9 deletions vendor/knative.dev/pkg/metrics/resource_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ type meterExporter struct {
// for each observed Resource. This is needed because OpenCensus support for
// Resources is a bit tacked-on rather than being a first-class component like
// Tags are.
type ResourceExporterFactory func(*resource.Resource) (view.Exporter, error)
type meters struct {
meters map[string]*meterExporter
factory ResourceExporterFactory
lock sync.Mutex
clock clock.WithTicker
ticker clock.Ticker
tickerStopChan chan struct{}
}
type (
ResourceExporterFactory func(*resource.Resource) (view.Exporter, error)
meters struct {
meters map[string]*meterExporter
factory ResourceExporterFactory
lock sync.Mutex
clock clock.WithTicker
ticker clock.Ticker
tickerStopChan chan struct{}
}
)

// Lock regime: lock allMeters before resourceViews. The critical path is in
// optionForResource, which must lock allMeters, but only needs to lock
Expand Down Expand Up @@ -421,15 +423,19 @@ func (*defaultMeterImpl) Find(name string) *view.View {
func (*defaultMeterImpl) Register(views ...*view.View) error {
return view.Register(views...)
}

func (*defaultMeterImpl) Unregister(views ...*view.View) {
view.Unregister(views...)
}

func (*defaultMeterImpl) SetReportingPeriod(t time.Duration) {
view.SetReportingPeriod(t)
}

func (*defaultMeterImpl) RegisterExporter(e view.Exporter) {
view.RegisterExporter(e)
}

func (*defaultMeterImpl) UnregisterExporter(e view.Exporter) {
view.UnregisterExporter(e)
}
Expand All @@ -438,6 +444,7 @@ func (*defaultMeterImpl) Stop() {}
func (*defaultMeterImpl) RetrieveData(viewName string) ([]*view.Row, error) {
return view.RetrieveData(viewName)
}

func (*defaultMeterImpl) SetResource(*resource.Resource) {
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/network/h2c.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewServer(addr string, h http.Handler) *http.Server {
h1s := &http.Server{
Addr: addr,
Handler: h2c.NewHandler(h, &http2.Server{}),
ReadHeaderTimeout: time.Minute, //https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
ReadHeaderTimeout: time.Minute, // https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
}

return h1s
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/pkg/profiling/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ func NewServer(handler http.Handler) *http.Server {
return &http.Server{
Addr: ":" + port,
Handler: handler,
ReadHeaderTimeout: time.Minute, //https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
ReadHeaderTimeout: time.Minute, // https://medium.com/a-journey-with-go/go-understand-and-mitigate-slowloris-attack-711c1b1403f6
}
}
3 changes: 2 additions & 1 deletion vendor/knative.dev/pkg/reconciler/testing/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ func (r *TableRow) Test(t *testing.T, factory Factory) {

func filterUpdatesWithSubresource(
subresource string,
actions []clientgotesting.UpdateAction) (result []clientgotesting.UpdateAction) {
actions []clientgotesting.UpdateAction,
) (result []clientgotesting.UpdateAction) {
for _, action := range actions {
if action.GetSubresource() == subresource {
result = append(result, action)
Expand Down
3 changes: 2 additions & 1 deletion vendor/knative.dev/pkg/test/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ import (

// NewSpoofingClient returns a spoofing client to make requests
func NewSpoofingClient(ctx context.Context, client kubernetes.Interface, logf logging.FormatLogger,
domain string, resolvable bool, opts ...spoof.TransportOption) (*spoof.SpoofingClient, error) {
domain string, resolvable bool, opts ...spoof.TransportOption,
) (*spoof.SpoofingClient, error) {
return spoof.New(ctx, client, logf, domain, resolvable, Flags.IngressEndpoint,
Flags.SpoofRequestInterval, Flags.SpoofRequestTimeout, opts...)
}
Expand Down
Loading

0 comments on commit 0f71292

Please sign in to comment.