Change:
This issue proposes the writing of a new test for the API endpoints , with the intention of promoting it to Conformance. 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 this APIsnoop query, there are still some remaining ConfigMap endpoints which are untested. Create a ConfigMap with a static label Patch the ConfigMap with a new Label and updated data Get the ConfigMap to ensure it's patched List all ConfigMaps in all Namespaces find the ConfigMap(1) ensure that the ConfigMap is found and is patched Delete Namespaced ConfigMap(1) via a Collection with a LabelSelector This mock test uses client-go's standard functions for talking to the Event area of the API. Discover useragents: Display endpoints hit by the test: Show the change in coverage after the mock test: If a test with these calls gets merged, Conformance coverage will go up by 2 points /sig testing /sig architecture /area conformance
Bad to list all secrets without a label selector... look at label usage in secret test. Approved for work on 14th January Meeting.
/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
/assign
/retitle Write CoreV1ConfigMap test+promote - +2 Coverage
please close this Issue in favour of and place in In Progress Issues on org dashboard
/close Close this Issue in favour of and place in In Progress Issues on org dashboard
Closing this issue. <detailsIn response to : /close Close this Issue in favour of and place in In Progress Issues on org dashboard 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
/close close this Issue in favor of and place in In Progress Issues on org dashboard

Discussion:
package common import ( <ins> "encoding/json" </ins> "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" <ins> "k8s.io/apimachinery/pkg/types" </ins> "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/kubernetes/test/e2e/framework" imageutils "k8s.io/kubernetes/test/utils/image"

ginkgo.By(fmt.Sprintf("Verifying update of ConfigMap %v/%v", f.Namespace.Name, configMap.Name)) framework.ExpectEqual(configMapFromUpdate.Data, configMap.Data) }) <ins> ginkgo.It("should run through a ConfigMap lifecycle", func() { testNamespaceName := f.Namespace.Name testConfigMapName := "test-configmap" + string(uuid.NewUUID()) _, err := f.ClientSet.CoreV1().ConfigMaps(testNamespaceName).Create(&v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: testConfigMapName, Labels: map[string]string{ "test-configmap-static": "true", }, }, Data: map[string]string{ "valueName": "value", }, }) framework.ExpectNoError(err, "failed to create ConfigMap") configMapPatchPayload, err := json.Marshal(v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "test-configmap": "patched", }, }, Data: map[string]string{ "valueName": "value1", }, }) framework.ExpectNoError(err, "failed to marshal patch data") _, err = f.ClientSet.CoreV1().ConfigMaps(testNamespaceName).Patch(testConfigMapName, types.StrategicMergePatchType, []byte(configMapPatchPayload)) framework.ExpectNoError(err, "failed to patch ConfigMap") configMap, err := f.ClientSet.CoreV1().ConfigMaps(testNamespaceName).Get(testConfigMapName, metav1.GetOptions{}) framework.ExpectNoError(err, "failed to get ConfigMap") framework.ExpectEqual(configMap.Data["valueName"], "value1", "failed to patch ConfigMap") framework.ExpectEqual(configMap.Labels["test-configmap"], "patched", "failed to patch ConfigMap") // listing in all namespaces to hit the endpoint configMapList, err := f.ClientSet.CoreV1().ConfigMaps("").List(metav1.ListOptions{ LabelSelector: "test-configmap-static=true", }) framework.ExpectNoError(err, "failed to list ConfigMaps with LabelSelector") framework.ExpectNotEqual(len(configMapList.Items), 0, "no ConfigMaps found in ConfigMap list") testConfigMapFound := false for _, cm := range configMapList.Items { if cm.ObjectMeta.Name == testConfigMapName && cm.ObjectMeta.Namespace == testNamespaceName && cm.ObjectMeta.Labels["test-configmap-static"] == "true" && cm.Data["valueName"] == "value1" { testConfigMapFound = true break } } framework.ExpectEqual(testConfigMapFound, true, "failed to find ConfigMap in list") err = f.ClientSet.CoreV1().ConfigMaps(testNamespaceName).DeleteCollection(&metav1.DeleteOptions{}, metav1.ListOptions{ LabelSelector: "test-configmap-static=true", }) framework.ExpectNoError(err, "failed to delete ConfigMap collection with LabelSelector") }) </ins> }) func newEnvFromConfigMap(f *framework.Framework, name string) *v1.ConfigMap {