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

OSSM-1689 Simplify IOR #747

Merged
merged 53 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ba731e7
Rework IOR initialization
yannuil Nov 3, 2022
55fd7d6
Remove `initialSync`
yannuil Oct 13, 2022
12aef38
DIsable TestPref
yannuil Oct 13, 2022
e9b0157
Rename
yannuil Oct 14, 2022
6d59bd3
Call `findService` once for each gateway
yannuil Oct 14, 2022
624d514
Use original host to generate Route name
yannuil Oct 14, 2022
3efe45d
Skip duplicate update test
yannuil Oct 14, 2022
a5f1252
Improve concurrency test
yannuil Oct 14, 2022
3a3d332
Introduce update Route on Gateway update
yannuil Oct 14, 2022
96f85ae
Fix data race
yannuil Oct 17, 2022
ab47b49
Format and lint
yannuil Oct 17, 2022
cbb4bf7
Respect log level
yannuil Oct 18, 2022
1d8ef68
Refactor IOR
yannuil Nov 3, 2022
828d04a
Remove unused functions
yannuil Nov 4, 2022
1942ac9
Use `Lister` for finding target service
yannuil Nov 8, 2022
45e0ba7
Start IOR before kube client
yannuil Nov 11, 2022
ca74c61
Remove unused properties
yannuil Nov 11, 2022
d16b058
Rework test initialization
yannuil Nov 11, 2022
b16cff0
Log correct debug information
yannuil Nov 28, 2022
0c65148
Remove unnecessary parameters
yannuil Nov 28, 2022
594997f
Remove ResourceVersion usage
yannuil Nov 28, 2022
db9994d
Avoid deletion of a route when failing to update
yannuil Nov 28, 2022
d1cba59
Update FakeRouter to record API call counts
yannuil Nov 28, 2022
267c755
Rework initialization
yannuil Nov 28, 2022
eddd8c3
Keep startup process order consistent
yannuil Nov 28, 2022
203e223
Fix creating matching service
yannuil Nov 28, 2022
0abdde8
Test IOR to be idempotent
yannuil Nov 28, 2022
3d993c2
Remove unused parameters
yannuil Nov 28, 2022
fab5517
Rename symbol
yannuil Dec 5, 2022
4de56d3
Remove used struct
yannuil Dec 5, 2022
b5342ad
Improve styling and wording
yannuil Dec 5, 2022
7dc9121
Add support list across namespaces in faker
yannuil Dec 8, 2022
e809f88
Lint and format
yannuil Dec 9, 2022
283d7ca
Introduce Openshift Route informer
yannuil Feb 16, 2023
3b336b2
Lint
yannuil Feb 16, 2023
ebcee30
Run make gen
yannuil Feb 16, 2023
65ebd77
Fix data race
yannuil Feb 16, 2023
9b0f2e3
Fix test data race
yannuil Feb 17, 2023
71b314b
Lint
yannuil Feb 17, 2023
ce4fb72
Rename variables
yannuil Feb 23, 2023
5f55bba
Fix update route
yannuil Feb 27, 2023
af9e301
Linit
yannuil Feb 27, 2023
8f037c6
Increase wait for the delete
yannuil Feb 27, 2023
11e6f35
Maximize time to wait for the route deletion
yannuil Feb 27, 2023
40ffd68
Fix route update
yannuil Feb 28, 2023
09ba5ad
Fix route update
yannuil Mar 1, 2023
89adf47
Test with a 30 second wait
yannuil Mar 2, 2023
2d1a584
Fix flaky test
yannuil Mar 21, 2023
b190c5d
Add disabling IOR and clean up
yannuil Mar 21, 2023
bb4816c
Defer clean up
yannuil Mar 21, 2023
afb11d2
Clear only ior routes
yannuil Mar 21, 2023
c148353
rename newRoute to newRouteController
luksa Mar 22, 2023
06c7899
rename route.go to controller.go
luksa Mar 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require (
github.com/kylelemons/godebug v1.1.0
github.com/lestrrat-go/jwx v1.2.25
github.com/lucas-clemente/quic-go v0.29.0
github.com/maistra/xns-informer v0.0.0-20230111124621-73ee35e5f523
github.com/maistra/xns-informer v0.0.0-20230213111714-f8d2c0b0070d
github.com/mattn/go-isatty v0.0.16
github.com/miekg/dns v1.1.50
github.com/mitchellh/copystructure v1.2.0
Expand Down Expand Up @@ -229,7 +229,7 @@ require (
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/stretchr/testify v1.8.0
github.com/stretchr/testify v1.8.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/vbatts/tar-split v0.11.2 // indirect
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/maistra/xns-informer v0.0.0-20230111124621-73ee35e5f523 h1:NjeYQr1oG3nrSWUqmOIQMIYucJI8t/nPp0txdKwraYk=
github.com/maistra/xns-informer v0.0.0-20230111124621-73ee35e5f523/go.mod h1:2DP6ps5pmbxaazskTazVHwwLF+RiW+EtcJqQxLBaWH8=
github.com/maistra/xns-informer v0.0.0-20230213111714-f8d2c0b0070d h1:r5dEcBh/3VTleWxk9vwWarGHNIkHm9ckL8hSi0RuXwM=
github.com/maistra/xns-informer v0.0.0-20230213111714-f8d2c0b0070d/go.mod h1:spcyztqFmNgRgHI9LgWfh4pjamak9cSphQfI3PxGxJM=
github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU=
github.com/marten-seemann/qpack v0.2.1 h1:jvTsT/HpCn2UZJdP+UUB53FfUUgeOyG5K1ns0OJOGVs=
github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc=
Expand Down
21 changes: 0 additions & 21 deletions licenses/github.com/stretchr/testify/LICENSE

This file was deleted.

38 changes: 10 additions & 28 deletions pilot/pkg/bootstrap/configcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ func (s *Server) initConfigController(args *PilotArgs) error {
// Create the config store.
s.environment.ConfigStore = aggregateConfigController

s.startIOR(args)

// Defer starting the controller until after the service is created.
s.addStartFunc(func(stop <-chan struct{}) error {
go s.configController.Run(stop)
Expand All @@ -160,32 +158,6 @@ func (s *Server) initConfigController(args *PilotArgs) error {
return nil
}

// startIOR tries to start IOR, if it's enabled. If it encounters any failure, it logs an error and continue
func (s *Server) startIOR(args *PilotArgs) {
if !features.EnableIOR {
return
}

routerClient, err := ior.NewRouterClient()
if err != nil {
ior.IORLog.Errorf("error creating an openshift router client: %v", err)
return
}

iorKubeClient := ior.NewKubeClient(s.kubeClient)

s.addStartFunc(func(stop <-chan struct{}) error {
go leaderelection.
NewLeaderElection(args.Namespace, args.PodName, leaderelection.IORController, args.Revision, s.kubeClient).
AddRunFunction(func(stop <-chan struct{}) {
if err := ior.Register(iorKubeClient, routerClient, s.configController, args.Namespace, s.kubeClient.GetMemberRoll(), stop, nil); err != nil {
ior.IORLog.Error(err)
}
}).Run(stop)
return nil
})
}

func (s *Server) initK8SConfigStore(args *PilotArgs) error {
if s.kubeClient == nil {
return nil
Expand Down Expand Up @@ -248,6 +220,16 @@ func (s *Server) initK8SConfigStore(args *PilotArgs) error {
return err
}
}
if features.EnableIOR {
s.addTerminatingStartFunc(func(stop <-chan struct{}) error {
leaderelection.
NewLeaderElection(args.Namespace, args.PodName, leaderelection.IORController, args.Revision, s.kubeClient).
AddRunFunction(func(leaderStop <-chan struct{}) {
ior.Run(s.kubeClient, configController, leaderStop)
}).Run(stop)
return nil
})
}
s.RWConfigStore, err = configaggregate.MakeWriteableCache(s.ConfigStores, configController)
if err != nil {
return err
Expand Down