Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix create-env bug where an empty slice of disks from the state file results in null being passed to the CPI ask the disks argument #670

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

jpalermo
Copy link
Member

This is caused by the way the original string slice is created. If you create it using var []string, it json marshals as null Instead we need to make([]string, 0), which will json marshal as []

…results in null being passed to the CPI ask the disks argument

This is caused by the way the original string slice is created. If you create it using var []string, it json marshals as null
Instead we need to make([]string, 0), which will json marshal as []

Signed-off-by: Joseph Palermo <[email protected]>
@jpalermo jpalermo requested a review from selzoc October 30, 2024 22:52
@jpalermo
Copy link
Member Author

Error seen using the vsphere cpi before this change:

Deploying:
  Creating instance 'bosh/0':
    Creating VM:
      Creating vm with stemcell cid 'sc-ca101912-4a4c-434a-9e7a-5ce2e426f6a4':
        CPI 'create_vm' method responded with error: CmdError{"type":"Unknown","message":"undefined method `map' for nil","ok_to_retry":false}

Exit code 1

@jpalermo jpalermo merged commit 5357b10 into main Oct 31, 2024
9 checks passed
@jpalermo jpalermo deleted the pr-fix-null-string-slices branch October 31, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants