Merge pull request #94397 from wojtek-t/stop_setting_selflink

Stop setting SelfLink in kube-apiserver.
This commit is contained in:
Kubernetes Prow Robot
2020-09-03 12:31:55 -07:00
committed by GitHub
10 changed files with 80 additions and 47 deletions

View File

@@ -686,11 +686,16 @@ func TestApplyManagedFields(t *testing.T) {
t.Fatalf("Failed to marshal object: %v", err)
}
selfLink := ""
if !utilfeature.DefaultFeatureGate.Enabled(genericfeatures.RemoveSelfLink) {
selfLink = `
"selfLink": "` + accessor.GetSelfLink() + `",`
}
expected := []byte(`{
"metadata": {
"name": "test-cm",
"namespace": "default",
"selfLink": "` + accessor.GetSelfLink() + `",
"namespace": "default",` + selfLink + `
"uid": "` + string(accessor.GetUID()) + `",
"resourceVersion": "` + accessor.GetResourceVersion() + `",
"creationTimestamp": "` + accessor.GetCreationTimestamp().UTC().Format(time.RFC3339) + `",