GoogleCloudPlatform / k8s-config-connector

GCP Config Connector, a Kubernetes add-on for managing GCP resources
https://cloud.google.com/config-connector/docs/overview
Apache License 2.0
862 stars 202 forks source link

fix: guard against nil model #2059

Closed acpana closed 2 weeks ago

acpana commented 3 weeks ago

The models for the dynamic controller presubmits are nil bc we never Init the registry. This also proved to me that we probably want to error out in AddController if model is nil for a gvk. Finally, if the registration for a gk contains a nil model, we probably want to err out to signal to consumers that Init was not called.

google-oss-prow[bot] commented 2 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/master/OWNERS)~~ [justinsb] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment