Skip to content

Commit 63a9e34

Browse files
authored
fix: correct free disk space reported by agent metadata in fly.io example (coder#7592)
1 parent ec5ef51 commit 63a9e34

File tree

1 file changed

+4
-3
lines changed
  • examples/templates/fly-docker-image

1 file changed

+4
-3
lines changed

examples/templates/fly-docker-image/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,11 @@ resource "coder_agent" "main" {
284284
code-server --auth none >/tmp/code-server.log 2>&1 &
285285
# Set the hostname to the workspace name
286286
sudo hostname -b "${data.coder_workspace.me.name}-fly"
287+
echo "127.0.0.1 ${data.coder_workspace.me.name}-fly" | sudo tee -a /etc/hosts
287288
# Install the Fly CLI and add it to the PATH
288289
curl -L https://fly.io/install.sh | sh
289-
echo "export PATH=$PATH:/home/coder/.fly/bin" >> ~/.bashrc
290-
source ~/.bashrc
290+
echo "export PATH=$PATH:/home/coder/.fly/bin" >> /home/coder/.bashrc
291+
source /home/coder/.bashrc
291292
EOT
292293

293294
metadata {
@@ -320,7 +321,7 @@ resource "coder_agent" "main" {
320321
script = <<-EOT
321322
#!/bin/bash
322323
set -e
323-
df /home/coder | awk '$NF=="/"{printf "%s", $5}'
324+
df | awk '$NF=="/home/coder" {printf "%s", $5}'
324325
EOT
325326
}
326327
}

0 commit comments

Comments
 (0)