Commit 70048e4
fix: configure ENVTEST binaries for IDE execution and project-specific setup
- Installs ENVTEST binaries in the project’s `./bin/envtest` directory for isolation.
- Configures `setup-envtest` binary to be downloaded based on the controller-runtime release version to ensure compatibility with the project’s dependencies.
- Updates `suite_test.go` to dynamically locate and set the binary assets directory for seamless IDE debugging.
- Introduces `getFirstFoundEnvTestBinaryDir` to detect ENVTEST binaries in the project directory when running tests outside the Makefile context.
1. **Ease of IDE Debugging**:
- By setting the `BinaryAssetsDirectory` dynamically, contributors can debug tests in their preferred IDEs (e.g., GoLand, VSCode) without requiring additional environment configuration such as setting `KUBEBUILDER_ASSETS`.
2. **Project-Specific Binaries**:
- Installing binaries inside the project avoids conflicts with other projects or system-wide installations, particularly useful for contributors with restricted environments (e.g., corporate laptops).
3. **Consistency**:
- Using `setup-envtest` from the matching controller-runtime release avoids compatibility issues, such as those outlined in [#2744](kubernetes-sigs/controller-runtime#2744) and [#2646](kubernetes-sigs/controller-runtime#2646).
4. **Simplified Contributor Onboarding**:
- New contributors often face a learning curve to:
- Understand ENVTEST and its dependency on binaries.
- Configure `KUBEBUILDER_ASSETS` manually.
- Set up their IDE for debugging tests.
- This setup minimizes friction and ensures tests can be run consistently across different environments.
While setting `KUBEBUILDER_ASSETS` is sufficient for experienced contributors, this change makes it easier for newcomers and supports debugging directly in IDEs without additional configuration.1 parent e5820ae commit 70048e4
File tree
4 files changed
+36
-99
lines changed- .bingo
- internal/controllers
4 files changed
+36
-99
lines changedThis file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | 154 | | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
159 | 167 | | |
160 | | - | |
| 168 | + | |
161 | 169 | | |
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
165 | 173 | | |
166 | | - | |
| 174 | + | |
167 | 175 | | |
168 | 176 | | |
169 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
165 | 174 | | |
166 | 175 | | |
167 | 176 | | |
| |||
179 | 188 | | |
180 | 189 | | |
181 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
0 commit comments