- [X] APISnoop org-flow: CoreV1NamespaceFinalizeTest.org
- [X] Test approval issue: Write e2e test for replaceCoreV1NamespaceFinalize +1 Endpoints #112890
- [X] Test PR: Write e2e test for replaceCoreV1NamespaceFinalize +1 Endpoints #112891
- [X] Two weeks soak start date: testgrid-link 15 Oct 2022
- [X] Two weeks soak end date: 28 Oct 2022
- [X] Test promotion PR: Promote replaceCoreV1NamespaceFinalize +1 Endpoints #113454
According to this APIsnoop query, there are still one remaining Namespace endpoint which is untested.
SELECT
endpoint,
path,
kind
FROM testing.untested_stable_endpoint
where eligible is true
and endpoint ilike '%V1Namespace%'
and endpoint not ilike '%Namespaced%'
order by kind, endpoint desc
limit 10;
endpoint | path | kind
--------------------------------+------------------------------------+-----------
replaceCoreV1NamespaceFinalize | /api/v1/namespaces/{name}/finalize | Namespace
(1 row)
- Kubernetes API Reference Docs
- Kubernetes API / Cluster Resources / Namespace
- client-go - Namespace
- client-go - Namespace (Finalize)
Feature: Test the Namespace finalize subresource
- replaceCoreV1NamespaceFinalize
Scenario: confirm that the finalize action will apply to a Namespace Given the e2e test has created a test Namespace And the Spec.Finalizer is appended with a fake finalizer When the test updates the finalize subresource Then the requested action is accepted without any error And the Spec.Finalizer count will equal two
Note: The test also removes the fake finalize from Spec.Finalizer
before calling the finalize action on the test namespace a second time.
This will allow the test framework to clean up all namespaces when the e2e finishes, else the test namespace will be stuck in the Terminating
state.
Using a number of existing e2e test practices a new ginkgo test has been created for one Namespace endpoint. The e2e logs for this test are listed below.
[It] should apply a finalizer to a Namespace /home/ii/go/src/k8s.io/kubernetes/test/e2e/apimachinery/namespace.go:386 STEP: Creating namespace "e2e-ns-snwdg" 10/06/22 11:45:22.926 Oct 6 11:45:22.937: INFO: Namespace "e2e-ns-snwdg-7128" has []v1.FinalizerName{"kubernetes"} STEP: Adding e2e finalizer to namespace "e2e-ns-snwdg-7128" 10/06/22 11:45:22.937 Oct 6 11:45:22.945: INFO: Namespace "e2e-ns-snwdg-7128" has []v1.FinalizerName{"kubernetes", "e2e.example.com/fakeFinalizer"} STEP: Removing e2e finalizer from namespace "e2e-ns-snwdg-7128" 10/06/22 11:45:22.945 Oct 6 11:45:22.951: INFO: Namespace "e2e-ns-snwdg-7128" has []v1.FinalizerName{"kubernetes"}
This query shows that the Finalize endpoint is hit within a short period of running this e2e test
select distinct substring(endpoint from '\w+') AS endpoint,
right(useragent,39) AS useragent
from testing.audit_event
where endpoint ilike '%Finalize%'
and release_date::BIGINT > round(((EXTRACT(EPOCH FROM NOW()))::numeric)*1000,0) - 60000
and useragent like 'e2e%should%'
order by endpoint
limit 10;
endpoint | useragent
--------------------------------+-----------------------------------------
replaceCoreV1NamespaceFinalize | should apply a finalizer to a Namespace
(1 row)
If a test with these calls gets merged, test coverage will go up by 1 point
This test is also created with the goal of conformance promotion.
/sig testing
/sig architecture
/area conformance