-
Notifications
You must be signed in to change notification settings - Fork 40k
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
[sample-apiserver] Fix: Use Correct Effective Version for kube #125941
[sample-apiserver] Fix: Use Correct Effective Version for kube #125941
Conversation
Hi @fxierh. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This was added in #122891. /cc @siyuanfoundation @jpbetz |
bd66c3f
to
665479c
Compare
/lgtm Thanks! |
/release-note-none |
/assign @siyuanfoundation Thanks :) |
Could you please take a look when you have a chance? Thank you! |
/approve |
testServer := kastesting.StartTestServerOrDie(t, &kastesting.TestServerInstanceOptions{EnableCertAuth: true, BinaryVersion: "1.32"}, nil, framework.SharedEtcd()) | ||
// use DefaultKubeBinaryVersion - 1 minor for kube binary version, and 1.1 for wardle binary version so that we can test both N and N-1 wardle emulation versions. | ||
binaryVersion := version.MustParse(baseversion.DefaultKubeBinaryVersion).OffsetMinor(-1) | ||
wardleBinaryVersion := "1.1" |
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.
didn't expect this change
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.
This is because if we use 1.2 and kube 1.31, we cannot test N-1 emu version, since setting kube emu version to 1.30 is not allowed for this release, that would be fixed in the next release.
Signed-off-by: Siyuan Zhang <sizhang@google.com> Signed-off-by: Feilian Xie <fxie@redhat.com> Co-authored-by: Feilian Xie <fxie@redhat.com>
Signed-off-by: Siyuan Zhang <sizhang@google.com>
5a17d10
to
3a5e3f4
Compare
/milestone v1.31 |
@fxierh: You must be a member of the kubernetes/milestone-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Milestone Maintainers Team and have them propose you as an additional delegate for this responsibility. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
…ithout Wardle feature gate. Signed-off-by: Siyuan Zhang <sizhang@google.com>
/test pull-kubernetes-e2e-gce |
/milestone v1.31 |
@@ -177,7 +207,7 @@ func (o *WardleServerOptions) Config() (*apiserver.Config, error) { | |||
serverConfig.OpenAPIV3Config.Info.Title = "Wardle" | |||
serverConfig.OpenAPIV3Config.Info.Version = "0.1" | |||
|
|||
serverConfig.FeatureGate = utilversion.DefaultComponentGlobalsRegistry.FeatureGateFor(apiserver.WardleComponentName) | |||
serverConfig.FeatureGate = utilversion.DefaultComponentGlobalsRegistry.FeatureGateFor(utilversion.DefaultKubeComponent) |
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.
This is indicative of a capability gap. A server extending our k8s.io/apiserver library needs a way to wire the custom FeatureGates that are wired to the command line flags. This suggests that the ServerConfig.FeatureGate
needs to be a type that has func FeatureGateFor(component string) featuregate.FeatureGate
from ComponentGlobalsRegistry
.
I see this as a bug, not existential for the feature. Please open an issue and link it to the KEP issue so we dont' lose track.
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.
opened #126393.
testAggregatedAPIServer(t, true, "1.1") | ||
// Testing emulation version N-1, BanFlunder default=false in 1.0 | ||
t.Run("WithoutWardleFeatureGateAtV1.0", func(t *testing.T) { | ||
testAggregatedAPIServer(t, false, false, "1.1", "1.0") |
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.
to avoid conflicts between the kube-apiserver featuregtes and the wardleapiserver featuregates are we better off directly doing CRUD against the wardle server instead of fully aggregating it for this particular set of tests? I think the testing suite woudl be more understandable then and it would ease future maintenance.
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.
That's a good suggestion. Can we defer this to later since we do not have any time left in this code freeze?
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.
That's a good suggestion. Can we defer this to later since we do not have any time left in this code freeze?
Yes, it is a test/bug fix.
t.Cleanup(func() { testServer.TearDownFn() }) | ||
|
||
_, _ = utilversion.DefaultComponentGlobalsRegistry.ComponentGlobalsOrRegister( |
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.
Given other changes, doesn't setting this here force the featuregate version to a particular level instead of allowing that level to be determined by the options passed to the wardle server, thus defeating the purpose of the integration test?
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.
In a real use case, the binary version is always fixed. This setting forces the binary version to test in the integration test. This is temporary for 1.31 release, and can be removed in 1.32.
/lgtm |
LGTM label has been added. Git tree hash: 3f8a33a46ad3cfc16a2fb6e1a17bd82ab5f4a615
|
/milestone v1.31 |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, fxierh, jpbetz, siyuanfoundation, sttts 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 |
…netes#125941) * Fix slice copy of VersionedSpecs in FeatureGate. Signed-off-by: Siyuan Zhang <sizhang@google.com> * Update wardle to kube version mapping Signed-off-by: Siyuan Zhang <sizhang@google.com> Signed-off-by: Feilian Xie <fxie@redhat.com> Co-authored-by: Feilian Xie <fxie@redhat.com> * Add cap to wardleEmulationVersionToKubeEmulationVersion. Signed-off-by: Siyuan Zhang <sizhang@google.com> * Add integration test for default BanFlunder behavior in version 1.2 without Wardle feature gate. Signed-off-by: Siyuan Zhang <sizhang@google.com> --------- Signed-off-by: Siyuan Zhang <sizhang@google.com> Signed-off-by: Feilian Xie <fxie@redhat.com> Co-authored-by: Siyuan Zhang <sizhang@google.com>
…netes#125941) * Fix slice copy of VersionedSpecs in FeatureGate. Signed-off-by: Siyuan Zhang <sizhang@google.com> * Update wardle to kube version mapping Signed-off-by: Siyuan Zhang <sizhang@google.com> Signed-off-by: Feilian Xie <fxie@redhat.com> Co-authored-by: Feilian Xie <fxie@redhat.com> * Add cap to wardleEmulationVersionToKubeEmulationVersion. Signed-off-by: Siyuan Zhang <sizhang@google.com> * Add integration test for default BanFlunder behavior in version 1.2 without Wardle feature gate. Signed-off-by: Siyuan Zhang <sizhang@google.com> --------- Signed-off-by: Siyuan Zhang <sizhang@google.com> Signed-off-by: Feilian Xie <fxie@redhat.com> Co-authored-by: Siyuan Zhang <sizhang@google.com>
…netes#125941) * Fix slice copy of VersionedSpecs in FeatureGate. Signed-off-by: Siyuan Zhang <sizhang@google.com> * Update wardle to kube version mapping Signed-off-by: Siyuan Zhang <sizhang@google.com> Signed-off-by: Feilian Xie <fxie@redhat.com> Co-authored-by: Feilian Xie <fxie@redhat.com> * Add cap to wardleEmulationVersionToKubeEmulationVersion. Signed-off-by: Siyuan Zhang <sizhang@google.com> * Add integration test for default BanFlunder behavior in version 1.2 without Wardle feature gate. Signed-off-by: Siyuan Zhang <sizhang@google.com> --------- Signed-off-by: Siyuan Zhang <sizhang@google.com> Signed-off-by: Feilian Xie <fxie@redhat.com> Co-authored-by: Siyuan Zhang <sizhang@google.com>
What type of PR is this?
/kind bug
What this PR does / why we need it:
Set effective kube version to default version + 1 minor version so the sample-apiserver could be deployed without the following error:
Which issue(s) this PR fixes:
Fixes #125938