Skip to content

feat: opt-in non-authoritative project metadata#40

Merged
nandajavarma merged 2 commits into
mainfrom
nv/opt-in-metadata-item
May 12, 2026
Merged

feat: opt-in non-authoritative project metadata#40
nandajavarma merged 2 commits into
mainfrom
nv/opt-in-metadata-item

Conversation

@nandajavarma
Copy link
Copy Markdown
Collaborator

@nandajavarma nandajavarma commented May 12, 2026

Problem

google_compute_project_metadata is authoritative — it manages all project-level metadata. Keys not declared in this module are removed on terraform apply. This is disruptive for users who share the GCP project with other metadata sources (SSH keys, other Terraform modules, etc.).

PR #24 attempted to fix this by switching to google_compute_project_metadata_item, but that broke existing deployments on upgrade (PR #33 reverted it).

Fix

Add a use_authoritative_project_metadata variable (default: true) that lets users opt into per-key google_compute_project_metadata_item resources when ready.

  • true (default): existing behavior, no change on upgrade
  • false: per-key items that only manage enable-oslogin and gitpod-runner-id, leaving other project metadata untouched

Migration docs (state rm + import steps) are added to the public GCP runner setup docs in a separate PR.

Changes

  • variables.tf: new use_authoritative_project_metadata bool variable
  • runner-vm.tf: count-gated toggle between google_compute_project_metadata and google_compute_project_metadata_item

Addresses feedback from #33.

nandajavarma and others added 2 commits May 12, 2026 13:11
Add use_authoritative_project_metadata variable (default: true) to let
users switch from google_compute_project_metadata (authoritative) to
per-key google_compute_project_metadata_item resources.

Existing deployments see no change on upgrade. Users who share the GCP
project with other metadata sources can opt in by setting the variable
to false and running the documented state migration.

Co-authored-by: Ona <no-reply@ona.com>
Move migration docs to public Ona documentation instead of the
module README. Shorten the variable description to one sentence.

Co-authored-by: Ona <no-reply@ona.com>
@nandajavarma
Copy link
Copy Markdown
Collaborator Author

@carolinetaymor-qz Thanks for this suggestion!

@nandajavarma nandajavarma marked this pull request as ready for review May 12, 2026 13:16
@nandajavarma nandajavarma merged commit d021035 into main May 12, 2026
1 check passed
easyCZ pushed a commit that referenced this pull request May 21, 2026
feat: opt-in non-authoritative project metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant