Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add better support for agent names (i.e. FQDN for a workspace agent)

Aperta
#415 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
go, terraform
Ambito
tooling

Direzione di ricerca

Inizia tracciando la fonte dati coder_workspace, coder_app, i moduli coder e il flusso esistente di agent_id. Confronta la ricerca proposta di agents[var.agent_id].name con l’approccio di sostituzione delle variabili d’ambiente, quindi definisci quali requisiti sono supportati. Il lavoro è completo quando gli utenti possono ricavare i nomi degli agenti o gli FQDN senza codificare direttamente il nome dell’agente e il comportamento opzionale è stato definito esplicitamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

At present, there is no good way to extract the agent name from Terraform and use it within the template. This is relevant for coder_app's or anything else that wishes to create a working link to the workspace (agent) in a multi-agent environment.

Typically users have been able to use either <agent>.<workspace> or <workspace>.<agent>, and this will resolve to the correct agent when there is only one.

In Coder Desktop for example, using multiple agents means the FQDN becomes <agent>.<workspace>.me.coder or <agent>.<workspace>.<username>.coder and the short version <agent>.<workspace> no longer works.

This is problematic especially in Coder modules as they cannot create URLs for the apps without asking the user to provide the agent name which can only be represented via a static sting in terraform. Resource names cannot be inspected which is where the name comes from.

Requirements:

  • The user doesn't need to hard-code a string value for the agent name when
    • Using coder modules
    • Writing coder_apps
  • (Optional, but ideal) the user only needs to provide the agent_id that is currently already being provided
  • (Optional) provide a FQDN like <agent>.<workspace>.<owner>.coder to access the agent

The optional requirement could perhaps be achieved via some form of new data on the coder_workspace data source so that a lookup can be performed:

coder_workspace.me.agents[var.agent_id].name

Open to ideas on how and where to solve this.


There also exists a precedent for using fake environment variables and the product supports replacements of $SESSION_TOKEN for coder_app URLs, this is one potential avenue to achieve the same, albeit not ideal.

Lingua principale
Go
Stelle
60
Fork
27
Merge medio
6g 21h
PR unite (30g)
3

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di coder/terraform-provider-coder

Tutte le issue di coder/terraform-provider-coder

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.