Repository navigation
Conversation
Add a Tags field to DeployVMInput and UpdateVMInput (nil means untouched, a non-nil slice including an empty one replaces the tags), carry the tags through DeployVM and UpdateVM, and persist them to Instance.spec.tags via the store mapping. MergePlatformVM no longer resurrects cleared tags and the legacy hypervisor deploy path forwards them too.
UpdateVM discarded the GetVM fallback result and re-queried the store, which could return nil for legacy/KubeVirt-only VMs without an Instance CR, panicking on the field access below. Use the GetVM result and add a nil guard, with a regression test.
Show API tags in the VM list, seed the edit form with existing tags and render them as removable pills (Enter/comma to add, Backspace to drop the last). Extract a reusable TagsInput and reuse it in the deploy wizard, fixing creation so more than one tag can be entered (the old input stripped the comma on every keystroke). Add pt/en strings and a unit test for mergeTags.
wesleip
requested review from
Matheus-Thurler and
RodrigoGoncalves-dev
as code owners
October 10, 2026 19:43
Merged
3 of 4 tasks
Matheus-Thurler
left a comment
Contributor
There was a problem hiding this comment.
Tag UX and the UpdateVM nil-guard fix look good. Two things to address:
- Every save writes
spec.tags, even when empty.InstanceToUnstructuredalways setsspec["tags"] = [](seeTestInstanceToUnstructuredWritesEmptyTags). On a cluster still running the old CRD, strict decoding rejectsunknown field "spec.tags", which breaks create/update of every VM, not only tagged ones. Please write the field only when there are tags, or when clearing previously set tags, so this is safe to deploy before the CRD is applied. - No validation of tags. Nothing limits count, length or charset in the handler or service. Suggest trimming plus a cap (for example 50 tags, 63 chars each) with an HTTP 400, matching the CRD limits requested in operator#74.
Deploy order: operator#74, CRD sync in helm-charts and apply, then this PR.
Collaborator
Author
Owner re-request: feedback from PR #256 addressedIssue 1 - Write
|
2 of 4 tasks
Matheus-Thurler
added a commit
that referenced
this pull request
Oct 16, 2026
* feat(compute): support VM tags on create and update Add a Tags field to DeployVMInput and UpdateVMInput (nil means untouched, a non-nil slice including an empty one replaces the tags), carry the tags through DeployVM and UpdateVM, and persist them to Instance.spec.tags via the store mapping. MergePlatformVM no longer resurrects cleared tags and the legacy hypervisor deploy path forwards them too. * fix(compute): avoid nil deref when editing a VM missing from store UpdateVM discarded the GetVM fallback result and re-queried the store, which could return nil for legacy/KubeVirt-only VMs without an Instance CR, panicking on the field access below. Use the GetVM result and add a nil guard, with a regression test. * feat(ui): manage VM tags in list, edit and creation Show API tags in the VM list, seed the edit form with existing tags and render them as removable pills (Enter/comma to add, Backspace to drop the last). Extract a reusable TagsInput and reuse it in the deploy wizard, fixing creation so more than one tag can be entered (the old input stripped the comma on every keystroke). Add pt/en strings and a unit test for mergeTags. --------- Co-authored-by: Weslei Paulo Pereira <[email protected]>
Contributor
|
Superseded by #261 (rebased on the new UI). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
End-to-end support for user-defined VM tags.
DeployVMInput.TagsandUpdateVMInput.Tags.UpdateVMInput.Tagsis*[]string—nilmeans "leave unchanged", while a non-nil slice (including empty) replaces the tags, so removing all tags persists. Tags are stored inInstance.spec.tagsthrough the store mapping, the legacy hypervisor deploy path forwards them, andMergePlatformVMno longer resurrects cleared tags.×removes a pill. A reusableTagsInputcomponent is shared by the edit form and the deploy wizard.form.tags.join(', ')and split on comma, so the separator was stripped on every keystroke and Enter did nothing. It now usesTagsInput.InstanceCR) dereferenced a nil pointer and returned HTTP 500.UpdateVMnow uses theGetVMfallback result with a nil guard, covered by a regression test.Cross-repo
Tags are persisted in
Instance.spec.tags, so the operator CRD must include thetagsfield (otherwise the API server prunes it). No typed Kubernetes API calls were added, so the RBAC contract is unchanged.Test plan
go test ./...cd ui && npm run build(alsonpm test— vitest, 32 passing)