Skip to content

Commit

Permalink
Upgrade to latest dependencies (#3321)
Browse files Browse the repository at this point in the history
* Update dependencies

* Fix build issue (switch to statefulsetscheduler.New())

* Fix more build issues (broker.SetAddress())

* Use MAXFILLUP

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

---------

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com>
  • Loading branch information
creydr and pierDipi authored Sep 29, 2023
1 parent 6932c82 commit 977b7ed
Show file tree
Hide file tree
Showing 169 changed files with 4,547 additions and 6,259 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package v1alpha1

import (
"knative.dev/pkg/apis"
v1 "knative.dev/pkg/apis/duck/v1"
duckv1 "knative.dev/pkg/apis/duck/v1"
)

const (
Expand All @@ -41,10 +41,9 @@ func (ks *KafkaSinkStatus) GetConditionSet() apis.ConditionSet {

// SetAddress makes this Kafka Sink addressable by setting the URI. It also
// sets the ConditionAddressable to true.
func (ks *KafkaSinkStatus) SetAddress(url *apis.URL) {
ks.AddressStatus.Address = &v1.Addressable{}
ks.AddressStatus.Address.URL = url
if url != nil {
func (ks *KafkaSinkStatus) SetAddress(addr *duckv1.Addressable) {
ks.AddressStatus.Address = addr
if addr != nil {
ks.GetConditionSet().Manage(ks).MarkTrue(ConditionAddressable)
} else {
ks.GetConditionSet().Manage(ks).MarkFalse(ConditionAddressable, "nil URL", "URL is nil")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"k8s.io/utils/pointer"
"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"
)

func TestKafkaSinkStatusSetAddress(t *testing.T) {
status := KafkaSinkStatus{}
status.SetAddress(apis.HTTP("localhost"))
status.SetAddress(&duckv1.Addressable{
Name: pointer.String("http"),
URL: apis.HTTP("localhost"),
})

addressable := status.GetCondition(ConditionAddressable).IsTrue()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ func (kcs *KafkaChannelStatus) InitializeConditions() {
}

// SetAddress sets the address (as part of Addressable contract) and marks the correct condition.
func (kcs *KafkaChannelStatus) SetAddress(url *apis.URL) {
func (kcs *KafkaChannelStatus) SetAddress(addr *duckv1.Addressable) {
if kcs.Address == nil {
kcs.Address = &duckv1.Addressable{}
}
if url != nil {
kcs.Address.URL = url
if addr != nil {
kcs.Address = addr
kcs.GetConditionSet().Manage(kcs).MarkTrue(KafkaChannelConditionAddressable)
} else {
kcs.Address.URL = nil
Expand Down
28 changes: 15 additions & 13 deletions control-plane/pkg/reconciler/base/receiver_condition_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type Object interface {
type StatusConditionManager struct {
Object Object

SetAddress func(u *apis.URL)
SetAddress func(addr *duckv1.Addressable)

Env *config.Env
BootstrapServers string
Expand Down Expand Up @@ -196,18 +196,20 @@ func (manager *StatusConditionManager) FailedToGetBrokerAuthSecret(err error) re
}

func (manager *StatusConditionManager) Addressable(address *url.URL) {
manager.SetAddress(&apis.URL{
Scheme: address.Scheme,
Opaque: address.Opaque,
User: address.User,
Host: address.Host,
Path: address.Path,
RawPath: address.RawPath,
ForceQuery: address.ForceQuery,
RawQuery: address.RawQuery,
Fragment: address.Fragment,
RawFragment: address.RawFragment,
})
manager.SetAddress(&duckv1.Addressable{
Name: &address.Scheme,
URL: &apis.URL{
Scheme: address.Scheme,
Opaque: address.Opaque,
User: address.User,
Host: address.Host,
Path: address.Path,
RawPath: address.RawPath,
ForceQuery: address.ForceQuery,
RawQuery: address.RawQuery,
Fragment: address.Fragment,
RawFragment: address.RawFragment,
}})
manager.Object.GetConditionSet().Manage(manager.Object.GetStatus()).MarkTrue(ConditionAddressable)
manager.ProbesStatusReady()
}
Expand Down
25 changes: 12 additions & 13 deletions control-plane/pkg/reconciler/consumergroup/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,18 @@ func getSelectorLabel(ssName string) map[string]string {
}

func createStatefulSetScheduler(ctx context.Context, c SchedulerConfig, lister scheduler.VPodLister) Scheduler {
ss := statefulsetscheduler.NewScheduler(
ctx,
system.Namespace(),
c.StatefulSetName,
lister,
c.RefreshPeriod,
c.Capacity,
"", // scheduler.SchedulerPolicyType field only applicable for old scheduler policy
nodeinformer.Get(ctx).Lister(),
newEvictor(ctx, zap.String("kafka.eventing.knative.dev/component", "evictor")).evict,
c.SchedulerPolicy,
c.DeSchedulerPolicy,
)
ss, _ := statefulsetscheduler.New(ctx, &statefulsetscheduler.Config{
StatefulSetNamespace: system.Namespace(),
StatefulSetName: c.StatefulSetName,
PodCapacity: c.Capacity,
RefreshPeriod: c.RefreshPeriod,
SchedulerPolicy: scheduler.MAXFILLUP,
SchedPolicy: c.SchedulerPolicy,
DeschedPolicy: c.DeSchedulerPolicy,
Evictor: newEvictor(ctx, zap.String("kafka.eventing.knative.dev/component", "evictor")).evict,
VPodLister: lister,
NodeLister: nodeinformer.Get(ctx).Lister(),
})

return Scheduler{
Scheduler: ss,
Expand Down
27 changes: 13 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ require (
go.opentelemetry.io/otel/trace v1.10.0
go.uber.org/atomic v1.9.0
go.uber.org/multierr v1.10.0
go.uber.org/zap v1.25.0
go.uber.org/zap v1.26.0
google.golang.org/protobuf v1.31.0
k8s.io/api v0.26.5
k8s.io/apiextensions-apiserver v0.26.5
k8s.io/apimachinery v0.26.5
k8s.io/apiserver v0.26.5
k8s.io/client-go v0.26.5
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2
knative.dev/eventing v0.38.1-0.20230830050331-dd68bd316559
knative.dev/hack v0.0.0-20230818155117-9cc05a31e8c0
knative.dev/pkg v0.0.0-20230829134737-fcccb4e1a0a4
knative.dev/reconciler-test v0.0.0-20230817080342-39774f133674
knative.dev/eventing v0.38.1-0.20230922120019-37a0e3ceac14
knative.dev/hack v0.0.0-20230922114927-da6e74ccb8e8
knative.dev/pkg v0.0.0-20230922122916-05a411a3e26f
knative.dev/reconciler-test v0.0.0-20230920080213-4b73d83f40fc
sigs.k8s.io/controller-runtime v0.12.3
sigs.k8s.io/yaml v1.3.0
)
Expand All @@ -48,13 +48,12 @@ require (
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.1 // indirect
cloud.google.com/go/storage v1.32.0 // indirect
cloud.google.com/go/storage v1.33.0 // indirect
contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect
contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect
contrib.go.opencensus.io/exporter/zipkin v0.1.2 // indirect
github.com/ahmetb/gen-crd-api-reference-docs v0.3.1-0.20210420163308-c1402a70e2f1 // indirect
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
Expand All @@ -69,7 +68,7 @@ require (
github.com/eapache/queue v1.1.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/evanphx/json-patch/v5 v5.7.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.2.4 // indirect
Expand All @@ -86,7 +85,7 @@ require (
github.com/google/go-github/v27 v27.0.6 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/mako v0.0.0-20190821191249-122f8dcef9e3 // indirect
github.com/google/s2a-go v0.1.5 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
Expand Down Expand Up @@ -132,21 +131,21 @@ require (
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.12.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/api v0.138.0 // indirect
google.golang.org/api v0.141.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect
google.golang.org/grpc v1.57.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230911183012-2d3300fd4832 // indirect
google.golang.org/grpc v1.58.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 977b7ed

Please sign in to comment.