Skip to content

Commit 034b31e

Browse files
wellCh4nclaude
andcommitted
fix(application): carry env config group and comment across namespace migration
Namespace migration snapshots each environment's config items and replays them into the target namespace via toUpdateCommands(). That mapping only copied key, value, secret, and mountPath, so the UI-only group and comment metadata stored in the oops.config-meta annotation was dropped on migration. Copy group and comment onto each UpdateConfigMapCommand as well. Display order was already preserved implicitly: getConfigMaps() returns items sorted by order and updateConfigMap() re-derives order from list position, which the mapping keeps intact. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 05bf12c commit 034b31e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/com/github/wellch4n/oops/application/service/NamespaceMigrationService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,18 @@ private void redeployToTarget(Application application,
193193
}
194194

195195
private List<UpdateConfigMapCommand> toUpdateCommands(List<ConfigMapItem> items) {
196+
// The snapshot from getConfigMaps() is already sorted by display order, and updateConfigMap()
197+
// re-derives each item's order from its position in this list, so preserving the iteration order
198+
// here carries the manual ordering across the migration. Group and comment must be copied explicitly.
196199
List<UpdateConfigMapCommand> commands = new ArrayList<>();
197200
for (ConfigMapItem item : items) {
198201
UpdateConfigMapCommand command = new UpdateConfigMapCommand();
199202
command.setKey(item.getKey());
200203
command.setValue(item.getValue());
201204
command.setSecret(item.isSecret());
202205
command.setMountPath(item.getMountPath());
206+
command.setGroup(item.getGroup());
207+
command.setComment(item.getComment());
203208
commands.add(command);
204209
}
205210
return commands;

0 commit comments

Comments
 (0)