HDFGroup / hsds

Cloud-native, service based access to HDF data
https://www.hdfgroup.org/solutions/hdf-kita/
Apache License 2.0
127 stars 52 forks source link

Use label selectors to filter Kubernetes pods #163

Closed TManhente closed 1 year ago

TManhente commented 1 year ago

Issue #162

Replaces config k8s_app_label with k8s_dn_label_selector to allow the use of Kubernetes label selector for more flexible K8s deployments.

The old k8s_app_label is still supported for backward-compatibility.

Creates the test case K8sListDnTest to test both configs. This test case requires kubectl to be available and creates dummy namespaces and pods to setup the test environment.

jreadey commented 1 year ago

Could you fix the flak8 errors listed here: https://github.com/HDFGroup/hsds/runs/7907409516?check_suite_focus=true? Thanks!

jreadey commented 1 year ago

Looks like the k8s_label_selector_test is being picked up by pytest and failing since we aren't testing with kubernetes currently -- see: https://github.com/HDFGroup/hsds/runs/8041629026?check_suite_focus=true#step:7:89.

I'd suggest just putting a: @pytest.mark.skip(reason="no automated testing for kubernetes currently") in the first lie of the test program. Can run this manually to verify code.

TManhente commented 1 year ago

I'd suggest just putting a: @pytest.mark.skip(reason="no automated testing for kubernetes currently") in the first lie of the test program. Can run this manually to verify code.

Done it in commit 431415c. I've used @unittest.skip instead of @pytest.mark.skip, as all tests within the tests folder seem to use unittest. I've put it in the test class declaration.