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

compile check to ensure cloud providers implement cloud interfaces #71547

Conversation

andrewsykim
Copy link
Member

@andrewsykim andrewsykim commented Nov 29, 2018

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
Ensures all providers are implementing cloud providers interfaces at compile time. As discussed in today's SIG meeting.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

NONE

/sig cloud-provider
/assign @cheftako @justinsb

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. labels Nov 29, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 29, 2018
@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 29, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewsykim

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 Nov 29, 2018
@andrewsykim andrewsykim force-pushed the check-provider-implements-interface branch from cf59db9 to 11b1c9f Compare November 29, 2018 04:00
@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Nov 29, 2018
@andrewsykim andrewsykim force-pushed the check-provider-implements-interface branch from 11b1c9f to f52f4a6 Compare November 29, 2018 17:35
@andrewsykim
Copy link
Member Author

/retest

@mcrute
Copy link
Contributor

mcrute commented Nov 29, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 29, 2018
@andrewsykim
Copy link
Member Author

Thanks @mcrute!

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 29, 2018
var _ cloudprovider.LoadBalancer = (*Cloud)(nil)
var _ cloudprovider.Routes = (*Cloud)(nil)
var _ cloudprovider.Zones = (*Cloud)(nil)
var _ cloudprovider.PVLabeler = (*Cloud)(nil)
Copy link
Member

@cheftako cheftako Nov 29, 2018

Choose a reason for hiding this comment

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

Missing "var _ cloudprovider.Clusters = (*Cloud)(nil)"

Copy link
Member Author

Choose a reason for hiding this comment

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

updated!

Copy link
Member

@cheftako cheftako left a comment

Choose a reason for hiding this comment

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

We also have several package private objects which implement some of these interfaces. (Eg. azure_vmss scaleSet implements LoadBalancer) Wondering if it would be would be worth also adding checks for the package private objects.

@andrewsykim
Copy link
Member Author

Good point @cheftako. I'll dig into that, thanks!

@andrewsykim
Copy link
Member Author

/lgtm cancel

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 30, 2018
@andrewsykim andrewsykim force-pushed the check-provider-implements-interface branch from f52f4a6 to 4b0f2ab Compare November 30, 2018 15:33
@andrewsykim
Copy link
Member Author

@cheftako only internal type I could find was CloudStack's metadata (now updated). Couldn't find the azure_vmss scale set type you were referring to (though it does implement similar sounding methods like EnsureHostsInPool).

@andrewsykim
Copy link
Member Author

/retest

@cheftako
Copy link
Member

Walter Fender only internal type I could find was CloudStack's metadata (now updated). Couldn't find the azure_vmss scale set type you were referring to (though it does implement similar sounding methods like EnsureHostsInPool).

I believe azure_vmss scaleSet ends up "implmenting" LoadBalancer and other methods via composition with the Azure Cloud object. (https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/azure/azure_vmss.go#L51)
This gets a bit nasty because scaleSet could (it doesn't) override one of the LoadBalancer methods.
Warning by both scaleSet and Cloud failing to compile might be a hint.
Unfortunately when we fix Cloud it would also appear to fix scaleSet (however the old over-ride will now no longer over-ride or be called)

@cheftako
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 30, 2018
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit e056703 into kubernetes:master Dec 1, 2018
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants