Package io.github.pod4dev.java
Interface GenericContainer
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
KubePlayer
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()getMappedHost(String serviceName, int exposedPort) Getting mapped host for the given service's name and exposed port.intgetMappedPort(String serviceName, int exposedPort) Getting mapped port for the given service's name and exposed port.voidstart()Creates the pod or container and immediately starts it.voidstop()Stops the pod or container with clearing created volumes.withCleanup(boolean doCleanup) Do resources cleanup after stopping.withExposedService(String serviceName, int exposedPort) Specify service and its port for expose.
-
Method Details
-
start
Creates the pod or container and immediately starts it. All created resources will be cleared out when a SIGTERM is received or pods exit.- Throws:
PodmanException
-
stop
Stops the pod or container with clearing created volumes.- Throws:
PodmanException
-
withExposedService
Specify service and its port for expose.- Parameters:
serviceName- name of service to expose.exposedPort- port to expose.- Returns:
- container with exposed services.
- Throws:
PodmanException
-
withCleanup
Do resources cleanup after stopping.- Parameters:
doCleanup- default if true.- Returns:
- customised container.
-
getMappedHost
Getting mapped host for the given service's name and exposed port.- Parameters:
serviceName- the service name.exposedPort- the exposed port.- Returns:
- mapped host.
- Throws:
PodmanException
-
getMappedPort
Getting mapped port for the given service's name and exposed port.- Parameters:
serviceName- the service name.exposedPort- the exposed port.- Returns:
- mapped host.
- Throws:
PodmanException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-