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

Update google/image.go mappings #10401

Open
upodroid opened this issue Oct 25, 2021 · 3 comments
Open

Update google/image.go mappings #10401

upodroid opened this issue Oct 25, 2021 · 3 comments
Labels

Comments

@upodroid
Copy link
Contributor

upodroid commented Oct 25, 2021

Affected Resource(s)

  • google_*

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

While looking at #10368, I noticed that the image mappings at https://github.com/hashicorp/terraform-provider-google/blob/master/google/image.go#L35 need to be updated.

coreos mapping is currently broken:

 REDACTED  MCW0CDP3YY  ~  $  gcloud compute images list --project coreos-cloud | grep coreos-cloud
fedora-coreos-34-20211004-3-1-gcp-x86-64              fedora-coreos-cloud  fedora-coreos-stable                          READY
fedora-coreos-34-20211016-2-1-gcp-x86-64              fedora-coreos-cloud  fedora-coreos-testing                         READY
fedora-coreos-35-20211017-1-0-gcp-x86-64              fedora-coreos-cloud  fedora-coreos-next                            READY
var imageMap = map[string]string{
	"centos":      "centos-cloud",
	"coreos":      "fedora-coreos-cloud", // point to new project
	"debian":      "debian-cloud",
	"opensuse":    "opensuse-cloud",
	"rhel":        "rhel-cloud",
	"sles":        "suse-cloud",
	"ubuntu":      "ubuntu-os-cloud",
        "ubuntu-pro": "ubuntu-os-pro-cloud",
	"windows":     "windows-cloud",
	"windows-sql": "windows-sql-cloud",
        "rocky": "rocky-linux-cloud", // centos replacement

}

https://cloud.redhat.com/learn/topics/coreos
https://cloud.google.com/compute/docs/images/os-details

@rileykarson Can we squeeze this change in to v4? I can submit it.

Thanks

@upodroid upodroid added the bug label Oct 25, 2021
@rileykarson
Copy link
Collaborator

What'd be backwards-incompatible to change, sorry? If there are just new product mappings, we could add them additively right?

@upodroid
Copy link
Contributor Author

It would be great to do coreos/fedora-coreos-stable instead of fedora-coreos/fedora-coreos-stable. Redhat ripped out all the images anyway so creating an instance with the image coreos/fedora-coreos-stable should be failing.

@upodroid
Copy link
Contributor Author

https://registry.terraform.io/modules/matti/compute-instance/google/latest

 REDACTED  MCW0CDP3YY  ~  Desktop  Git  magic-modules  test   subnetwork-doc-fix  1+  13⚑  $   TF_LOG=debug terraform plan
2021/10/25 22:05:51 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/10/25 22:05:51 [INFO] Terraform version: 0.14.11  
2021/10/25 22:05:51 [INFO] Go runtime version: go1.15.6
2021/10/25 22:05:51 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/2.0.0/versions/0.14.11/terraform", "plan"}
2021/10/25 22:05:51 [DEBUG] Attempting to open CLI config file: /Users/REDACTED/.terraformrc
2021/10/25 22:05:51 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021/10/25 22:05:51 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/10/25 22:05:51 [DEBUG] ignoring non-existing provider search directory /Users/REDACTED/.terraform.d/plugins
2021/10/25 22:05:51 [DEBUG] ignoring non-existing provider search directory /Users/REDACTED/Library/Application Support/io.terraform/plugins
2021/10/25 22:05:51 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2021/10/25 22:05:51 [INFO] CLI command args: []string{"plan"}
2021/10/25 22:05:51 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
  Use TF_LOG=TRACE to see Terraform's internal logs.
  ----
2021/10/25 22:05:51 [DEBUG] New state was assigned lineage "7e3392f3-090f-f7b3-1202-41de51650bda"
2021/10/25 22:05:51 [DEBUG] checking for provisioner in "."
2021/10/25 22:05:51 [DEBUG] checking for provisioner in "/usr/local/Cellar/tfenv/2.0.0/versions/0.14.11"
2021/10/25 22:05:51 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory
2021/10/25 22:05:51 [INFO] backend/local: starting Plan operation
2021-10-25T22:05:51.708+0100 [INFO]  plugin: configuring client automatic mTLS
2021-10-25T22:05:51.734+0100 [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5]
2021-10-25T22:05:51.741+0100 [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5 pid=65154
2021-10-25T22:05:51.741+0100 [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5
2021-10-25T22:05:52.937+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: configuring server automatic mTLS: timestamp=2021-10-25T22:05:52.937+0100
2021-10-25T22:05:52.976+0100 [DEBUG] plugin.terraform-provider-google_v3.89.0_x5: plugin address: address=/var/folders/b1/dthn83bs2qbcrg38qszm22440000gn/T/plugin286134929 network=unix timestamp=2021-10-25T22:05:52.976+0100
2021-10-25T22:05:52.977+0100 [DEBUG] plugin: using plugin: version=5
2021-10-25T22:05:53.124+0100 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-10-25T22:05:53.127+0100 [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5 pid=65154
2021-10-25T22:05:53.127+0100 [DEBUG] plugin: plugin exited
2021/10/25 22:05:53 [INFO] terraform: building graph: GraphTypeValidate
2021/10/25 22:05:53 [DEBUG] adding implicit provider configuration provider["registry.terraform.io/hashicorp/google"], implied first by data.google_compute_image.coreos_stable
2021/10/25 22:05:53 [DEBUG] ProviderTransformer: "data.google_compute_image.coreos_stable" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/10/25 22:05:53 [DEBUG] ReferenceTransformer: "data.google_compute_image.coreos_stable" references: []
2021/10/25 22:05:53 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/10/25 22:05:53 [DEBUG] Starting graph walk: walkValidate
2021-10-25T22:05:53.131+0100 [INFO]  plugin: configuring client automatic mTLS
2021-10-25T22:05:53.171+0100 [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5]
2021-10-25T22:05:53.180+0100 [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5 pid=65161
2021-10-25T22:05:53.180+0100 [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5
2021-10-25T22:05:53.219+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: configuring server automatic mTLS: timestamp=2021-10-25T22:05:53.218+0100
2021-10-25T22:05:53.262+0100 [DEBUG] plugin.terraform-provider-google_v3.89.0_x5: plugin address: address=/var/folders/b1/dthn83bs2qbcrg38qszm22440000gn/T/plugin268805828 network=unix timestamp=2021-10-25T22:05:53.262+0100
2021-10-25T22:05:53.262+0100 [DEBUG] plugin: using plugin: version=5
2021-10-25T22:05:53.400+0100 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-10-25T22:05:53.404+0100 [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5 pid=65161
2021-10-25T22:05:53.404+0100 [DEBUG] plugin: plugin exited
2021/10/25 22:05:53 [INFO] backend/local: plan calling Plan
2021/10/25 22:05:53 [INFO] terraform: building graph: GraphTypePlan
2021/10/25 22:05:53 [DEBUG] adding implicit provider configuration provider["registry.terraform.io/hashicorp/google"], implied first by data.google_compute_image.coreos_stable (expand)
2021/10/25 22:05:53 [DEBUG] ProviderTransformer: "data.google_compute_image.coreos_stable (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2021/10/25 22:05:53 [DEBUG] ReferenceTransformer: "data.google_compute_image.coreos_stable (expand)" references: []
2021/10/25 22:05:53 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/hashicorp/google\"]" references: []
2021/10/25 22:05:53 [DEBUG] Starting graph walk: walkPlan
2021-10-25T22:05:53.406+0100 [INFO]  plugin: configuring client automatic mTLS
2021-10-25T22:05:53.436+0100 [DEBUG] plugin: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5]
2021-10-25T22:05:53.448+0100 [DEBUG] plugin: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5 pid=65166
2021-10-25T22:05:53.448+0100 [DEBUG] plugin: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5
2021-10-25T22:05:53.477+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: configuring server automatic mTLS: timestamp=2021-10-25T22:05:53.477+0100
2021-10-25T22:05:53.513+0100 [DEBUG] plugin.terraform-provider-google_v3.89.0_x5: plugin address: address=/var/folders/b1/dthn83bs2qbcrg38qszm22440000gn/T/plugin512376069 network=unix timestamp=2021-10-25T22:05:53.513+0100
2021-10-25T22:05:53.513+0100 [DEBUG] plugin: using plugin: version=5
2021-10-25T22:05:53.610+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:53 [INFO] Authenticating using DefaultClient...: timestamp=2021-10-25T22:05:53.610+0100
2021-10-25T22:05:53.610+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:53 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]: timestamp=2021-10-25T22:05:53.610+0100
2021-10-25T22:05:53.610+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:53 [INFO] Authenticating using DefaultClient...: timestamp=2021-10-25T22:05:53.610+0100
2021-10-25T22:05:53.610+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:53 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]: timestamp=2021-10-25T22:05:53.610+0100
2021-10-25T22:05:53.610+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:53 [DEBUG] Waiting for state to become: [success]: timestamp=2021-10-25T22:05:53.610+0100
2021-10-25T22:05:54.251+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:54 [INFO] Terraform is using this identity: REDACTED: timestamp=2021-10-25T22:05:54.251+0100
2021/10/25 22:05:54 [DEBUG] Resource instance state not found for node "data.google_compute_image.coreos_stable", instance data.google_compute_image.coreos_stable
2021/10/25 22:05:54 [DEBUG] ReferenceTransformer: "data.google_compute_image.coreos_stable" references: []
2021-10-25T22:05:54.256+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:54 [DEBUG] Fetching latest non-deprecated image from family coreos-stable: timestamp=2021-10-25T22:05:54.256+0100
2021-10-25T22:05:54.256+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:54 [INFO] Instantiating GCE client for path https://compute.googleapis.com/compute/v1/: timestamp=2021-10-25T22:05:54.256+0100
2021-10-25T22:05:54.257+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:54 [DEBUG] Retry Transport: starting RoundTrip retry loop: timestamp=2021-10-25T22:05:54.256+0100
2021-10-25T22:05:54.257+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:54 [DEBUG] Retry Transport: request attempt 0: timestamp=2021-10-25T22:05:54.257+0100
2021-10-25T22:05:54.257+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:54 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /compute/v1/projects/coreos-cloud/global/images/family/coreos-stable?alt=json&prettyPrint=false HTTP/1.1
Host: compute.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.14.11 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/3.89.0
X-Goog-Api-Client: gl-go/1.16.2 gdcl/20210830
Accept-Encoding: gzip


-----------------------------------------------------: timestamp=2021-10-25T22:05:54.257+0100
2021-10-25T22:05:54.796+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:54 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 404 Not Found
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Mon, 25 Oct 2021 21:05:59 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "error": {
    "code": 404,
    "message": "The resource 'projects/coreos-cloud/global/images/family/coreos-stable' was not found",
    "errors": [
      {
        "message": "The resource 'projects/coreos-cloud/global/images/family/coreos-stable' was not found",
        "domain": "global",
        "reason": "notFound"
      }
    ]
  }
}

-----------------------------------------------------: timestamp=2021-10-25T22:05:54.796+0100
2021-10-25T22:05:54.796+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:54 [DEBUG] Retry Transport: Stopping retries, last request failed with non-retryable error: googleapi: got HTTP response code 404 with body: HTTP/2.0 404 Not Found
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Mon, 25 Oct 2021 21:05:59 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "error": {
    "code": 404,
    "message": "The resource 'projects/coreos-cloud/global/images/family/coreos-stable' was not found",
    "errors": [
      {
        "message": "The resource 'projects/coreos-cloud/global/images/family/coreos-stable' was not found",
        "domain": "global",
        "reason": "notFound"
      }
    ]
  }
}: timestamp=2021-10-25T22:05:54.796+0100
2021-10-25T22:05:54.796+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:54 [DEBUG] Retry Transport: Returning after 1 attempts: timestamp=2021-10-25T22:05:54.796+0100
2021-10-25T22:05:54.797+0100 [INFO]  plugin.terraform-provider-google_v3.89.0_x5: 2021/10/25 22:05:54 [DEBUG] Fetched latest non-deprecated image from family coreos-stable: timestamp=2021-10-25T22:05:54.796+0100
2021/10/25 22:05:54 [INFO] backend/local: plan operation completed

Error: error retrieving image information: googleapi: Error 404: The resource 'projects/coreos-cloud/global/images/family/coreos-stable' was not found, notFound

  on test.tf line 1, in data "google_compute_image" "coreos_stable":
   1: data "google_compute_image" "coreos_stable" {


2021-10-25T22:05:54.801+0100 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-10-25T22:05:54.805+0100 [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/3.89.0/darwin_amd64/terraform-provider-google_v3.89.0_x5 pid=65166
2021-10-25T22:05:54.806+0100 [DEBUG] plugin: plugin exited
 REDACTED  MCW0CDP3YY  ~  Desktop  Git  magic-modules  test   subnetwork-doc-fix  1+  13⚑  ERROR  $   cat test.tf 
data "google_compute_image" "coreos_stable" {
  family  = "coreos-stable"
  project = "coreos-cloud"
}

modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Apr 10, 2024
…ashicorp#10401)

[upstream:c1e30ed89595203b0b2bf597b7f1cd597eed17e5]

Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit that referenced this issue Apr 10, 2024
…10401) (#17815)

[upstream:c1e30ed89595203b0b2bf597b7f1cd597eed17e5]

Signed-off-by: Modular Magician <magic-modules@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants