Skip to content

Commit b234be5

Browse files
committed
Flatten the 'db' commands, e.g. 'db prefix' to 'db/prefix'
The user experience with commands that have sub-commands is not great and it makes it harder to implement completion in 'cilium-dbg shell' if we so choose. There isn't really any good rational for nesting the commands like this, so let's go with Plan 9 style command names (https://9p.io/magic/man2html/8/auth), e.g. "db prefix" becomes "db/prefix". Signed-off-by: Jussi Maki <[email protected]>
1 parent cafbbe7 commit b234be5

File tree

6 files changed

+162
-227
lines changed

6 files changed

+162
-227
lines changed

reconciler/testdata/batching.txtar

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,38 @@ start-reconciler with-batchops
77
# From here this is the same as incremental.txtar.
88

99
# Step 1: Insert non-faulty objects
10-
db insert test-objects obj1.yaml
11-
db insert test-objects obj2.yaml
12-
db insert test-objects obj3.yaml
13-
db cmp test-objects step1+3.table
10+
db/insert test-objects obj1.yaml
11+
db/insert test-objects obj2.yaml
12+
db/insert test-objects obj3.yaml
13+
db/cmp test-objects step1+3.table
1414
expect-ops update(1) update(2) update(3)
1515

1616
# Reconciler should be running and reporting health
1717
health 'job-reconcile.*level=OK.*message=OK, 3 object'
1818

1919
# Step 2: Update object '1' to be faulty and check that it fails and is being
2020
# retried.
21-
db insert test-objects obj1_faulty.yaml
21+
db/insert test-objects obj1_faulty.yaml
2222
expect-ops 'update(1) fail' 'update(1) fail'
23-
db cmp test-objects step2.table
23+
db/cmp test-objects step2.table
2424
health 'job-reconcile.*level=Degraded.*1 error'
2525

2626
# Step 3: Set object '1' back to healthy state
27-
db insert test-objects obj1.yaml
27+
db/insert test-objects obj1.yaml
2828
expect-ops 'update(1)'
29-
db cmp test-objects step1+3.table
29+
db/cmp test-objects step1+3.table
3030
health 'job-reconcile.*level=OK'
3131

3232
# Step 4: Delete '1' and '2'
33-
db delete test-objects obj1.yaml
34-
db delete test-objects obj2.yaml
35-
db cmp test-objects step4.table
33+
db/delete test-objects obj1.yaml
34+
db/delete test-objects obj2.yaml
35+
db/cmp test-objects step4.table
3636
expect-ops 'delete(1)' 'delete(2)'
3737

3838
# Step 5: Try to delete '3' with faulty target
3939
set-faulty true
40-
db delete test-objects obj3.yaml
41-
db cmp test-objects empty.table
40+
db/delete test-objects obj3.yaml
41+
db/cmp test-objects empty.table
4242
expect-ops 'delete(3) fail'
4343
health 'job-reconcile.*level=Degraded.*1 error'
4444

reconciler/testdata/incremental.txtar

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@ hive start
55
start-reconciler
66

77
# Step 1: Insert non-faulty objects
8-
db insert test-objects obj1.yaml
9-
db insert test-objects obj2.yaml
10-
db insert test-objects obj3.yaml
11-
db cmp test-objects step1+3.table
8+
db/insert test-objects obj1.yaml
9+
db/insert test-objects obj2.yaml
10+
db/insert test-objects obj3.yaml
11+
db/cmp test-objects step1+3.table
1212
expect-ops update(1) update(2) update(3)
1313

1414
# Reconciler should be running and reporting health
1515
health 'job-reconcile.*level=OK.*message=OK, 3 object'
1616

1717
# Step 2: Update object '1' to be faulty and check that it fails and is being
1818
# retried.
19-
db insert test-objects obj1_faulty.yaml
20-
db cmp test-objects step2.table
19+
db/insert test-objects obj1_faulty.yaml
20+
db/cmp test-objects step2.table
2121
expect-ops 'update(1) fail' 'update(1) fail'
2222
health 'job-reconcile.*level=Degraded.*1 error'
2323

2424
# Step 3: Set object '1' back to healthy state
25-
db insert test-objects obj1.yaml
26-
db show test-objects
27-
db cmp test-objects step1+3.table
25+
db/insert test-objects obj1.yaml
26+
db/show test-objects
27+
db/cmp test-objects step1+3.table
2828
expect-ops 'update(1)'
2929
health 'job-reconcile.*level=OK'
3030

3131
# Step 4: Delete '1' and '2'
32-
db delete test-objects obj1.yaml
33-
db delete test-objects obj2.yaml
34-
db cmp test-objects step4.table
32+
db/delete test-objects obj1.yaml
33+
db/delete test-objects obj2.yaml
34+
db/cmp test-objects step4.table
3535
expect-ops 'delete(1)' 'delete(2)'
3636

3737
# Step 5: Try to delete '3' with faulty target
3838
set-faulty true
39-
db delete test-objects obj3.yaml
40-
db cmp test-objects empty.table
39+
db/delete test-objects obj3.yaml
40+
db/cmp test-objects empty.table
4141
expect-ops 'delete(3) fail'
4242
health 'job-reconcile.*level=Degraded.*1 error'
4343

reconciler/testdata/pruning.txtar

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ hive start
22
start-reconciler with-prune
33

44
# Pruning without table being initialized does nothing.
5-
db insert test-objects obj1.yaml
5+
db/insert test-objects obj1.yaml
66
expect-ops update(1)
77
prune
8-
db insert test-objects obj2.yaml
8+
db/insert test-objects obj2.yaml
99
expect-ops update(2) update(1)
1010
health 'job-reconcile.*level=OK'
1111

@@ -33,12 +33,12 @@ expvar
3333
grep 'prune_current_errors.test: 0'
3434

3535
# Delete an object and check pruning happens without it
36-
db delete test-objects obj1.yaml
36+
db/delete test-objects obj1.yaml
3737
prune
3838
expect-ops 'prune(n=1)' delete(1)
3939

4040
# Prune without objects
41-
db delete test-objects obj2.yaml
41+
db/delete test-objects obj2.yaml
4242
prune
4343
expect-ops prune(n=0) delete(2) prune(n=1)
4444

reconciler/testdata/refresh.txtar

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@ hive start
22
start-reconciler with-refresh
33

44
# Step 1: Add a test object.
5-
db insert test-objects obj1.yaml
5+
db/insert test-objects obj1.yaml
66
expect-ops 'update(1)'
7-
db cmp test-objects step1.table
7+
db/cmp test-objects step1.table
88

99
# Step 2: Set the object as updated in the past to force refresh
10-
db insert test-objects obj1_old.yaml
10+
db/insert test-objects obj1_old.yaml
1111
expect-ops 'update-refresh(1)'
1212

1313
# Step 3: Refresh with faulty target, should see fail & retries
1414
set-faulty true
15-
db insert test-objects obj1_old.yaml
15+
db/insert test-objects obj1_old.yaml
1616
expect-ops 'update-refresh(1) fail' 'update-refresh(1) fail'
17-
db cmp test-objects step3.table
17+
db/cmp test-objects step3.table
1818
health
1919
health 'job-reconcile.*Degraded'
2020

2121
# Step 4: Back to health
2222
set-faulty false
23-
db insert test-objects obj1_old.yaml
23+
db/insert test-objects obj1_old.yaml
2424
expect-ops 'update-refresh(1)'
25-
db cmp test-objects step4.table
25+
db/cmp test-objects step4.table
2626
health 'job-reconcile.*OK, 1 object'
2727

2828
# -----

0 commit comments

Comments
 (0)