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
Stop setting SelfLink in kube-apiserver. #94397
Conversation
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.
only minor comments.
@@ -1144,8 +1144,7 @@ func TestList(t *testing.T) { | |||
t.Logf("%d: body: %s", i, string(body)) | |||
continue | |||
} | |||
// TODO: future, restore get links | |||
if !selfLinker.called { | |||
if utilfeature.DefaultFeatureGate.Enabled(features.RemoveSelfLink) == selfLinker.called { | |||
t.Errorf("%d: never set self link", i) |
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 error message is no longer correct for all the ways you could get into this if statement.
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.
done
@@ -1279,8 +1278,7 @@ func TestListCompression(t *testing.T) { | |||
t.Logf("%d: body: %s", i, string(body)) | |||
continue | |||
} | |||
// TODO: future, restore get links | |||
if !selfLinker.called { | |||
if utilfeature.DefaultFeatureGate.Enabled(features.RemoveSelfLink) == selfLinker.called { | |||
t.Errorf("%d: never set self link", i) |
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.
same comment (not that it matters that much)
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.
done
@@ -1596,7 +1600,7 @@ func TestExport(t *testing.T) { | |||
t.Errorf("Expected: exported, saw: %s", itemOut.Other) | |||
} | |||
|
|||
if !selfLinker.called { | |||
if utilfeature.DefaultFeatureGate.Enabled(features.RemoveSelfLink) == selfLinker.called { | |||
t.Errorf("Never set self link") |
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'll stop commenting on these :)
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.
done
@@ -159,7 +159,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS | |||
StorageVersionHash: {Default: true, PreRelease: featuregate.Beta}, | |||
WatchBookmark: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, | |||
APIPriorityAndFairness: {Default: false, PreRelease: featuregate.Alpha}, | |||
RemoveSelfLink: {Default: false, PreRelease: featuregate.Alpha}, | |||
RemoveSelfLink: {Default: true, PreRelease: featuregate.Beta}, |
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.
Wait, this was already here? Do we not test feature gates in both positions in tests?
Did it work before? If it didn't work before, then no one could possibly have tested it and it's not clear to me that it's fair or safe to go to beta.
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.
Apparently not in unit tests...
The feature gate was there and the self-linking logic itself was gated.
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.
Actually - it seems that only a few e2e tests are running with all Alpha features enabled:
https://github.com/kubernetes/test-infra/blob/03cbb16ef550658d61fb14912d3dd19b1cd7fa21/config/jobs/kubernetes/sig-cloud-provider/gcp/gcp-gce.yaml#L428
This is why all of these weren't caught...
/hold "TestEmptyList" integration test seem to be a real failure I don't really understand yet. Will investigate in the next few days. |
8b4e737
to
2539912
Compare
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.
Comments applied, failing test fixed (it was a real issue).
/hold cancel
@@ -1144,8 +1144,7 @@ func TestList(t *testing.T) { | |||
t.Logf("%d: body: %s", i, string(body)) | |||
continue | |||
} | |||
// TODO: future, restore get links | |||
if !selfLinker.called { | |||
if utilfeature.DefaultFeatureGate.Enabled(features.RemoveSelfLink) == selfLinker.called { | |||
t.Errorf("%d: never set self link", i) |
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.
done
@@ -1279,8 +1278,7 @@ func TestListCompression(t *testing.T) { | |||
t.Logf("%d: body: %s", i, string(body)) | |||
continue | |||
} | |||
// TODO: future, restore get links | |||
if !selfLinker.called { | |||
if utilfeature.DefaultFeatureGate.Enabled(features.RemoveSelfLink) == selfLinker.called { | |||
t.Errorf("%d: never set self link", i) |
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.
done
@@ -1596,7 +1600,7 @@ func TestExport(t *testing.T) { | |||
t.Errorf("Expected: exported, saw: %s", itemOut.Other) | |||
} | |||
|
|||
if !selfLinker.called { | |||
if utilfeature.DefaultFeatureGate.Enabled(features.RemoveSelfLink) == selfLinker.called { | |||
t.Errorf("Never set self link") |
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.
done
@@ -328,6 +328,12 @@ func checkName(obj runtime.Object, name, namespace string, namer ScopeNamer) err | |||
// interfaces | |||
func setObjectSelfLink(ctx context.Context, obj runtime.Object, req *http.Request, namer ScopeNamer) error { | |||
if utilfeature.DefaultFeatureGate.Enabled(features.RemoveSelfLink) { | |||
// Ensure that for empty lists we don't return <nil> items. |
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.
FYI - this was clearly a bug previously. Fortunately it was caught by an existing 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.
can you comment why the fix is here in setObjectSelfLink
? Doesn't sound like this func's task is to set an items slice to non-nil.
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.
For consistency - before this change (i.e. before adding this branch with return) - setting that list to non-nil was happening before in this function too. I mean - it still does - see line 370.
I agree it would be better to move it elsewhere, but that's orthogonal to this PR.
Ref #94414 /retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lavalamp, wojtek-t 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 |
@lavalamp - are you ok with applying the milestone now? |
Yes, sorry, I keep forgetting
/milestone v1.20
…On Thu, Sep 3, 2020 at 2:12 AM Wojciech Tyczynski ***@***.***> wrote:
@lavalamp <https://github.com/lavalamp> - are you ok with applying the
milestone now?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#94397 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE6BFRNQ4M4ROTQUEZRZETSD5MYDANCNFSM4QRY3NFQ>
.
|
Ref kubernetes/enhancements#1164
/kind cleanup
/priority important-soon