Skip to content

vulnerability-alerts 404 #716

@czerasz

Description

@czerasz

Terraform Version

$ terraform -v
Terraform v0.14.5
+ provider registry.terraform.io/integrations/github v4.5.0

Your version of Terraform is out of date! The latest version
is 0.14.7. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

  • github_repository

Terraform Configuration Files

../../modules/tf-repo/main.tf (pseudo code):

resource "github_repository" "this" {
  name        = var.name
  description = var.description

  ...
  vulnerability_alerts = null
}

.terraform.lock.hcl:

# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.

provider "registry.terraform.io/integrations/github" {
  version     = "4.5.0"
  constraints = "4.5.0"
  hashes = [
    "h1:KjMtn8N07rakB/oAwEFlmDd6YhJ5fentdjpF7A0fB3c=",
    "zh:22cb80695782a750ab8dd61357ed92a3ec3260b3cad15b3ed5cbb5371d1190eb",
    "zh:290b3d2b50df075835ff5dba2d02bf834576c9bb20555f715863c68e5ba2b482",
    "zh:31a0f119c5f384771706ddfb89f51c6a66ede1eab0091b19b39de5686c6189d3",
    "zh:393d3f4010c564aa0828082ec64ca014122cbb798fa28a2219d457e37378e300",
    "zh:4e278b74977c7b2eb5805ad549692970fd06546bf92c44d40991d73bc6107221",
    "zh:5762e3b7b23ae10537054513aadcc4ac6abc30a5e38464d15267510564e2ebb4",
    "zh:6fbf45fdb7c8246caccbf2988f7fa0a20a8c8a7bb660a9740d0f5345da5d024f",
    "zh:7f920eac133683763806ecafca2ac8916883368157ad5d1fef4266383ae5170b",
    "zh:c4d812f681f8b842c709deca79b44965a7688da96a1a0437c1d605135d9ea510",
    "zh:c928cb0ef5f2cae8e3e2c4253275ba9708003f768eed878debf7addd38127297",
    "zh:ce4064e833a4d26a7b9d46e438484a9fd1e28f15f3fc7b64b8cd6d39970a875e",
  ]
}

Debug Output

Panic Output

Expected Behavior

If the GHE instance doesn't support vulnerability-alerts end-point and vulnerability_alerts = null or vulnerability_alerts = false then the provider should not panic when 404 is returned by the API.

Actual Behavior

  • repository got created
  • error thrown
    Error: DELETE https://<BASE URL>.io/api/v3/repos/<ORG NAME>/<REPO NAME>/vulnerability-alerts: 404 Not Found []
    
      on ../../modules/tf-repo/main.tf line 1, in resource "github_repository" "this":
      1: resource "github_repository" "this" {
    
  • other resources from the module were not created

Steps to Reproduce

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

  1. terraform apply

Important Factoids

References

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