Skip to content
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

Pin to glue releases #53

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion iac/gclb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ resource "google_dns_managed_zone" "top-level-zone" {

// Put the above domain in front of our regional services.
module "serverless-gclb" {
source = "github.com/chainguard-dev/terraform-infra-common//modules/serverless-gclb"
source = "chainguard-dev/common/infra//modules/serverless-gclb"
version = "0.3.0"

name = var.name
project_id = var.project_id
Expand Down
13 changes: 8 additions & 5 deletions iac/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ provider "ko" { docker_repo = "gcr.io/${var.project_id}" }

// Create a network with several regional subnets
module "networking" {
source = "chainguard-dev/common/infra//modules/networking"
source = "chainguard-dev/common/infra//modules/networking"
version = "0.3.0"

name = var.name
project_id = var.project_id
regions = var.regions
name = var.name
project_id = var.project_id
regions = var.regions
netnum_offset = 1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this actions are failing with:

module.networking.google_compute_subnetwork.regional["us-central1"]: Destroying... [id=projects/octo-sts/regions/us-central1/subnetworks/octo-sts-us-central1]
Error: Terraform exited with code 1.
│ 
╵
Error: Process completed with exit code 1.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were there any more details in this error? The intent of this change was to be backwards compatible and fall back to the provider project if these values weren't set.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. netnum_offset should default to 0 if not provided, so I'm curious why this would be causing problems 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhhh i see what's going on. this is the real error:

│ Error: Error when reading or editing Subnetwork: googleapi: Error 400: The subnetwork resource 'projects/octo-sts/regions/us-central1/subnetworks/octo-sts-us-central1' is already being used by 'projects/octo-sts/regions/us-central1/addresses/serverless-ipv4-1706112377164427487', resourceInUseByAnotherResource

Previously the old network module was using a cidr address n+1 than what was given. Now we zero index so we don't waste cidr range, which changed the subnet address being used to start at 0, but the old subnet couldn't be removed because the existing cloud run resources were already using it.

So this change is just matching the previous n+1 cidr behavior as before.

}

// Create a keyring to hold our OIDC keys.
Expand Down Expand Up @@ -79,7 +81,8 @@ resource "google_service_account" "octo-sts" {
}

module "sts-service" {
source = "chainguard-dev/common/infra//modules/regional-go-service"
source = "chainguard-dev/common/infra//modules/regional-go-service"
version = "0.3.0"

project_id = var.project_id
name = var.name
Expand Down
Loading