Skip to content

fix: handle --restore flag in platform driver create path#3563

Closed
pascalbreuninger wants to merge 1 commit intomainfrom
fix/engprov-118
Closed

fix: handle --restore flag in platform driver create path#3563
pascalbreuninger wants to merge 1 commit intomainfrom
fix/engprov-118

Conversation

@pascalbreuninger
Copy link
Member

Summary

The --restore flag was silently ignored when creating a vCluster with --driver platform. This adds restore handling to the platform driver create path, matching the helm driver behavior.

Root Cause

CreatePlatform() in pkg/cli/create_platform.go never checked options.Restore and never called Restore(), while the helm driver path did.

Fix

Added a check for options.Restore after vCluster creation in CreatePlatform(). When set, it calls Restore() with the snapshot path, matching the helm driver behavior.

Testing

  • Added regression test TestCreatePlatform_RestoreNotIgnored_ENGPROV118 that verifies CreatePlatform handles the restore flag
  • All existing ./pkg/cli/... tests pass

Reproduction

See reproduction steps in ENGPROV-118

Linear

Fixes ENGPROV-118

Fixes ENGPROV-118.

The CreatePlatform function never checked options.Restore, silently
ignoring the --restore flag when using --driver platform. This adds
a Restore() call after the vCluster instance is created and ready,
matching the behavior of the helm driver code path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pascalbreuninger pascalbreuninger requested a review from a team as a code owner February 7, 2026 22:51
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6164321651

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +148 to +150
if options.Restore != "" {
log.Infof("Restore vCluster %s...", virtualClusterName)
err = Restore(ctx, []string{virtualClusterName, options.Restore}, globalFlags, &snapshot.Options{}, &pod.Options{}, false, false, log)

Choose a reason for hiding this comment

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

P1 Badge Use new-vcluster restore mode for fresh platform creates

When --restore is used during a fresh platform create, CreatePlatform always calls Restore(..., newVCluster=false, ...), so the restore pod omits --new-vcluster (see restore_helm.go where the flag is only added when newVCluster is true). That means the restore runs in “restore into existing cluster” mode, which keeps mappings and cluster-specific objects that are supposed to be skipped for a brand-new cluster. This can lead to stale mappings/certs being restored or restore failures in new clusters. The Helm create path passes newVCluster=true after a fresh install, so platform should mirror that behavior when the vcluster was just created.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant