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
Under normal circumstances, this does not cause a problem, since the logic in cf-service-operator ensures that the labels/annotations were properly set, before reading them for the first time. However, in case someone changed things manually in the cf api, or if existing instances/bindings were incompletely adopted, the code might dereference a nil pointer, and therefore panic.
This should be handled in a more robust way. Proposal: have a wrapper method for accessing cf labels/annotations which first checks if the according key exists and the respective value is non-nil, and only then dereferences it.
The text was updated successfully, but these errors were encountered:
In a couple of places we evaluate cf metadata annotations or labels like
(https://github.com/SAP/cf-service-operator/blob/main/internal/cf/instance.go#L43)
Under normal circumstances, this does not cause a problem, since the logic in cf-service-operator ensures that the labels/annotations were properly set, before reading them for the first time. However, in case someone changed things manually in the cf api, or if existing instances/bindings were incompletely adopted, the code might dereference a nil pointer, and therefore panic.
This should be handled in a more robust way. Proposal: have a wrapper method for accessing cf labels/annotations which first checks if the according key exists and the respective value is non-nil, and only then dereferences it.
The text was updated successfully, but these errors were encountered: