Closed maqiuyujoyce closed 1 month ago
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from maqiuyujoyce. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
I think it's nice to have the warning in the webhook, though making API calls in the webhook seems to be violating the best practices and may have consequence about the performance and etc. IMO the risk is higher than the benefit, and it should be okay if we don't merge this PR (e.g. users don't receive warnings if their CRs are defaulted with state-into-spec: merge
). @yuwenma WDYT?
Discussed offline and decided not to add this feature.
Change description
This is an experiment PR that checks the default value of
state-into-spec
annotation in the webhook via retrieving the ConfigConnector object and potentially the ConfigConnectorContext object, and returns a warning if the default value ismerge
.In general, we shouldn't make API calls in the webhook because it has a short timeout (10s), though it should be fairly cheap to do the CC/CCC object retrievals.
Tests you have done
make ready-pr
to ensure this PR is ready for review.Ran
make deploy-controller
locally with basic CCC and CC objects (nospec.stateIntoSpec
configuration), then applied a PubsubTopic resource (nostate-into-spec
annotation). Got the following warning as expected: