Skip to content

fix: handle scenarios with nil machine info#1894

Merged
kian99 merged 2 commits intocanonical:v3from
kian99:fix-type-transformation
Mar 5, 2026
Merged

fix: handle scenarios with nil machine info#1894
kian99 merged 2 commits intocanonical:v3from
kian99:fix-type-transformation

Conversation

@kian99
Copy link
Contributor

@kian99 kian99 commented Mar 5, 2026

Description

Fixes a panic in the toModelInfo function when Juju returns nil for machine info. I previously didn't add unit tests for this mapping function because it's tested in our integration tests but running the Terraform provider tests against the latest JIMM, I saw we were encountering a panic when destroying a model/application. During destruction there seems to be times when the Juju controller reports a nil value for machine info, and we were not correctly handling that.

I've now added some unit tests for this case and the successful case.

Engineering checklist

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

@kian99 kian99 requested a review from a team as a code owner March 5, 2026 08:01
@kian99 kian99 merged commit 1090cea into canonical:v3 Mar 5, 2026
8 checks passed
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.

3 participants