Skip to content
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

Merged
merged 1 commit into from
Mar 28, 2022
Merged

🏃 Add Scopes to pass data to services #1178

merged 1 commit into from
Mar 28, 2022

Conversation

apricote
Copy link
Member

@apricote apricote commented Mar 14, 2022

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:

/hold

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Mar 14, 2022
@netlify
Copy link

netlify bot commented Mar 14, 2022

✔️ 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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 14, 2022
Copy link
Contributor

@mdbooth mdbooth left a 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,
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

pkg/scope/scope.go Outdated Show resolved Hide resolved
pkg/scope/scope.go Outdated Show resolved Hide resolved
@apricote
Copy link
Member Author

/test all

@apricote
Copy link
Member Author

/retest

@apricote
Copy link
Member Author

/retest

@apricote apricote marked this pull request as ready for review March 18, 2022 14:33
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 18, 2022
@k8s-ci-robot k8s-ci-robot requested a review from jichenjc March 18, 2022 14:34
@jichenjc
Copy link
Contributor

/lgtm

I like the idea, for the questions that need follow up, we can anyway create a new one

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 22, 2022
@apricote
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 22, 2022
Copy link
Contributor

@mdbooth mdbooth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 28, 2022
@k8s-ci-robot k8s-ci-robot merged commit 2e5c4b1 into kubernetes-sigs:main Mar 28, 2022
@apricote apricote mentioned this pull request May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants