Skip to content

Guard against if ipv4Gateway is nil, removed fore unwrap#524

Merged
jglogan merged 2 commits intoapple:mainfrom
manojmahapatra:chore/handle-nil-ipv4address
Feb 11, 2026
Merged

Guard against if ipv4Gateway is nil, removed fore unwrap#524
jglogan merged 2 commits intoapple:mainfrom
manojmahapatra:chore/handle-nil-ipv4address

Conversation

@manojmahapatra
Copy link
Contributor

@manojmahapatra manojmahapatra commented Feb 8, 2026

Summary

  • Guarded against ipv4Gateway if nil and throw ContainerizationError(.invalidState, ...) instead of force unwraping
  • Added a unit test ContainerManagerTests.testCreateThrowsWhenGatewayMissing

Testing

  • make test passed.

@jglogan
Copy link
Contributor

jglogan commented Feb 9, 2026

@manojmahapatra Please commit a make fmt change.

You can install a pre-commit hook to check this at commit time: make pre-commit.

@manojmahapatra
Copy link
Contributor Author

@manojmahapatra Please commit a make fmt change.

You can install a pre-commit hook to check this at commit time: make pre-commit.

yes, thank you. It was in my todo, but I forgot somehow. :(

Copy link
Contributor

@jglogan jglogan left a comment

Choose a reason for hiding this comment

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

Looks good @manojmahapatra, thank you!

@jglogan
Copy link
Contributor

jglogan commented Feb 10, 2026

@manojmahapatra You'll need to repush with signed commits; see: https://github.com/apple/containerization/blob/main/CONTRIBUTING.md#pull-requests

@manojmahapatra manojmahapatra force-pushed the chore/handle-nil-ipv4address branch from e794d33 to 6cc9744 Compare February 10, 2026 22:00
@manojmahapatra
Copy link
Contributor Author

Ugh.. dont know what's going on my end. Done, thanks @jglogan

@jglogan
Copy link
Contributor

jglogan commented Feb 11, 2026

@manojmahapatra merged, thank you!

@jglogan jglogan merged commit 9839193 into apple:main Feb 11, 2026
2 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