func setup(t testing.TB) (clientset.Interface, kubeapiservertesting.TearDownFunc) { … } // TestApplyAlsoCreates makes sure that PATCH requests with the apply content type // will create the object if it doesn't already exist // TODO: make a set of test cases in an easy-to-consume place (separate package?) so it's easy to test in both integration and e2e. func TestApplyAlsoCreates(t *testing.T) { … } // TestNoOpUpdateSameResourceVersion makes sure that PUT requests which change nothing // will not change the resource version (no write to etcd is done) func TestNoOpUpdateSameResourceVersion(t *testing.T) { … } // TestNoOpApplyWithEmptyMap func TestNoOpApplyWithEmptyMap(t *testing.T) { … } // TestApplyEmptyMarkerStructDifferentFromNil func TestApplyEmptyMarkerStructDifferentFromNil(t *testing.T) { … } func getRV(obj runtime.Object) (string, error) { … } func TestNoopChangeCreationTime(t *testing.T) { … } // TestNoSemanticUpdateAppleSameResourceVersion makes sure that APPLY requests which makes no semantic changes // will not change the resource version (no write to etcd is done) // // Some of the non-semantic changes are: // - Applying an atomic struct that removes a default // - Changing Quantity or other fields that are normalized func TestNoSemanticUpdateApplySameResourceVersion(t *testing.T) { … } // TestNoSemanticUpdateAppleSameResourceVersion makes sure that PUT requests which makes no semantic changes // will not change the resource version (no write to etcd is done) // // Some of the non-semantic changes are: // - Applying an atomic struct that removes a default // - Changing Quantity or other fields that are normalized func TestNoSemanticUpdatePutSameResourceVersion(t *testing.T) { … } // TestCreateOnApplyFailsWithUID makes sure that PATCH requests with the apply content type // will not create the object if it doesn't already exist and it specifies a UID func TestCreateOnApplyFailsWithUID(t *testing.T) { … } func TestApplyUpdateApplyConflictForced(t *testing.T) { … } // TestApplyGroupsManySeparateUpdates tests that when many different managers update the same object, // the number of managedFields entries will only grow to a certain size. func TestApplyGroupsManySeparateUpdates(t *testing.T) { … } // TestCreateVeryLargeObject tests that a very large object can be created without exceeding the size limit due to managedFields func TestCreateVeryLargeObject(t *testing.T) { … } // TestUpdateVeryLargeObject tests that a small object can be updated to be very large without exceeding the size limit due to managedFields func TestUpdateVeryLargeObject(t *testing.T) { … } // TestPatchVeryLargeObject tests that a small object can be patched to be very large without exceeding the size limit due to managedFields func TestPatchVeryLargeObject(t *testing.T) { … } // TestApplyManagedFields makes sure that managedFields api does not change func TestApplyManagedFields(t *testing.T) { … } // TestApplyRemovesEmptyManagedFields there are no empty managers in managedFields func TestApplyRemovesEmptyManagedFields(t *testing.T) { … } func TestApplyRequiresFieldManager(t *testing.T) { … } // TestApplyRemoveContainerPort removes a container port from a deployment func TestApplyRemoveContainerPort(t *testing.T) { … } // TestApplyFailsWithVersionMismatch ensures that a version mismatch between the // patch object and the live object will error func TestApplyFailsWithVersionMismatch(t *testing.T) { … } // TestApplyConvertsManagedFieldsVersion checks that the apply // converts the API group-version in the field manager func TestApplyConvertsManagedFieldsVersion(t *testing.T) { … } // TestClearManagedFieldsWithMergePatch verifies it's possible to clear the managedFields func TestClearManagedFieldsWithMergePatch(t *testing.T) { … } // TestClearManagedFieldsWithStrategicMergePatch verifies it's possible to clear the managedFields func TestClearManagedFieldsWithStrategicMergePatch(t *testing.T) { … } // TestClearManagedFieldsWithJSONPatch verifies it's possible to clear the managedFields func TestClearManagedFieldsWithJSONPatch(t *testing.T) { … } // TestClearManagedFieldsWithUpdate verifies it's possible to clear the managedFields func TestClearManagedFieldsWithUpdate(t *testing.T) { … } // TestErrorsDontFail func TestErrorsDontFail(t *testing.T) { … } func TestErrorsDontFailUpdate(t *testing.T) { … } func TestErrorsDontFailPatch(t *testing.T) { … } func TestApplyDoesNotChangeManagedFieldsViaSubresources(t *testing.T) { … } // TestClearManagedFieldsWithUpdateEmptyList verifies it's possible to clear the managedFields by sending an empty list. func TestClearManagedFieldsWithUpdateEmptyList(t *testing.T) { … } // TestApplyUnsetExclusivelyOwnedFields verifies that when owned fields are omitted from an applied // configuration, and no other managers own the field, it is removed. func TestApplyUnsetExclusivelyOwnedFields(t *testing.T) { … } // TestApplyUnsetSharedFields verifies that when owned fields are omitted from an applied // configuration, but other managers also own the field, is it not removed. func TestApplyUnsetSharedFields(t *testing.T) { … } // TestApplyCanTransferFieldOwnershipToController verifies that when an applier creates an // object, a controller takes ownership of a field, and the applier // then omits the field from its applied configuration, that the field value persists. func TestApplyCanTransferFieldOwnershipToController(t *testing.T) { … } // TestApplyCanRemoveMapItemsContributedToByControllers verifies that when an applier creates an // object, a controller modifies the contents of the map item via update, and the applier // then omits the item from its applied configuration, that the item is removed. func TestApplyCanRemoveMapItemsContributedToByControllers(t *testing.T) { … } // TestDefaultMissingKeys makes sure that the missing keys default is used when merging. func TestDefaultMissingKeys(t *testing.T) { … } var podBytes … func decodePod(podBytes []byte) v1.Pod { … } func encodePod(pod v1.Pod) []byte { … } func getPodBytesWhenEnabled(b *testing.B, pod v1.Pod, format string) []byte { … } func BenchmarkServerSideApply(b *testing.B) { … } func benchAll(b *testing.B, client clientset.Interface, pod v1.Pod) { … } func benchPostPod(client clientset.Interface, pod v1.Pod, parallel int) func(*testing.B) { … } func createNamespace(client clientset.Interface, name string) error { … } func benchListPod(client clientset.Interface, pod v1.Pod, num int) func(*testing.B) { … } func benchRepeatedUpdate(client clientset.Interface, podName string) func(*testing.B) { … } func TestUpgradeClientSideToServerSideApply(t *testing.T) { … } func TestRenamingAppliedFieldManagers(t *testing.T) { … } func TestRenamingUpdatedFieldManagers(t *testing.T) { … } func TestDroppingSubresourceField(t *testing.T) { … } func TestDroppingSubresourceFromSpecField(t *testing.T) { … } func TestSubresourceField(t *testing.T) { … } // K8s has a bug introduced in vX.XX.X which changed the treatment of // ObjectReferences from granular to atomic. This means that only one manager // may own all fields of the ObjectReference. This resulted in a regression // for the common use case of user-specified GVK, and machine-populated UID fields. // // This is a test to show that clusters affected by this bug before it was fixed // do not experience any friction when updating to a version of k8s which marks // the fields' management again as granular. func TestApplyFormerlyAtomicFields(t *testing.T) { … } func TestDuplicatesInAssociativeLists(t *testing.T) { … } func TestApplyMatchesFakeClientsetApply(t *testing.T) { … } var wipeTime … func wipeMetadataForFakeClientTests(meta metav1.ObjectMeta) metav1.ObjectMeta { … } func expectManagedFields(t *testing.T, managedFields []metav1.ManagedFieldsEntry, expect string) { … } // TestCreateOnApplyFailsWithForbidden makes sure that PATCH requests with the apply content type // will not create the object if the user does not have both patch and create permissions. func TestCreateOnApplyFailsWithForbidden(t *testing.T) { … } func requireForbiddenPodErr(t *testing.T, err error, message string) { … } func ssaPod(client *clientset.Clientset) error { … } func createPodRBACAndWait(t *testing.T, client *clientset.Clientset, verb string) { … }