Skip to content

Update to controller-runtime@v0.7.2

This updates the controller-runtime to v0.7.2 to close #93 (closed). I decided to jump only to the next release version where this fix is integrated to minimize incorporation breaking changes.

  • Add context.Context parameter to Reconcile() function
  • Add RBAC get/create/update coordination.k8s.io/v1 Leases (replacing a configmap for leader election locks)

With this dependency update I was able to reconcile runners again:

I0321 20:28:12.445669       1 request.go:645] Throttling request took 1.039908914s, request: GET:https://172.30.0.1:443/apis/autoscaling/v2beta2?timeout=32s
2022-03-21T20:28:14.251Z	INFO	controller-runtime.metrics	metrics server is starting to listen	{"addr": "127.0.0.1:8080"}
2022-03-21T20:28:14.251Z	INFO	controller-runtime.builder	skip registering a mutating webhook, admission.Defaulter interface is not implemented	{"GVK": "apps.gitlab.com/v1beta2, Kind=Runner"}
2022-03-21T20:28:14.251Z	INFO	controller-runtime.builder	Registering a validating webhook	{"GVK": "apps.gitlab.com/v1beta2, Kind=Runner", "path": "/validate-apps-gitlab-com-v1beta2-runner"}
2022-03-21T20:28:14.251Z	INFO	controller-runtime.webhook	registering webhook	{"path": "/validate-apps-gitlab-com-v1beta2-runner"}
2022-03-21T20:28:14.251Z	INFO	setup	starting manager
I0321 20:28:14.251661       1 leaderelection.go:243] attempting to acquire leader lease  gitlab-runner-system/b43e192d.gitlab.com...
2022-03-21T20:28:14.251Z	INFO	controller-runtime.manager	starting metrics server	{"path": "/metrics"}
2022-03-21T20:28:14.251Z	INFO	controller-runtime.webhook.webhooks	starting webhook server
2022-03-21T20:28:14.251Z	INFO	controller-runtime.certwatcher	Updated current TLS certificate
2022-03-21T20:28:14.252Z	INFO	controller-runtime.webhook	serving webhook server	{"host": "", "port": 9443}
2022-03-21T20:28:14.252Z	INFO	controller-runtime.certwatcher	Starting certificate watcher
I0321 20:28:14.266685       1 leaderelection.go:253] successfully acquired lease gitlab-runner-system/b43e192d.gitlab.com
2022-03-21T20:28:14.267Z	INFO	controller-runtime.manager.controller.runner	Starting EventSource	{"reconciler group": "apps.gitlab.com", "reconciler kind": "Runner", "source": "kind source: /, Kind="}
2022-03-21T20:28:14.267Z	DEBUG	controller-runtime.manager.events	Normal	{"object": {"kind":"ConfigMap","namespace":"gitlab-runner-system","name":"b43e192d.gitlab.com","uid":"137fcd69-e346-4cb8-ac2d-b3c38eb6f7e4","apiVersion":"v1","resourceVersion":"90834080"}, "reason": "LeaderElection", "message": "gitlab-runner-controller-manager-867f7498c4-pxxwl_a8fdd6ff-9e2c-4c3c-b1b9-8378f9da9f17 became leader"}
2022-03-21T20:28:14.267Z	DEBUG	controller-runtime.manager.events	Normal	{"object": {"kind":"Lease","namespace":"gitlab-runner-system","name":"b43e192d.gitlab.com","uid":"6452f99f-0917-4d0e-8d49-61e0749e7363","apiVersion":"coordination.k8s.io/v1","resourceVersion":"90834081"}, "reason": "LeaderElection", "message": "gitlab-runner-controller-manager-867f7498c4-pxxwl_a8fdd6ff-9e2c-4c3c-b1b9-8378f9da9f17 became leader"}
2022-03-21T20:28:14.367Z	INFO	controller-runtime.manager.controller.runner	Starting EventSource	{"reconciler group": "apps.gitlab.com", "reconciler kind": "Runner", "source": "kind source: /, Kind="}
2022-03-21T20:28:15.570Z	INFO	controller-runtime.manager.controller.runner	Starting EventSource	{"reconciler group": "apps.gitlab.com", "reconciler kind": "Runner", "source": "kind source: /, Kind="}
2022-03-21T20:28:15.671Z	INFO	controller-runtime.manager.controller.runner	Starting EventSource	{"reconciler group": "apps.gitlab.com", "reconciler kind": "Runner", "source": "kind source: /, Kind="}
2022-03-21T20:28:16.972Z	INFO	controller-runtime.manager.controller.runner	Starting EventSource	{"reconciler group": "apps.gitlab.com", "reconciler kind": "Runner", "source": "kind source: /, Kind="}
2022-03-21T20:28:17.073Z	INFO	controller-runtime.manager.controller.runner	Starting Controller	{"reconciler group": "apps.gitlab.com", "reconciler kind": "Runner"}
2022-03-21T20:28:17.073Z	INFO	controller-runtime.manager.controller.runner	Starting workers	{"reconciler group": "apps.gitlab.com", "reconciler kind": "Runner", "worker count": 1}
2022-03-21T20:28:17.073Z	INFO	controllers.Runner	Reconciling Runner	{"runner": "gitlab-runner-system/example", "name": "example", "namespace": "gitlab-runner-system"}

Closes #93 (closed)

Edited by Georgi N. Georgiev

Merge request reports