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
simulate in-tree cloud provider removal with a build tag #80353
Conversation
/hold Mostly opened this PR to share the prototype at the moment, I could see this requiring a KEP or some form of further discussion first. This idea has been discussed in #sig-cloud-provider and directly with a few interested parties. |
a0a75fd
to
03c6b1b
Compare
this was fixed in an additional commit |
discussed offline with @cheftako, opted to ignore credential providers for now and stub / compile out registration of the deprecated gce specific flags. |
/priority important-longterm |
@andrewsykim I switched to providerless 👍 |
If we do drift, the default build should still work so the only risk is developers using this special build might have to fix it, I'm not sure if that should be a blocker to initially implementing the tag. I do think we should have it though. It's also WAI if this mode builds but produces a non-functioning cluster. |
@@ -0,0 +1,30 @@ | |||
// +build !providerless |
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.
build tag and file name don't match any more...
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.
ACK
@@ -0,0 +1,27 @@ | |||
// +build providerless |
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.
OTOH "noproviderless" is going to be an unfortunate file name :/
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.
providers / providerless?
I can rework the PR, may take a bit 😬
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.
Yeah, sorry, it just kind of jumped out at me, I don't have any good suggestions. "providerlessasinnoproviders" and "providerlessasinserverless"
allPlugins = append(allPlugins, configmap.ProbeVolumePlugins()...) | ||
allPlugins = append(allPlugins, vsphere_volume.ProbeVolumePlugins()...) | ||
allPlugins = append(allPlugins, azure_dd.ProbeVolumePlugins()...) | ||
allPlugins = append(allPlugins, projected.ProbeVolumePlugins()...) | ||
allPlugins = append(allPlugins, portworx.ProbeVolumePlugins()...) |
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.
There's a lot of items still in this list that I'm not convinced should stay?
ping me when this is ready to go. I have read through it and willing to approve it. 👍 |
/approve I think this is pretty safe, we won't be breaking the main build. As for the packages rotting over time, I'm content that this is low-impact enough and Ben is going to continue to work on this, that I think it's fine to lock in this much progress. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewsykim, BenTheElder, lavalamp 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 |
/hold cancel |
/test all |
/retest |
What type of PR is this?
/kind feature
What this PR does / why we need it: This PR is a first step towards making it possible to build Kubernetes without the in-tree providers, in preparation for their eventual removal.
This can be used to ensure that out of tree providers function without the in-tree provider logic and will be ready to remove the in-tree version. It also produces lighter binaries, which should incentivize the work to move out of tree.
Usage: set
GOFLAGS='-tags=nolegacyproviders'
when building withmake
, for example:GOFLAGS='-tags=nolegacyproviders' make quick-release-images
.How this works:
We add build constraints for a synthetic
nolegacyproviders
build tag to the relevant sources. By default this tag isn't defined, so nothing changes functionally. If it is defined at compile time then the cloud provider files won't build, and some stub methods will build where necessary. Effectively this lets us "delete" the cloud provider code with a build flag, prior to the actual deletion.To make this work I had to add stub "doc.go" files (without any constraints on them) to various packages so they will build. Go will complain about packages with no matching source files.
Note that the bazel build does not support this. It will still build as before, but you cannot build the "nolegacyproviders" mode as gazelle doesn't support custom build tags / constraints.
Incomplete Work:
This does not touch credential provider logic, which also imports cloud provider code. I'm sure there are other places. Currently it touches:
cloud providerGCE mode)Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
^ possibly this deserves one? I think it's more likely to deserve one if we release anything built in this mode.
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/sig release
/sig cloud-provider