Skip to content

Commit

Permalink
leader election only on default cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWeindel committed Aug 26, 2020
1 parent fb82e0b commit c104a3a
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 14 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.13
require (
github.com/ahmetb/gen-crd-api-reference-docs v0.2.0
github.com/emicklei/go-restful v2.11.1+incompatible // indirect
github.com/gardener/controller-manager-library v0.2.1-0.20200814085853-45032cce52c3
github.com/gardener/controller-manager-library v0.2.1-0.20200826084112-e3fae4e04030
github.com/gardener/external-dns-management v0.7.17-0.20200810112859-d9ceb5e2257d
github.com/go-acme/lego/v3 v3.7.0
github.com/go-openapi/spec v0.19.4 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWo
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/gardener/controller-manager-library v0.2.1-0.20200810091329-d980dbe10959 h1:uu2LUpjtkOdMtaYwXwU8mP4yKQvUnYxsVyHtJdQM+J8=
github.com/gardener/controller-manager-library v0.2.1-0.20200810091329-d980dbe10959/go.mod h1:XMp1tPcX3SP/dMd+3id418f5Cqu44vydeTkBRbW8EvQ=
github.com/gardener/controller-manager-library v0.2.1-0.20200814085853-45032cce52c3 h1:/FR89opaR3lbLX0is9f3ioc+i4k3cMpYxOKEwi6UzMg=
github.com/gardener/controller-manager-library v0.2.1-0.20200814085853-45032cce52c3/go.mod h1:XMp1tPcX3SP/dMd+3id418f5Cqu44vydeTkBRbW8EvQ=
github.com/gardener/controller-manager-library v0.2.1-0.20200826084112-e3fae4e04030 h1:QbqIx38gMrzYHC1LweqLEP99xgQm8Bb/dRclrrZI7n0=
github.com/gardener/controller-manager-library v0.2.1-0.20200826084112-e3fae4e04030/go.mod h1:XMp1tPcX3SP/dMd+3id418f5Cqu44vydeTkBRbW8EvQ=
github.com/gardener/external-dns-management v0.7.17-0.20200810112859-d9ceb5e2257d h1:oA5pjPJd/wL73A3DZZLxnanNm45bpBPG/WrSQuwyX/I=
github.com/gardener/external-dns-management v0.7.17-0.20200810112859-d9ceb5e2257d/go.mod h1:oHhauLQ3/sop0c1urS6n304Wqv/WM4me0geLn9nTAcY=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/issuer/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (

func init() {
controller.Configure("issuer").
RequireLease().
DefaultedStringOption(core.OptDefaultIssuer, "default-issuer", "name of default issuer (from default cluster)").
DefaultedStringOption(core.OptIssuerNamespace, "default", "namespace to lookup issuers on default cluster").
StringOption(core.OptDefaultIssuerDomainRanges, "domain range restrictions when using default issuer separated by comma").
Expand Down Expand Up @@ -61,6 +60,7 @@ func init() {
WorkerPool("secrets", 1, 0).
SelectedWatch(selectIssuerNamespaceSelectionFunction, "core", "Secret").
Cluster(ctrl.DNSCluster).
RequireLease(ctrl.DefaultCluster).
MustRegister(ctrl.ControllerGroupCert)
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/source/ingress/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ var mainResource = resources.NewGroupKind("extensions", "Ingress")

func init() {
source.CertSourceController(source.NewCertSourceTypeForCreator("ingress-cert", mainResource, NewIngressSource), nil).
RequireLease().
FinalizerDomain("cert.gardener.cloud").
Cluster(ctrl.DefaultCluster).
RequireLease(ctrl.DefaultCluster).
MustRegister(ctrl.ControllerGroupSource)
}
3 changes: 2 additions & 1 deletion pkg/controller/source/service/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ var mainResource = resources.NewGroupKind("core", "Service")

func init() {
source.CertSourceController(source.NewCertSourceTypeForExtractor("service-cert", mainResource, GetSecretName), nil).
RequireLease().
FinalizerDomain("cert.gardener.cloud").
Cluster(ctrl.DefaultCluster).
RequireLease(ctrl.DefaultCluster).
MustRegister(ctrl.ControllerGroupSource)
}

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.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ github.com/evanphx/json-patch
github.com/evanphx/json-patch/v5
# github.com/fsnotify/fsnotify v1.4.9
github.com/fsnotify/fsnotify
# github.com/gardener/controller-manager-library v0.2.1-0.20200814085853-45032cce52c3
# github.com/gardener/controller-manager-library v0.2.1-0.20200826084112-e3fae4e04030
github.com/gardener/controller-manager-library/pkg/certmgmt
github.com/gardener/controller-manager-library/pkg/certs
github.com/gardener/controller-manager-library/pkg/config
Expand Down

0 comments on commit c104a3a

Please sign in to comment.