GoogleCloudPlatform / k8s-cloud-provider

Support code for implementing a Kubernetes cloud provider for Google Cloud Platform
Apache License 2.0
37 stars 46 forks source link

Add ...Option to the generated methods; Adds support for ForceProjectID. #142

Closed bowei closed 11 months ago

bowei commented 11 months ago
Add ...Option to the generated methods; Adds support for ForceProjectID.

* This allows for optional parameters to be passed to the methods
  without changing the call site for the methods.
* Adds support for ForceProjectID as an optional parameter.
* Adds helper method to derive the projectID

Testing: manual due to need for multiple GCP projects

Historical note:

The original interface should have taken projectID directly as a
parameter to the method. However, this was not done as the K8s cloud
provider code operated instead using an implicit ProjectRouter
equivalent. This seems to be the best compromise between disrupting all
of the existing method signatures and behaviors vs being as clear as
possible at the call site.
google-oss-prow[bot] commented 11 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bowei

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-cloud-provider/blob/master/OWNERS)~~ [bowei] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
aojea commented 11 months ago

/lgtm