-
Notifications
You must be signed in to change notification settings - Fork 261
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
🏃 Add Scopes to pass data to services #1178
Conversation
Skipping CI for Draft Pull Request. |
✔️ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready! 🔨 Explore the source changes: 3bde85f 🔍 Inspect the deploy log: https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/623477c7431ec4000871e246 😎 Browse the preview: https://deploy-preview-1178--kubernetes-sigs-cluster-api-openstack.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still like this in principal!
Region: clientOpts.RegionName, | ||
func NewService(scope *scope.Scope) (*Service, error) { | ||
loadbalancerClient, err := openstack.NewLoadBalancerV2(scope.ProviderClient, gophercloud.EndpointOpts{ | ||
Region: scope.ProviderClientOpts.RegionName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we're already looking into project id, but it looks like region can also be extracted from the authentication response. Lets kill ProviderClientOpts entirely as soon as we can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, I never really understood why the clientOpts
were necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be a follow up, though! Lets leave it alone in for this PR.
/test all |
/retest |
/retest |
/lgtm I like the idea, for the questions that need follow up, we can anyway create a new one |
/hold cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apricote, mdbooth 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 |
What this PR does / why we need it:
This refactoring will make it easier to pass the
ProjectID
into the services that need it (see #1146). The Scopes pattern is also used by other CAPI Providers:Context
): https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/main/pkg/context/cluster_context.go/hold