Commit a81b9d0
authored
Repo webhook move (#1129)
* Move repo val webhook
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
* Unique name for each webhook
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
* Address Copilot review comments on repository webhook
- Use GetAPIReader() instead of GetClient() for strong consistency during admission validation (prevents cache-induced race conditions)
- Scope repository list query to namespace level to reduce admission latency at scale
- Test UPDATE operation semantics explicitly for the 'updating self' test case
- Fix misleading documentation comment to link to actual deployment config
All unit tests pass. No lint issues.
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
* Increase test coverage
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
* Block repo spec.git secret updates
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
* Move repo secret validation to CEL
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
* Revert git secret immutability
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
* Update after rebase
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
* Revert repo list on namespace and add indexers
- Remove namespace-only filter from webhook conflict detection
- Add field indexes on spec.git.repo and spec.git.branch for optimization
- Add comprehensive test coverage for indexing functions
- Condense and improve webhook query comments
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
* Fall back to full List when no indexers
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
* Add matchConds to webhook and extra testing
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
---------
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>1 parent c900891 commit a81b9d0
17 files changed
Lines changed: 2707 additions & 1467 deletions
File tree
- .vscode
- controllers
- packagerevisions
- config/webhook
- pkg/controllers/packagerevision
- repositories
- config/webhook
- pkg
- controllers/repository
- webhooks
- deployments/porch
- pkg/apiserver
- test/e2e/crd
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
| |||
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
59 | | - | |
60 | | - | |
61 | 57 | | |
62 | 58 | | |
63 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | | - | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
90 | 142 | | |
91 | 143 | | |
92 | 144 | | |
| |||
0 commit comments