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

Inconsistence when ibm_container_addons fails and run apply again #2129

Closed
feliperfmarques opened this issue Dec 19, 2020 · 1 comment
Closed

Comments

@feliperfmarques
Copy link

feliperfmarques commented Dec 19, 2020

Hi there,

I percepted an inconsistence when ibm_container_addons fails. Acctually, I have faced many timeout errors with this resource and despite receiving error the addons are installed correctly on cluster, but believe that is about other issue. Anyway, I got timeout error, like this:

Error: Error waiting for Enabling Addon () : timeout while waiting for state to become 'normal, warning, critical, available' (timeout: 20m0s)

  on main.tf line 74, in resource "ibm_container_addons" "iks_1_us_south_addons":
  74: resource "ibm_container_addons" "iks_1_us_south_addons" {

After, when I try to run apply my terraform code again, I got this error:

Error: Request failed with status code: 409, ServerErrorResponse: {"incidentID":"6043f4e89559f69b-GRU","code":"E4d8b","description":"An add-on with the same name already exists. To update your existing add-on to the latest version, see 'http://ibm.biz/addon-update'.","type":"Provisioning"}

  on main.tf line 74, in resource "ibm_container_addons" "iks_1_us_south_addons":
  74: resource "ibm_container_addons" "iks_1_us_south_addons" {

For solve this, I need to remove ibm_container_addons from code, but the addons are not destroyed by terraform. I believe that before apply again or destroy the resource should check if this addon already exists and update terraform state and after run action.

Terraform Version

Terraform v0.13.5
provider registry.terraform.io/ibm-cloud/ibm v1.16.1

Affected Resource(s)

  • ibm_container_addons

Terraform Configuration Files

resource "ibm_container_addons" "iks_1_us_south_addons" {
  depends_on        = [ibm_container_vpc_cluster.iks_1_us_south] 
  cluster           = ibm_container_vpc_cluster.iks_1_us_south.id
  resource_group_id = var.globals.resource_group

  addons {
    name    = "cluster-autoscaler"
    version = "1.0.1"
  }
  addons {
    name    = "alb-oauth-proxy"
    version = "1.0.0"
  }
  addons {
    name    = "istio"
    version = "1.7"
  }
}

Expected Behavior

When ibm_container_addons fails, resource should to be able to run apply code again, installing just addons still not installed and update terraform state, same for destroy action.

Actual Behavior

When ibm_container_addons fails and run apply code again I got error because the resource tries to install addons that have already been installed and If I remove ibm_container_addons from code the apply works fine, but the addons are not destroyed because they are not in the terraform state.

Steps to Reproduce

  1. terraform apply and simulate fails in ibm_container_addons step
  2. terraform apply again
@feliperfmarques feliperfmarques changed the title Inconsistence when ibm_container_addons fails and apply code again Inconsistence when ibm_container_addons fails and run apply again Dec 19, 2020
kavya498 added a commit to kavya498/terraform-provider-ibm that referenced this issue Dec 22, 2020
@feliperfmarques
Copy link
Author

Thanks so much @hkantare and @kavya498 for working on solving this issue 🥳

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

No branches or pull requests

1 participant