Skip to content

fix: fix free disk space reported by agent metadata in fly.io example #7592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions examples/templates/fly-docker-image/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,11 @@ resource "coder_agent" "main" {
code-server --auth none >/tmp/code-server.log 2>&1 &
# Set the hostname to the workspace name
sudo hostname -b "${data.coder_workspace.me.name}-fly"
echo "127.0.0.1 ${data.coder_workspace.me.name}-fly" | sudo tee -a /etc/hosts
# Install the Fly CLI and add it to the PATH
curl -L https://fly.io/install.sh | sh
echo "export PATH=$PATH:/home/coder/.fly/bin" >> ~/.bashrc
source ~/.bashrc
echo "export PATH=$PATH:/home/coder/.fly/bin" >> /home/coder/.bashrc
source /home/coder/.bashrc
EOT

metadata {
Expand Down Expand Up @@ -320,7 +321,7 @@ resource "coder_agent" "main" {
script = <<-EOT
#!/bin/bash
set -e
df /home/coder | awk '$NF=="/"{printf "%s", $5}'
df | awk '$NF=="/home/coder" {printf "%s", $5}'
EOT
}
}
Expand Down