Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Registry unaccessible with Account API key #107

Open
outrunthewolf opened this issue May 13, 2020 · 0 comments
Open

Registry unaccessible with Account API key #107

outrunthewolf opened this issue May 13, 2020 · 0 comments

Comments

@outrunthewolf
Copy link

outrunthewolf commented May 13, 2020

Hi.

For some reason I can create registry credentials using an Account Key. I get:

2020/05/13 09:35:34 [ERROR] <root>: eval: *terraform.EvalRefresh, err: Registry ID 1sp52 not found. Check your API key permissions.

The registry does exist. But for some reason terraform cant see it if I use an Account Key. But it can see it if I use an environment key for that environment.

Terraform Version

Terraform v0.12.23

Affected Resource(s)

Please list the resources as a list, for example:

  • rancher_registry_credential

Terraform Configuration Files

# Configure the Rancher provider
provider "rancher" {
  api_url    = "https://xxx"
  access_key = var.rancher_access_key
  secret_key = var.rancher_secret_key
  version    = "~>v1.5.0"
}

/**
  === QA HOTFIX ===
**/
resource "rancher_registry" "google_container_registry" {

  name           = "Google Container Registry"
  description    = "Google Container Registry"
  environment_id = "1a8635"
  server_address = "eu.gcr.io"

  depends_on = [google_service_account_key.rancher_service_account_key]
}

resource "rancher_registry_credential" "google_container_registry_credentials" {

  name         = "gcr"
  registry_id  = rancher_registry.google_container_registry.id
  public_value = "_json_key"
  secret_value = base64decode(google_service_account_key.rancher_service_account_key.private_key)

}

Debug Output

https://gist.github.com/outrunthewolf/7cf29dfcc30facdfe9f3c487047acb59

Expected Behavior

I expected an Account API Key to work for all environments

Actual Behavior

I can only create registry credentials using an Environment Specific Key

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Create an Account API Key
  2. Add to terraform tfvars
  3. Run tf apply
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant