Skip to content

Commit

Permalink
Merge pull request #175 from moustafab/moustafab/fix-pod-hostnames
Browse files Browse the repository at this point in the history
fix: host rewrite results in incorrect result for `hostname -f`
  • Loading branch information
FabianKramm authored Oct 30, 2021
2 parents e01b031 + 384a08f commit de52b06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controllers/resources/pods/translate/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func rewritePodHostnameFQDN(pPod *corev1.Pod, hostsRewriteImage, fromHost, toHos
Name: HostsRewriteContainerName,
Image: hostsRewriteImage,
Command: []string{"sh"},
Args: []string{"-c", "sed -E -e 's/^(\\d+.\\d+.\\d+.\\d+\\s+)" + fromHost + "$/\\1 " + toHostname + " " + toHostnameFQDN + "/' /etc/hosts > /hosts/hosts"},
Args: []string{"-c", "sed -E -e 's/^(\\d+.\\d+.\\d+.\\d+\\s+)" + fromHost + "$/\\1 " + toHostnameFQDN + " " + toHostname + "/' /etc/hosts > /hosts/hosts"},
VolumeMounts: []corev1.VolumeMount{
{
MountPath: "/hosts",
Expand Down

0 comments on commit de52b06

Please sign in to comment.