Commit a45bff9
Add --placement-ref flag to addon create command (#513)
This commit adds support for the --placement-ref flag to the
addon create command, allowing users to specify a Placement
resource reference for automatic addon installation.
Changes:
- Add PlacementRef field to Options struct
- Add --placement-ref flag accepting namespace/name format
- Implement parsePlacementRef() to parse and validate the flag value
- Update newClusterManagementAddon() to set InstallStrategy based on flag
- Manual strategy when flag is not provided (default behavior)
- Placements strategy when flag is provided
- Add validation for placement-ref format
- Add comprehensive test coverage with 12 test cases including:
- Unit tests for parsePlacementRef()
- Unit tests for newClusterManagementAddon()
- Integration tests for end-to-end functionality
Fixes #505
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: Jian Qiu <[email protected]>
Co-authored-by: Claude <[email protected]>1 parent edc0b2a commit a45bff9
File tree
5 files changed
+478
-3
lines changed- pkg/cmd/addon/create
5 files changed
+478
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
79 | 103 | | |
80 | 104 | | |
81 | 105 | | |
| |||
96 | 120 | | |
97 | 121 | | |
98 | 122 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 123 | + | |
102 | 124 | | |
103 | 125 | | |
104 | 126 | | |
| |||
133 | 155 | | |
134 | 156 | | |
135 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
136 | 166 | | |
137 | 167 | | |
138 | 168 | | |
| |||
249 | 279 | | |
250 | 280 | | |
251 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
0 commit comments