Skip to content

Commit

Permalink
deps: upgrade controller-runtime to v0.8.2 (#3375)
Browse files Browse the repository at this point in the history
Upgrades controller-runtime to v0.8.2 in preparation for updating
the Gateway API dependency.

Updates #3370.

Signed-off-by: Steve Kriss <[email protected]>
  • Loading branch information
skriss authored Feb 19, 2021
1 parent 4ddb326 commit d31d2b6
Show file tree
Hide file tree
Showing 10 changed files with 275 additions and 74 deletions.
3 changes: 2 additions & 1 deletion cmd/contour/leadership.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ func setupLeadershipElection(
) chan struct{} {
le, leader, deposed := newLeaderElector(log, conf, clients)

g.AddContext(func(electionCtx context.Context) {
g.AddContext(func(electionCtx context.Context) error {
log.WithFields(logrus.Fields{
"configmapname": conf.Name,
"configmapnamespace": conf.Namespace,
}).Info("started leader election")

le.Run(electionCtx)
log.Info("stopped leader election")
return nil
})

g.Add(func(stop <-chan struct{}) error {
Expand Down
12 changes: 6 additions & 6 deletions cmd/contour/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,17 +442,17 @@ func doServe(log logrus.FieldLogger, ctx *serveContext) error {
var g workgroup.Group

// Register a task to start all the informers.
g.Add(func(stop <-chan struct{}) error {
g.AddContext(func(taskCtx context.Context) error {
log := log.WithField("context", "informers")

log.Info("starting informers")
defer log.Println("stopped informers")

if err := clients.StartInformers(stop); err != nil {
if err := clients.StartInformers(taskCtx); err != nil {
log.WithError(err).Error("failed to start informers")
}

<-stop
<-taskCtx.Done()
return nil
})

Expand Down Expand Up @@ -574,11 +574,11 @@ func doServe(log logrus.FieldLogger, ctx *serveContext) error {
Info("Watching Service for Ingress status")
}

g.Add(func(stop <-chan struct{}) error {
g.AddContext(func(taskCtx context.Context) error {
log := log.WithField("context", "xds")

log.Printf("waiting for informer caches to sync")
if !clients.WaitForCacheSync(stop) {
if !clients.WaitForCacheSync(taskCtx) {
return errors.New("informer cache failed to sync")
}
log.Printf("informer caches synced")
Expand Down Expand Up @@ -612,7 +612,7 @@ func doServe(log logrus.FieldLogger, ctx *serveContext) error {
defer log.Info("stopped xDS server")

go func() {
<-stop
<-taskCtx.Done()

// We don't use GracefulStop here because envoy
// has long-lived hanging xDS requests. There's no
Expand Down
22 changes: 22 additions & 0 deletions examples/contour/01-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,28 @@ spec:
ip:
description: IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)
type: string
ports:
description: Ports is a list of records of service ports If used, every port defined in the service should have an entry in it
items:
properties:
error:
description: 'Error is to record the problem with the service port The format of the error shall comply with the following rules: - built-in error values shall be specified in this file and those shall use CamelCase names - cloud provider specific error values must have names that comply with the format foo.example.com/CamelCase. --- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)'
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
port:
description: Port is the port number of the service port of which status is recorded here
format: int32
type: integer
protocol:
description: 'Protocol is the protocol of the service port of which status is recorded here The supported values are: "TCP", "UDP", "SCTP"'
type: string
required:
- port
- protocol
type: object
type: array
x-kubernetes-list-type: atomic
type: object
type: array
type: object
Expand Down
22 changes: 22 additions & 0 deletions examples/render/contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,28 @@ spec:
ip:
description: IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)
type: string
ports:
description: Ports is a list of records of service ports If used, every port defined in the service should have an entry in it
items:
properties:
error:
description: 'Error is to record the problem with the service port The format of the error shall comply with the following rules: - built-in error values shall be specified in this file and those shall use CamelCase names - cloud provider specific error values must have names that comply with the format foo.example.com/CamelCase. --- The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)'
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
port:
description: Port is the port number of the service port of which status is recorded here
format: int32
type: integer
protocol:
description: 'Protocol is the protocol of the service port of which status is recorded here The supported values are: "TCP", "UDP", "SCTP"'
type: string
required:
- port
- protocol
type: object
type: array
x-kubernetes-list-type: atomic
type: object
type: array
type: object
Expand Down
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ require (
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0
github.com/envoyproxy/go-control-plane v0.9.8
github.com/golang/protobuf v1.4.3
github.com/google/go-cmp v0.5.0
github.com/google/uuid v1.1.1
github.com/google/go-cmp v0.5.2
github.com/google/uuid v1.1.2
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.15.0
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.5.1
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
google.golang.org/grpc v1.27.0
github.com/stretchr/testify v1.6.1
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a
google.golang.org/grpc v1.27.1
google.golang.org/protobuf v1.25.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.3.0
k8s.io/api v0.19.2
k8s.io/apimachinery v0.19.2
k8s.io/client-go v0.19.2
k8s.io/klog/v2 v2.3.0
k8s.io/utils v0.0.0-20200729134348-d5654de09c73
sigs.k8s.io/controller-runtime v0.6.3
k8s.io/api v0.20.2
k8s.io/apimachinery v0.20.2
k8s.io/client-go v0.20.2
k8s.io/klog/v2 v2.4.0
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009
sigs.k8s.io/controller-runtime v0.8.2
sigs.k8s.io/controller-tools v0.4.0
sigs.k8s.io/kustomize/kyaml v0.1.1
sigs.k8s.io/service-apis v0.1.0
Expand Down
Loading

0 comments on commit d31d2b6

Please sign in to comment.