Skip to content

Commit 3879e30

Browse files
authored
Issue #410: Remove support for daemon mode (#413)
1 parent e3dfadd commit 3879e30

File tree

8 files changed

+0
-211
lines changed

8 files changed

+0
-211
lines changed

.github/workflows/test-push.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -150,23 +150,3 @@ jobs:
150150
- run: |
151151
export PYTHONPATH=.
152152
python tests/run_all_tests.py --type=k8s_live_general
153-
rest-api:
154-
runs-on: ubuntu-latest
155-
steps:
156-
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
157-
- uses: ./.github/actions/setup-nca-env
158-
- run: |
159-
python -m nca --daemon &
160-
NCA_PID=$!
161-
while true; do # wait until REST server becomes responsive
162-
curl_status=0
163-
curl localhost:5000 || curl_status=$?
164-
[ $curl_status -gt 0 ] || break
165-
sleep 1
166-
done
167-
curl -X POST -H Content-Type:application/json -d @tests/k8s_testcases/example_podlist/ns_list.json localhost:5000/namespace_list
168-
curl -X POST -H Content-Type:application/json -d @tests/k8s_testcases/example_podlist/pods_list.json localhost:5000/pod_list
169-
curl -X POST -H Content-Type:application/json -d @tests/k8s_testcases/example_policies/testcase1/testcase1-networkpolicy1.json localhost:5000/policy_sets
170-
curl localhost:5000/policy_sets/set_0/findings -o testcase1_findings.json
171-
diff testcase1_findings.json tests/rest_api/testcase1-findings.json
172-
kill $NCA_PID

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ The arguments to `--resource_list` and to `--base_resource_list` should be one o
8282
A valid token to access a GHE repository
8383
- `--period <minutes>`\
8484
Run NCA with given arguments every specified number of minutes
85-
- `--daemon`\
86-
Run NCA as a daemon. Send and receive data using a REST API.
8785
- `--output_format <format>`\
8886
Output format specification (txt/yaml/csv/md/dot).\
8987
*default:* txt\

nca/RESTServer.py

Lines changed: 0 additions & 169 deletions
This file was deleted.

nca/nca_cli.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from nca.NetworkConfig.NetworkConfigQueryRunner import NetworkConfigQueryRunner
1515
from nca.NetworkConfig.ResourcesHandler import ResourcesHandler
1616
from nca.SchemeRunner import SchemeRunner
17-
from nca.RESTServer import RestServer
1817

1918

2019
def _valid_path(path_location, allow_ghe=False, allowed_platforms=None):
@@ -275,7 +274,6 @@ def nca_main(argv=None):
275274
action='append',
276275
help='Network policies (policy name/file/dir/GHE url/cluster-type) '
277276
'specifying permitted connections')
278-
manual_or_automatic.add_argument('--daemon', action='store_true', help='Run NCA as a daemon with REST API')
279277
parser.add_argument('--base_np_list', '-b', type=_network_policies_valid_path, action='append',
280278
help='Filesystem or GHE location of base network policies '
281279
'for equiv/interferes/forbids/permits/semantic_diff check (default: k8s cluster)')
@@ -324,9 +322,6 @@ def nca_main(argv=None):
324322
if args.ghe_token:
325323
os.environ['GHE_TOKEN'] = args.ghe_token
326324

327-
if args.daemon:
328-
return RestServer(args.ns_list, args.pod_list, args.resource_list).run()
329-
330325
try:
331326
if args.period <= 0:
332327
ret_val = run_args(args)

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
ghapi==1.0.3
22
ruamel.yaml==0.17.21
3-
Flask==2.2.2
43
PyYAML==6.0
54
greenery==4.0.0

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ packages = find:
2020
install_requires =
2121
ghapi==1.0.3
2222
ruamel.yaml==0.17.21
23-
Flask==2.2.2
2423
PyYAML==6.0
2524
greenery==4.0.0
2625

tests/rest_api/test_rest_api.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/rest_api/testcase1-findings.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)