Code change:
This issue contains a very basic mock test in order to start the conversation about what a good e2e test would look like for this endpoint. The code below is verified to be hitting the intended endpoint, show as per the queries in APIsnoop's live view of the cluster's audit logs. According to these query results from APIsnoop, we are lacking in tests for the follow endpoints related to Secrets. We chose the follow endpoints for this mock test. Test outline: a Secret in the default namespace with custom values Secrets in all namespaces search for Secret created in  the data in Secret  Secret  Secrets in all namespaces ensure that Secret  doesn't exist Discover useragents Display endpoints hit by the test Review the change in coverage If a test with these calls gets merged in, conformance will go up by 3 endpoints. /sig architecture /area conformance
/reopen
Reopened this issue. <detailsIn response to : /reopen Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
Yeah! We got a test written and a promotion (and we linked them to the mock-ticket that started it all). /close
Closing this issue. <detailsIn response to : Yeah! We got a test written and a promotion (and we linked them to the mock-ticket that started it all). /close Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details

Related discussion:
text: secret, err := createEmptyKeySecretForTest(f) framework.ExpectError(err, "created secret %q with empty key in namespace %q", secret.Name, f.Namespace.Name) }) <ins> ginkgo.It("should patch a secret", func() { ginkgo.By("creating a secret") secretTestName := "test-secret-" + string(uuid.NewUUID()) // create a secret in the test namespace _, err := f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Create(&v1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: secretTestName, Labels: map[string]string{ "testsecret-constant": "true", }, }, Data: map[string][]byte{ "key": []byte("value"), }, Type: "Opaque", }) framework.ExpectNoError(err, "failed to create secret") ginkgo.By("listing secrets in all namespaces to ensure that there are more than zero") // list all secrets in all namespaces to ensure endpoint coverage secretsList, err := f.ClientSet.CoreV1().Secrets("").List(metav1.ListOptions{ LabelSelector: "testsecret-constant=true", }) framework.ExpectNoError(err, "failed to list secrets") framework.ExpectNotEqual(len(secretsList.Items), 0, "no secrets found") foundCreatedSecret := false var secretCreatedName string for _, val := range secretsList.Items { if val.ObjectMeta.Name == secretTestName && val.ObjectMeta.Namespace == f.Namespace.Name { foundCreatedSecret = true secretCreatedName = val.ObjectMeta.Name break } } framework.ExpectEqual(foundCreatedSecret, true, "unable to find secret by its value") ginkgo.By("patching the secret") // patch the secret in the test namespace secretPatchNewData := base64.StdEncoding.EncodeToString([]byte("value1")) secretPatch, err := json.Marshal(map[string]interface{}{ "metadata": map[string]interface{}{ "labels": map[string]string{"testsecret": "true"}, }, "data": map[string][]byte{"key": []byte(secretPatchNewData)}, }) framework.ExpectNoError(err, "failed to marshal JSON") _, err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Patch(secretCreatedName, types.StrategicMergePatchType, []byte(secretPatch)) framework.ExpectNoError(err, "failed to patch secret") secret, err := f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Get(secretCreatedName, metav1.GetOptions{}) framework.ExpectNoError(err, "failed to get secret") secretDecodedstring, err := base64.StdEncoding.DecodeString(string(secret.Data["key"])) framework.ExpectNoError(err, "failed to decode secret from Base64") framework.ExpectEqual(string(secretDecodedstring), "value1", "found secret, but the data wasn't updated from the patch") ginkgo.By("deleting the secret using a LabelSelector") err = f.ClientSet.CoreV1().Secrets(f.Namespace.Name).DeleteCollection(&metav1.DeleteOptions{}, metav1.ListOptions{ LabelSelector: "testsecret=true", }) framework.ExpectNoError(err, "failed to delete patched secret") ginkgo.By("listing secrets in all namespaces, searching for label name and value in patch") // list all secrets in all namespaces secretsList, err = f.ClientSet.CoreV1().Secrets("").List(metav1.ListOptions{ LabelSelector: "testsecret-constant=true", }) framework.ExpectNoError(err, "failed to list secrets") foundCreatedSecret = false for _, val := range secretsList.Items { if val.ObjectMeta.Name == secretTestName && val.ObjectMeta.Namespace == f.Namespace.Name { foundCreatedSecret = true break } } framework.ExpectEqual(foundCreatedSecret, false, "secret was not deleted successfully") }) </ins> }) func newEnvFromSecret(namespace, name string) *v1.Secret {