You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 15, 2026. It is now read-only.
Matt Royal edited this page Aug 12, 2021
·
1 revision
Welcome to the cf-k8s-controllers wiki!
Custom Resource Naming
We want to avoid name collisions between our CRDs and those of other tools (e.g. kpack Builds). To avoid these collisions, we plan to prefix all of our CRDs with "CF". We should also set up short names for these resources. For example, CFBuild may have the alias "cfb".
Stale kubernetes resource caches in controller-runtime package
kubebuilder uses the controller-runtime package for interactions with the k8s API, and this maintains a cache of k8s resources to reduce the number of API calls. Due to this cache, the resources returned by the client may be stale. For example, if you create or update a resource and then immediately Get it, the result may not reflect the change you just made. To address this problem the client methods that mutate objects will update the resource object passed to them to the latest state. Use this version instead of getting from the client.
Example:
controllerutil.CreateOrUpdate(ctx, r.Client, actualEiriniLRP, eiriniLRPMutateFunction(actualEiriniLRP, &desiredEiriniLRP))
// Do thisguid:=actualEiriniLRP.UID// Don't do thisr.Get(ctx, namespacedLRPName, staleLRP)
guid=staleLRP.UID