Skip to content

fix: fallback to spec.kubernetes.vpcId when infra output.json has no vpc_id#656

Open
mimnix wants to merge 1 commit intomainfrom
fix/distribution-vpcid-fallback
Open

fix: fallback to spec.kubernetes.vpcId when infra output.json has no vpc_id#656
mimnix wants to merge 1 commit intomainfrom
fix/distribution-vpcid-fallback

Conversation

@mimnix
Copy link
Copy Markdown

@mimnix mimnix commented Apr 30, 2026

Summary 💡

When running the infrastructure phase without creating a VPC (because it already exists), the output.json file is created but does not contain a vpc_id key. This causes ErrVpcIDNotFound in the distribution phase, preventing the fallback to .spec.kubernetes.vpcId from the furyctl config.

Closes:

Relates:

Description 📝

The extractVpcIDFromPrevPhases function in the distribution phase had an if/else structure where the fallback to .spec.kubernetes.vpcId was only reached when output.json did not exist at all (os.ReadFile error).

When the infrastructure phase runs without creating a VPC, it still produces an output.json (empty or without vpc_id). In this case, the code entered the if branch, found no vpc_id, and returned ErrVpcIDNotFound instead of falling through to the furyctl config fallback.

The fix removes the exclusive if/else structure so that when output.json exists but does not contain vpc_id, execution continues to the fallback that reads the value from .spec.kubernetes.vpcId.

Breaking Changes 💔

None.

Tests performed 🧪

  • Project compiles successfully with go build ./...
  • Tested the distribution phase with an existing VPC and no vpc_id in infra output

Future work 🔧

  • Add unit tests for extractVpcIDFromPrevPhases covering the different fallback scenarios.
  • Consider applying the same fix to kubernetes.go where ErrVpcIDNotFound is also returned in a similar pattern.

@mimnix mimnix added the bug Something isn't working label Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants