Skip to content

Commit

Permalink
fix: add oidc label selector to main contexts (partial cherry pick of k…
Browse files Browse the repository at this point in the history
…native#7527)

Signed-off-by: Calum Murray <[email protected]>
  • Loading branch information
Cali0707 committed Jul 4, 2024
1 parent 1c43d04 commit 858b6a9
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/apiserver_receive_adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"knative.dev/eventing/pkg/adapter/apiserver"
"knative.dev/eventing/pkg/adapter/v2"
"knative.dev/eventing/pkg/auth"
"knative.dev/eventing/pkg/eventingtls"
)

Expand All @@ -34,6 +35,7 @@ func main() {
ctx = adapter.WithInjectorEnabled(ctx)

ctx = filteredFactory.WithSelectors(ctx,
auth.OIDCLabelSelector,
eventingtls.TrustBundleLabelSelector,
)

Expand Down
1 change: 1 addition & 0 deletions cmd/broker/filter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func main() {
log.Printf("Registering %d informers", len(injection.Default.GetInformers()))

ctx = filteredFactory.WithSelectors(ctx,
auth.OIDCLabelSelector,
eventingtls.TrustBundleLabelSelector,
)

Expand Down
1 change: 1 addition & 0 deletions cmd/broker/ingress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func main() {
log.Printf("Registering %d informers", len(injection.Default.GetInformers()))

ctx = filteredFactory.WithSelectors(ctx,
auth.OIDCLabelSelector,
eventingtls.TrustBundleLabelSelector,
)

Expand Down
2 changes: 2 additions & 0 deletions cmd/in_memory/channel_dispatcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"knative.dev/pkg/injection/sharedmain"
"knative.dev/pkg/signals"

"knative.dev/eventing/pkg/auth"
"knative.dev/eventing/pkg/eventingtls"
inmemorychannel "knative.dev/eventing/pkg/reconciler/inmemorychannel/dispatcher"
)
Expand All @@ -39,6 +40,7 @@ func main() {
}

ctx = filteredFactory.WithSelectors(ctx,
auth.OIDCLabelSelector,
eventingtls.TrustBundleLabelSelector,
)

Expand Down
9 changes: 8 additions & 1 deletion cmd/mtchannel_broker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ import (

"context"

filteredfactory "knative.dev/pkg/client/injection/kube/informers/factory/filtered"
"knative.dev/pkg/injection/sharedmain"
"knative.dev/pkg/signals"

"knative.dev/eventing/pkg/auth"
"knative.dev/eventing/pkg/reconciler/broker"
mttrigger "knative.dev/eventing/pkg/reconciler/broker/trigger"
)
Expand All @@ -33,7 +36,11 @@ const (
)

func main() {
sharedmain.Main(
ctx := signals.NewContext()

ctx = filteredfactory.WithSelectors(ctx, auth.OIDCLabelSelector)

sharedmain.MainWithContext(ctx,
component,

broker.NewController,
Expand Down
2 changes: 2 additions & 0 deletions cmd/mtping/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"knative.dev/eventing/pkg/adapter/mtping"
"knative.dev/eventing/pkg/adapter/v2"
"knative.dev/eventing/pkg/auth"
"knative.dev/eventing/pkg/eventingtls"
)

Expand Down Expand Up @@ -57,6 +58,7 @@ func main() {
})

ctx = filteredFactory.WithSelectors(ctx,
auth.OIDCLabelSelector,
eventingtls.TrustBundleLabelSelector,
)

Expand Down
2 changes: 2 additions & 0 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
configmapinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/filtered"

"knative.dev/eventing/pkg/apis/feature"
"knative.dev/eventing/pkg/auth"
"knative.dev/eventing/pkg/eventingtls"

filteredFactory "knative.dev/pkg/client/injection/kube/informers/factory/filtered"
Expand Down Expand Up @@ -287,6 +288,7 @@ func main() {
})

ctx = filteredFactory.WithSelectors(ctx,
auth.OIDCLabelSelector,
eventingtls.TrustBundleLabelSelector,
)

Expand Down

0 comments on commit 858b6a9

Please sign in to comment.