Skip to content

Commit

Permalink
fix: host rewrite results in incorrect result for hostname -f
Browse files Browse the repository at this point in the history
The issue was with the ordering of the /etc/hosts file which changed in #135

Closes #174
  • Loading branch information
moustafab committed Oct 30, 2021
1 parent e01b031 commit 384a08f
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 384a08f

Please sign in to comment.