-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORS-3753: Allow mocking of the Azure client everywhere #9201
base: master
Are you sure you want to change the base?
Conversation
@zaneb: This pull request references CORS-3753 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.18.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/jira refresh |
@zaneb: This pull request references CORS-3753 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Don't create a new client for each validating each machine type, instead use the common one that is used to valiate the install-config and cache it.
8a07c04
to
930070d
Compare
Prior to d02d7ee, the getVirtualNetworksClient() function was private to the client, and only used by public functions that are part of the API interface. That change made the function public without making it part of the API interface. Instead, add a new function to the API interface that does what we want to do, and return getVirtualNetworksClient() to being an internal implementation detail.
Add a public function to mock out the Azure client, so that other packages can do unit testing with a mock client.
930070d
to
28fd9a7
Compare
@zaneb: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: patrickdillon 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:
Approvers can indicate their approval by writing |
Currently the Azure client can only be mocked in unit tests of the
pkg/asset/installconfig/azure
package. Using the mockable interface consistently and adding a public interface to set it up will allow other packages to write unit tests for code involving the Azure client.