Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

Change policy on fetching configuration variables #389

@adg

Description

@adg

The gddo-server can fetch configuration variables (github auth tokens, google analytics tracking codes, HTTP user agent string) from either Google Compute Engine's Metadata server or using local environment variables.

Presently, it uses the metadata service if available, and falls back on environment variables otherwise.

@bradfitz points out in a recent code review:

these sorts of checks are annoying when your dev machine is running on GCE itself. Please check the os.Getenv first and only if it's empty, then fall back to checking GCE + the metadata.

So perhaps we should change the policy throughout the codebase to prefer the environment variables and use GCE as a backup.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions