Skip to content

Conversation

@jjaferson
Copy link
Contributor

@jjaferson jjaferson commented Dec 4, 2025

What issue type does this pull request address? (keep at least one, remove the others)
/kind bugfix

What does this pull request do? Which issues does it resolve? (use resolves #<issue_number> if possible)
resolves ENG-9408

Please provide a short message that should be published in the vcluster release notes
Fixed an issue where vcluster was not being deleted due to the schema difference between vcluster v0.29 and v0.30

What else do we need to know?


Note

Switch deletion to parse Helm values dynamically and check sync.toHost.namespaces.enabled via unstructured to conditionally run namespace cleanup without relying on old config schema.

  • CLI (vcluster deletion):
    • Parse Helm values into a generic map[string]any and use unstructured.NestedBool to read sync.toHost.namespaces.enabled.
    • Gate CleanupSyncedNamespaces(...) on the detected flag, defaulting to disabled on parse errors.
    • Remove dependency on config.Config schema and import; add unstructured import and debug logs for parse/lookup errors.

Written by Cursor Bugbot for commit db2244a. This will update automatically on new commits. Configure here.

@jjaferson jjaferson requested a review from a team as a code owner December 4, 2025 15:42
Copy link
Member

@FabianKramm FabianKramm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I don't think this solution is what we need here. There is a bigger fundamental problem which is that we try to parse the config when deleting a vCluster again. privateNodes is just one example that now broke, but adding such complexity for an edge cases is not what we should do here. The solution is to fix that we error out when deleting a vCluster, not sure why parsing the vCluster config there is needed anyways.

@mfranczy
Copy link
Contributor

mfranczy commented Dec 9, 2025

@FabianKramm

The solution is to fix that we error out when deleting a vCluster, not sure why parsing the vCluster config there is needed anyways

The config parsing in the cli was introduced because of the CleanUpNamespace, which depends on the vclusterConfig.Sync.ToHost.Namespaces.Enabled setting in the config. The config is parsed only to determine whether namespace cleanup should be executed.

If we remove the config parsing, the cleanup function would need to run unconditionally which should be fine, since the function already checks whether managed namespaces exist.

There is a bigger fundamental problem which is that we try to parse the config when deleting a vCluster again

I understand that you're essentially saying we should not rely on the vCluster config when managing resources from cli, but rather on the resource specs themselves, which were generated based on that config is that correct?

@FabianKramm
Copy link
Member

FabianKramm commented Dec 11, 2025

@mfranczy yes then lets do it like this, don't parse the vCluster config anymore or just parse the sync.toHost.namespaces.enabled unstrictly in a generic struct

Yes the CLI needs to be vCluster version independent and that also means independent of the vCluster config

Removing the entire vcluster config parsing logic and replacing it with parsing a generic unstructured to get the sync.toHost.namespaces.enabled
@FabianKramm FabianKramm merged commit 4fd9823 into loft-sh:main Dec 12, 2025
97 of 100 checks passed
loft-bot pushed a commit that referenced this pull request Dec 12, 2025
Removing the entire vcluster config parsing logic and replacing it with parsing a generic unstructured to get the sync.toHost.namespaces.enabled

Co-authored-by: José Silva <[email protected]>
(cherry picked from commit 4fd9823)
loft-bot pushed a commit that referenced this pull request Dec 12, 2025
Removing the entire vcluster config parsing logic and replacing it with parsing a generic unstructured to get the sync.toHost.namespaces.enabled

Co-authored-by: José Silva <[email protected]>
(cherry picked from commit 4fd9823)
loft-bot pushed a commit that referenced this pull request Dec 12, 2025
Removing the entire vcluster config parsing logic and replacing it with parsing a generic unstructured to get the sync.toHost.namespaces.enabled

Co-authored-by: José Silva <[email protected]>
(cherry picked from commit 4fd9823)
@loft-bot
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
v0.29
v0.30

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

loft-bot pushed a commit that referenced this pull request Dec 12, 2025
Removing the entire vcluster config parsing logic and replacing it with parsing a generic unstructured to get the sync.toHost.namespaces.enabled

Co-authored-by: José Silva <[email protected]>
(cherry picked from commit 4fd9823)
@loft-bot
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
v0.29
v0.30

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants