kompose
kompose copied to clipboard
feature: add support for hostAliases
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds support for converting Docker Compose's extra_hosts field to Kubernetes' hostAliases field in Pod specifications.
When a docker-compose.yaml file contains extra_hosts entries, Kompose will now automatically convert them to the equivalent Kubernetes hostAliases configuration. This allows users to maintain custom host-to-IP mappings when migrating from Docker Compose to Kubernetes.
Which issue(s) this PR fixes:
Fixes #2066
Special notes for your reviewer:
- The conversion logic maps each
extra_hostsentry (format: "hostname:ip") to a correspondinghostAliasesentry with the IP and hostname - Added unit tests to verify the conversion behavior
@dependabot rebase