Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add maximum concurrent reconciles command-line option to provider executable #4

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func main() {
app = kingpin.New(filepath.Base(os.Args[0]), "Azure support for Crossplane.").DefaultEnvars()
debug = app.Flag("debug", "Run with debug logging.").Short('d').Bool()
syncPeriod = app.Flag("sync", "Controller manager sync period such as 300ms, 1.5h, or 2h45m").Short('s').Default("1h").Duration()
concurrency = app.Flag("concurrent-reconciles", "Maximum number of concurrent reconciles which can be run per resource.").Short('c').Default("1").Int()
leaderElection = app.Flag("leader-election", "Use leader election for the controller manager.").Short('l').Default("false").OverrideDefaultFromEnvar("LEADER_ELECTION").Bool()
)
kingpin.MustParse(app.Parse(os.Args[1:]))
Expand Down Expand Up @@ -63,6 +64,6 @@ func main() {

rl := ratelimiter.NewDefaultProviderRateLimiter(ratelimiter.DefaultProviderRPS)
kingpin.FatalIfError(apis.AddToScheme(mgr.GetScheme()), "Cannot add Azure APIs to scheme")
kingpin.FatalIfError(controller.Setup(mgr, log, rl), "Cannot setup Azure controllers")
kingpin.FatalIfError(controller.Setup(mgr, log, rl, *concurrency), "Cannot setup Azure controllers")
kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager")
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/crossplane-contrib/provider-tf-azure
go 1.16

require (
github.com/crossplane-contrib/terrajet v0.0.0-20210913140820-03b092f395b0
github.com/crossplane-contrib/terrajet v0.0.0-20210917171419-9b4eaff67cf5
github.com/crossplane/crossplane-runtime v0.15.0
github.com/crossplane/crossplane-tools v0.0.0-20210320162312-1baca298c527
github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/crossplane-contrib/terrajet v0.0.0-20210913140820-03b092f395b0 h1:9gafHW1I0oHhYpeFIUMR3NGSFsxxjPn1oMIMFhNao3g=
github.com/crossplane-contrib/terrajet v0.0.0-20210913140820-03b092f395b0/go.mod h1:fIpnwEfn6Dlmso1W8AtHIw9WyscMHefZobr5UE9mokk=
github.com/crossplane-contrib/terrajet v0.0.0-20210917171419-9b4eaff67cf5 h1:aSZT20yxBZ3CcmZHrlS7JG2hipOAqXRTDzwjHCEgtus=
github.com/crossplane-contrib/terrajet v0.0.0-20210917171419-9b4eaff67cf5/go.mod h1:fIpnwEfn6Dlmso1W8AtHIw9WyscMHefZobr5UE9mokk=
github.com/crossplane/crossplane-runtime v0.15.0 h1:05a9ypKyt2BDdGycrx2iOhLImw+1SsfWR6zO2FO5nDM=
github.com/crossplane/crossplane-runtime v0.15.0/go.mod h1:XvktCTRFTkdP2jR2PecrvhsxzSO8XT3jHxTOk/k+NL8=
github.com/crossplane/crossplane-tools v0.0.0-20210320162312-1baca298c527 h1:9M6hMLKqjxtL9d9nwfcaAt59Ey0CPfSXQ3iIdYRUNaE=
Expand Down
5 changes: 3 additions & 2 deletions internal/controller/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ import (

// Setup adds a controller that reconciles ProviderConfigs by accounting for
// their current usage.
func Setup(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLimiter) error {
func Setup(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLimiter, concurrency int) error {
name := providerconfig.ControllerName(v1alpha1.ProviderConfigGroupKind)

o := controller.Options{
RateLimiter: ratelimiter.NewDefaultManagedRateLimiter(rl),
RateLimiter: ratelimiter.NewDefaultManagedRateLimiter(rl),
MaxConcurrentReconciles: concurrency,
}

of := resource.ProviderConfigKinds{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/controller/virtual/virtualhub/zz_controller.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/controller/virtual/virtualhubip/zz_controller.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/controller/virtual/virtualmachine/zz_controller.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/controller/virtual/virtualnetwork/zz_controller.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading