-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change API to work better with Podman 5.0.0
This makes port publications more explicit with regards to which addresses should be bound. Additionally, it fixes some issues caused by the move from slirp4netns to pasta as the podman default: The old behaviour in podman when told to publish on address :: was to publish on all IPv6 AND IPv4 addresses. The new behaviour for pasta is to only publish IPv6 (which is arguably what slirp4netns should have been doing). This also adds optional debug logging, and more configuration for readiness checks. Affects: containers/podman#22221 Fix: #3
- Loading branch information
Showing
11 changed files
with
443 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
com.io7m.ervilla.api/src/main/java/com/io7m/ervilla/api/EPortAddressType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
* Copyright © 2024 Mark Raynsford <[email protected]> https://www.io7m.com | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | ||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR | ||
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
|
||
|
||
package com.io7m.ervilla.api; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* The address to which to bind a port. | ||
*/ | ||
|
||
public sealed interface EPortAddressType | ||
{ | ||
/** | ||
* @return The address string to be used externally to connect to the bound port | ||
*/ | ||
|
||
String targetAddress(); | ||
|
||
/** | ||
* Bind to all IPv4 addresses ("0.0.0.0"). | ||
*/ | ||
|
||
record AllIPv4() | ||
implements EPortAddressType | ||
{ | ||
@Override | ||
public String targetAddress() | ||
{ | ||
return "0.0.0.0"; | ||
} | ||
} | ||
|
||
/** | ||
* Bind to all IPv6 addresses ("::"). | ||
*/ | ||
|
||
record AllIPv6() | ||
implements EPortAddressType | ||
{ | ||
@Override | ||
public String targetAddress() | ||
{ | ||
return "::"; | ||
} | ||
} | ||
|
||
/** | ||
* Bind to all addresses ("0.0.0.0" and "::"). | ||
*/ | ||
|
||
record All() | ||
implements EPortAddressType | ||
{ | ||
@Override | ||
public String targetAddress() | ||
{ | ||
return "::"; | ||
} | ||
} | ||
|
||
/** | ||
* Bind to a specific address. | ||
* | ||
* @param address The host address | ||
*/ | ||
|
||
record Address(String address) | ||
implements EPortAddressType | ||
{ | ||
/** | ||
* Bind to a specific address. | ||
*/ | ||
|
||
public Address | ||
{ | ||
Objects.requireNonNull(address, "address"); | ||
} | ||
|
||
@Override | ||
public String targetAddress() | ||
{ | ||
return this.address; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.