diff --git a/go.mod b/go.mod index cf99c8afa..28f3a9509 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 knative.dev/hack v0.0.0-20240607132042-09143140a254 knative.dev/networking v0.0.0-20240611072033-3b8764c0bb4c - knative.dev/pkg v0.0.0-20240621201938-fc0720b7a660 + knative.dev/pkg v0.0.0-20240625072707-8535fcc248ae sigs.k8s.io/gateway-api v1.1.0 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum index fd5ad726c..b89808d7d 100644 --- a/go.sum +++ b/go.sum @@ -681,8 +681,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/networking v0.0.0-20240611072033-3b8764c0bb4c h1:Q+DdJYzvhwAVWMQtP6mbEr5dNxpr+K9HAF9RqJmZefY= knative.dev/networking v0.0.0-20240611072033-3b8764c0bb4c/go.mod h1:WhZLv94eOMDGHbdZiMrw6cnRfN3WEcFgpjUcV0A48pI= -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= 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= diff --git a/vendor/knative.dev/pkg/apis/condition_set.go b/vendor/knative.dev/pkg/apis/condition_set.go index 1b110475f..9ad14902e 100644 --- a/vendor/knative.dev/pkg/apis/condition_set.go +++ b/vendor/knative.dev/pkg/apis/condition_set.go @@ -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" ) diff --git a/vendor/knative.dev/pkg/apis/convert.go b/vendor/knative.dev/pkg/apis/convert.go index d6a28a072..72e9b6761 100644 --- a/vendor/knative.dev/pkg/apis/convert.go +++ b/vendor/knative.dev/pkg/apis/convert.go @@ -24,7 +24,6 @@ func ConvertToViaProxy( ctx context.Context, source, proxy, sink Convertible, ) error { - if err := source.ConvertTo(ctx, proxy); err != nil { return err } @@ -38,7 +37,6 @@ func ConvertFromViaProxy( ctx context.Context, source, proxy, sink Convertible, ) error { - if err := proxy.ConvertFrom(ctx, source); err != nil { return err } diff --git a/vendor/knative.dev/pkg/apis/duck/v1/addressable_types.go b/vendor/knative.dev/pkg/apis/duck/v1/addressable_types.go index a855c3857..3877683c3 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1/addressable_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1/addressable_types.go @@ -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 diff --git a/vendor/knative.dev/pkg/apis/duck/v1/kresource_type.go b/vendor/knative.dev/pkg/apis/duck/v1/kresource_type.go index 1f6ee8264..9229ba930 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1/kresource_type.go +++ b/vendor/knative.dev/pkg/apis/duck/v1/kresource_type.go @@ -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:", }} diff --git a/vendor/knative.dev/pkg/apis/duck/v1/source_types.go b/vendor/knative.dev/pkg/apis/duck/v1/source_types.go index 95b7d1417..284ab318d 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1/source_types.go +++ b/vendor/knative.dev/pkg/apis/duck/v1/source_types.go @@ -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", diff --git a/vendor/knative.dev/pkg/apis/duck/verify.go b/vendor/knative.dev/pkg/apis/duck/verify.go index 48675f93a..4e33e6597 100644 --- a/vendor/knative.dev/pkg/apis/duck/verify.go +++ b/vendor/knative.dev/pkg/apis/duck/verify.go @@ -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 diff --git a/vendor/knative.dev/pkg/configmap/example.go b/vendor/knative.dev/pkg/configmap/example.go index f14a6e6ff..82aaf9398 100644 --- a/vendor/knative.dev/pkg/configmap/example.go +++ b/vendor/knative.dev/pkg/configmap/example.go @@ -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. diff --git a/vendor/knative.dev/pkg/configmap/store.go b/vendor/knative.dev/pkg/configmap/store.go index 375a474c2..e26580219 100644 --- a/vendor/knative.dev/pkg/configmap/store.go +++ b/vendor/knative.dev/pkg/configmap/store.go @@ -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, diff --git a/vendor/knative.dev/pkg/controller/controller.go b/vendor/knative.dev/pkg/controller/controller.go index 9fdb0a9d5..bc7c4be49 100644 --- a/vendor/knative.dev/pkg/controller/controller.go +++ b/vendor/knative.dev/pkg/controller/controller.go @@ -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. diff --git a/vendor/knative.dev/pkg/controller/stats_reporter.go b/vendor/knative.dev/pkg/controller/stats_reporter.go index 6735285db..99386f91b 100644 --- a/vendor/knative.dev/pkg/controller/stats_reporter.go +++ b/vendor/knative.dev/pkg/controller/stats_reporter.go @@ -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 } diff --git a/vendor/knative.dev/pkg/environment/client_config.go b/vendor/knative.dev/pkg/environment/client_config.go index aef33927e..9f1883d23 100644 --- a/vendor/knative.dev/pkg/environment/client_config.go +++ b/vendor/knative.dev/pkg/environment/client_config.go @@ -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) } diff --git a/vendor/knative.dev/pkg/injection/sharedmain/main.go b/vendor/knative.dev/pkg/injection/sharedmain/main.go index 348599f09..86bb1e340 100644 --- a/vendor/knative.dev/pkg/injection/sharedmain/main.go +++ b/vendor/knative.dev/pkg/injection/sharedmain/main.go @@ -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. @@ -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) diff --git a/vendor/knative.dev/pkg/leaderelection/context.go b/vendor/knative.dev/pkg/leaderelection/context.go index b0122b84a..4cd683063 100644 --- a/vendor/knative.dev/pkg/leaderelection/context.go +++ b/vendor/knative.dev/pkg/leaderelection/context.go @@ -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 diff --git a/vendor/knative.dev/pkg/logging/config.go b/vendor/knative.dev/pkg/logging/config.go index a95dfe8fa..1898ac34f 100644 --- a/vendor/knative.dev/pkg/logging/config.go +++ b/vendor/knative.dev/pkg/logging/config.go @@ -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 { diff --git a/vendor/knative.dev/pkg/metrics/config.go b/vendor/knative.dev/pkg/metrics/config.go index ce5e7f875..9ed17ef67 100644 --- a/vendor/knative.dev/pkg/metrics/config.go +++ b/vendor/knative.dev/pkg/metrics/config.go @@ -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 ( diff --git a/vendor/knative.dev/pkg/metrics/exporter.go b/vendor/knative.dev/pkg/metrics/exporter.go index a4c837348..95e0f5b2f 100644 --- a/vendor/knative.dev/pkg/metrics/exporter.go +++ b/vendor/knative.dev/pkg/metrics/exporter.go @@ -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) { diff --git a/vendor/knative.dev/pkg/metrics/metrics.go b/vendor/knative.dev/pkg/metrics/metrics.go index b65f470cc..a0c64343b 100644 --- a/vendor/knative.dev/pkg/metrics/metrics.go +++ b/vendor/knative.dev/pkg/metrics/metrics.go @@ -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) { diff --git a/vendor/knative.dev/pkg/metrics/prometheus_exporter.go b/vendor/knative.dev/pkg/metrics/prometheus_exporter.go index 5f11c12e8..cb5238476 100644 --- a/vendor/knative.dev/pkg/metrics/prometheus_exporter.go +++ b/vendor/knative.dev/pkg/metrics/prometheus_exporter.go @@ -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 } diff --git a/vendor/knative.dev/pkg/metrics/resource_view.go b/vendor/knative.dev/pkg/metrics/resource_view.go index 69e4ab435..930b38931 100644 --- a/vendor/knative.dev/pkg/metrics/resource_view.go +++ b/vendor/knative.dev/pkg/metrics/resource_view.go @@ -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 @@ -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) } @@ -438,6 +444,7 @@ func (*defaultMeterImpl) Stop() {} func (*defaultMeterImpl) RetrieveData(viewName string) ([]*view.Row, error) { return view.RetrieveData(viewName) } + func (*defaultMeterImpl) SetResource(*resource.Resource) { } diff --git a/vendor/knative.dev/pkg/network/h2c.go b/vendor/knative.dev/pkg/network/h2c.go index e1671233d..d0608be72 100644 --- a/vendor/knative.dev/pkg/network/h2c.go +++ b/vendor/knative.dev/pkg/network/h2c.go @@ -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 diff --git a/vendor/knative.dev/pkg/profiling/server.go b/vendor/knative.dev/pkg/profiling/server.go index f362f36fa..9eceef51c 100644 --- a/vendor/knative.dev/pkg/profiling/server.go +++ b/vendor/knative.dev/pkg/profiling/server.go @@ -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 } } diff --git a/vendor/knative.dev/pkg/reconciler/testing/table.go b/vendor/knative.dev/pkg/reconciler/testing/table.go index d36c49b89..18a83a2bb 100644 --- a/vendor/knative.dev/pkg/reconciler/testing/table.go +++ b/vendor/knative.dev/pkg/reconciler/testing/table.go @@ -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) diff --git a/vendor/knative.dev/pkg/test/clients.go b/vendor/knative.dev/pkg/test/clients.go index 88530c36b..44234100b 100644 --- a/vendor/knative.dev/pkg/test/clients.go +++ b/vendor/knative.dev/pkg/test/clients.go @@ -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...) } diff --git a/vendor/knative.dev/pkg/test/e2e_flags.go b/vendor/knative.dev/pkg/test/e2e_flags.go index ef9b5519e..3860dff94 100644 --- a/vendor/knative.dev/pkg/test/e2e_flags.go +++ b/vendor/knative.dev/pkg/test/e2e_flags.go @@ -29,12 +29,10 @@ import ( "knative.dev/pkg/test/logging" ) -var ( - // Flags holds the command line flags or defaults for settings in the user's environment. - // See EnvironmentFlags for a list of supported fields. - // Deprecated: use test/flags.Flags() - Flags = initializeFlags() -) +// Flags holds the command line flags or defaults for settings in the user's environment. +// See EnvironmentFlags for a list of supported fields. +// Deprecated: use test/flags.Flags() +var Flags = initializeFlags() // EnvironmentFlags define the flags that are needed to run the e2e tests. // Deprecated: use test/flags.Flags() or injection.Flags() diff --git a/vendor/knative.dev/pkg/test/helpers/dir.go b/vendor/knative.dev/pkg/test/helpers/dir.go index e6df61121..e5085f009 100644 --- a/vendor/knative.dev/pkg/test/helpers/dir.go +++ b/vendor/knative.dev/pkg/test/helpers/dir.go @@ -23,7 +23,7 @@ import ( "strings" ) -const allUsersFullPermission = 0777 +const allUsersFullPermission = 0o777 // CreateDir creates dir if does not exist. // The created dir will have the permission bits as 0777, which means everyone can read/write/execute it. diff --git a/vendor/knative.dev/pkg/test/logstream/interface.go b/vendor/knative.dev/pkg/test/logstream/interface.go index a1b39aabd..c9c95459c 100644 --- a/vendor/knative.dev/pkg/test/logstream/interface.go +++ b/vendor/knative.dev/pkg/test/logstream/interface.go @@ -95,7 +95,6 @@ type shim struct { func (s *shim) Start(t ti) Canceler { name := helpers.ObjectPrefixForTest(t) canceler, err := s.StartStream(name, t.Logf) - if err != nil { t.Error("Failed to start logstream", "error", err) } diff --git a/vendor/knative.dev/pkg/test/request.go b/vendor/knative.dev/pkg/test/request.go index a22542e29..46c7d6857 100644 --- a/vendor/knative.dev/pkg/test/request.go +++ b/vendor/knative.dev/pkg/test/request.go @@ -83,7 +83,8 @@ func WaitForEndpointState( inState spoof.ResponseChecker, desc string, resolvable bool, - opts ...interface{}) (*spoof.Response, error) { + opts ...interface{}, +) (*spoof.Response, error) { return WaitForEndpointStateWithTimeout(ctx, kubeClient, logf, url, inState, desc, resolvable, Flags.SpoofRequestTimeout, opts...) } @@ -103,8 +104,8 @@ func WaitForEndpointStateWithTimeout( desc string, resolvable bool, timeout time.Duration, - opts ...interface{}) (*spoof.Response, error) { - + opts ...interface{}, +) (*spoof.Response, error) { client, rOpts, err := makeSpoofClient(ctx, kubeClient, logf, url, resolvable, timeout, opts...) if err != nil { return nil, err @@ -119,8 +120,8 @@ func makeSpoofClient( url *url.URL, resolvable bool, timeout time.Duration, - opts ...interface{}) (*spoof.SpoofingClient, []spoof.RequestOption, error) { - + opts ...interface{}, +) (*spoof.SpoofingClient, []spoof.RequestOption, error) { var tOpts []spoof.TransportOption var rOpts []spoof.RequestOption diff --git a/vendor/knative.dev/pkg/test/spoof/spoof.go b/vendor/knative.dev/pkg/test/spoof/spoof.go index 716e5d83d..ac1c23e7d 100644 --- a/vendor/knative.dev/pkg/test/spoof/spoof.go +++ b/vendor/knative.dev/pkg/test/spoof/spoof.go @@ -100,7 +100,8 @@ func New( resolvable bool, endpointOverride string, requestInterval, requestTimeout time.Duration, - opts ...TransportOption) (*SpoofingClient, error) { + opts ...TransportOption, +) (*SpoofingClient, error) { endpoint, mapper, err := ResolveEndpoint(ctx, kubeClientset, domain, resolvable, endpointOverride) if err != nil { return nil, fmt.Errorf("failed to get the cluster endpoint: %w", err) @@ -288,8 +289,8 @@ func (sc *SpoofingClient) WaitForEndpointState( url *url.URL, inState ResponseChecker, desc string, - opts ...RequestOption) (*Response, error) { - + opts ...RequestOption, +) (*Response, error) { return sc.endpointState( ctx, url, @@ -307,7 +308,8 @@ func (sc *SpoofingClient) endpointState( desc string, f func(*http.Request, ResponseChecker) (*Response, error), logName string, - opts ...RequestOption) (*Response, error) { + opts ...RequestOption, +) (*Response, error) { defer logging.GetEmitableSpan(ctx, logName+"/"+desc).End() if url.Scheme == "" || url.Host == "" { @@ -348,7 +350,8 @@ func (sc *SpoofingClient) CheckEndpointState( url *url.URL, inState ResponseChecker, desc string, - opts ...RequestOption) (*Response, error) { + opts ...RequestOption, +) (*Response, error) { return sc.endpointState( ctx, url, diff --git a/vendor/knative.dev/pkg/tracker/interface.go b/vendor/knative.dev/pkg/tracker/interface.go index 5e580b34c..58bc941d8 100644 --- a/vendor/knative.dev/pkg/tracker/interface.go +++ b/vendor/knative.dev/pkg/tracker/interface.go @@ -177,5 +177,4 @@ func (ref *Reference) Validate(ctx context.Context) *apis.FieldError { } return errs - } diff --git a/vendor/knative.dev/pkg/webhook/admission.go b/vendor/knative.dev/pkg/webhook/admission.go index db131b902..9e14eae89 100644 --- a/vendor/knative.dev/pkg/webhook/admission.go +++ b/vendor/knative.dev/pkg/webhook/admission.go @@ -88,7 +88,7 @@ func admissionHandler(rootLogger *zap.SugaredLogger, stats StatsReporter, c Admi <-synced } - var ttStart = time.Now() + ttStart := time.Now() logger := rootLogger logger.Infof("Webhook ServeHTTP request=%#v", r) diff --git a/vendor/knative.dev/pkg/webhook/certificates/certificates.go b/vendor/knative.dev/pkg/webhook/certificates/certificates.go index 5239279e5..21c6bdec6 100644 --- a/vendor/knative.dev/pkg/webhook/certificates/certificates.go +++ b/vendor/knative.dev/pkg/webhook/certificates/certificates.go @@ -48,8 +48,10 @@ type reconciler struct { serviceName string } -var _ controller.Reconciler = (*reconciler)(nil) -var _ pkgreconciler.LeaderAware = (*reconciler)(nil) +var ( + _ controller.Reconciler = (*reconciler)(nil) + _ pkgreconciler.LeaderAware = (*reconciler)(nil) +) // Reconcile implements controller.Reconciler func (r *reconciler) Reconcile(ctx context.Context, key string) error { diff --git a/vendor/knative.dev/pkg/webhook/certificates/controller.go b/vendor/knative.dev/pkg/webhook/certificates/controller.go index 1932e28c2..b076bd661 100644 --- a/vendor/knative.dev/pkg/webhook/certificates/controller.go +++ b/vendor/knative.dev/pkg/webhook/certificates/controller.go @@ -41,7 +41,6 @@ func NewController( ctx context.Context, cmw configmap.Watcher, ) *controller.Impl { - client := kubeclient.Get(ctx) secretInformer := secretinformer.Get(ctx) options := webhook.GetOptions(ctx) diff --git a/vendor/knative.dev/pkg/webhook/certificates/resources/certs.go b/vendor/knative.dev/pkg/webhook/certificates/resources/certs.go index 811eb569c..cb56c8cef 100644 --- a/vendor/knative.dev/pkg/webhook/certificates/resources/certs.go +++ b/vendor/knative.dev/pkg/webhook/certificates/resources/certs.go @@ -98,8 +98,8 @@ func createServerCertTemplate(name, namespace string, notAfter time.Time) (*x509 // Actually sign the cert and return things in a form that we can use later on func createCert(template, parent *x509.Certificate, pub, parentPriv interface{}) ( - cert *x509.Certificate, certPEM []byte, err error) { - + cert *x509.Certificate, certPEM []byte, err error, +) { certDER, err := x509.CreateCertificate(rand.Reader, template, parent, pub, parentPriv) if err != nil { return diff --git a/vendor/knative.dev/pkg/webhook/configmaps/configmaps.go b/vendor/knative.dev/pkg/webhook/configmaps/configmaps.go index 5a4c4d888..d7d37b8ec 100644 --- a/vendor/knative.dev/pkg/webhook/configmaps/configmaps.go +++ b/vendor/knative.dev/pkg/webhook/configmaps/configmaps.go @@ -61,10 +61,12 @@ type reconciler struct { secretName string } -var _ controller.Reconciler = (*reconciler)(nil) -var _ pkgreconciler.LeaderAware = (*reconciler)(nil) -var _ webhook.AdmissionController = (*reconciler)(nil) -var _ webhook.StatelessAdmissionController = (*reconciler)(nil) +var ( + _ controller.Reconciler = (*reconciler)(nil) + _ pkgreconciler.LeaderAware = (*reconciler)(nil) + _ webhook.AdmissionController = (*reconciler)(nil) + _ webhook.StatelessAdmissionController = (*reconciler)(nil) +) // Reconcile implements controller.Reconciler func (ac *reconciler) Reconcile(ctx context.Context, key string) error { diff --git a/vendor/knative.dev/pkg/webhook/configmaps/controller.go b/vendor/knative.dev/pkg/webhook/configmaps/controller.go index c2d71eb03..9c2aae495 100644 --- a/vendor/knative.dev/pkg/webhook/configmaps/controller.go +++ b/vendor/knative.dev/pkg/webhook/configmaps/controller.go @@ -41,7 +41,6 @@ func NewAdmissionController( name, path string, constructors configmap.Constructors, ) *controller.Impl { - client := kubeclient.Get(ctx) vwhInformer := vwhinformer.Get(ctx) secretInformer := secretinformer.Get(ctx) diff --git a/vendor/knative.dev/pkg/webhook/conversion.go b/vendor/knative.dev/pkg/webhook/conversion.go index 2e876c14f..fa3c76a70 100644 --- a/vendor/knative.dev/pkg/webhook/conversion.go +++ b/vendor/knative.dev/pkg/webhook/conversion.go @@ -40,7 +40,7 @@ type ConversionController interface { func conversionHandler(rootLogger *zap.SugaredLogger, stats StatsReporter, c ConversionController) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - var ttStart = time.Now() + ttStart := time.Now() logger := rootLogger logger.Infof("Webhook ServeHTTP request=%#v", r) diff --git a/vendor/knative.dev/pkg/webhook/helper.go b/vendor/knative.dev/pkg/webhook/helper.go index a3647ac74..a9ff91fe2 100644 --- a/vendor/knative.dev/pkg/webhook/helper.go +++ b/vendor/knative.dev/pkg/webhook/helper.go @@ -29,8 +29,8 @@ import ( // adds all knative-keys not yet there. func EnsureLabelSelectorExpressions( current *metav1.LabelSelector, - want *metav1.LabelSelector) *metav1.LabelSelector { - + want *metav1.LabelSelector, +) *metav1.LabelSelector { if current == nil { return want } @@ -56,8 +56,8 @@ func EnsureLabelSelectorExpressions( func ensureLabelSelectorRequirements( current []metav1.LabelSelectorRequirement, - want []metav1.LabelSelectorRequirement) []metav1.LabelSelectorRequirement { - + want []metav1.LabelSelectorRequirement, +) []metav1.LabelSelectorRequirement { nonKnative := make([]metav1.LabelSelectorRequirement, 0, len(current)) for _, r := range current { if !strings.Contains(r.Key, "knative.dev") { diff --git a/vendor/knative.dev/pkg/webhook/stats_reporter.go b/vendor/knative.dev/pkg/webhook/stats_reporter.go index 3f05d4a91..bc62820b9 100644 --- a/vendor/knative.dev/pkg/webhook/stats_reporter.go +++ b/vendor/knative.dev/pkg/webhook/stats_reporter.go @@ -66,8 +66,10 @@ var ( resultCodeKey = tag.MustNewKey("result_code") ) -type admissionToValue func(*admissionv1.AdmissionRequest, *admissionv1.AdmissionResponse) string -type conversionToValue func(*apixv1.ConversionRequest, *apixv1.ConversionResponse) string +type ( + admissionToValue func(*admissionv1.AdmissionRequest, *admissionv1.AdmissionResponse) string + conversionToValue func(*apixv1.ConversionRequest, *apixv1.ConversionResponse) string +) var ( allAdmissionTags = map[tag.Key]admissionToValue{ diff --git a/vendor/knative.dev/pkg/webhook/webhook.go b/vendor/knative.dev/pkg/webhook/webhook.go index d8842df35..e91262db2 100644 --- a/vendor/knative.dev/pkg/webhook/webhook.go +++ b/vendor/knative.dev/pkg/webhook/webhook.go @@ -132,7 +132,6 @@ func New( ctx context.Context, controllers []interface{}, ) (webhook *Webhook, err error) { - // ServeMux.Handle panics on duplicate paths defer func() { if r := recover(); r != nil { @@ -270,11 +269,11 @@ func (wh *Webhook) Run(stop <-chan struct{}) error { Handler: drainer, Addr: fmt.Sprint(":", wh.Options.Port), TLSConfig: wh.tlsConfig, - 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 TLSNextProto: nextProto, } - var serve = server.ListenAndServe + serve := server.ListenAndServe if server.TLSConfig != nil && wh.testListener != nil { serve = func() error { diff --git a/vendor/modules.txt b/vendor/modules.txt index fa2c2260b..4c0c9f5c8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -951,7 +951,7 @@ knative.dev/networking/test/test_images/runtime/handlers knative.dev/networking/test/test_images/timeout knative.dev/networking/test/test_images/wsserver knative.dev/networking/test/types -# knative.dev/pkg v0.0.0-20240621201938-fc0720b7a660 +# knative.dev/pkg v0.0.0-20240625072707-8535fcc248ae ## explicit; go 1.22 knative.dev/pkg/apis knative.dev/pkg/apis/duck