Stop setting SelfLink in kube-apiserver.

This commit is contained in:
wojtekt
2019-07-26 15:48:37 +02:00
parent d159ae3545
commit 2539912a22
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) + `",