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

argocd_project: adding role fails for existing project #51

Closed
michalformanek opened this issue Jan 27, 2021 · 5 comments · Fixed by #50 or #52
Closed

argocd_project: adding role fails for existing project #51

michalformanek opened this issue Jan 27, 2021 · 5 comments · Fixed by #50 or #52

Comments

@michalformanek
Copy link

It is posible to create roles for new project, however when I try to add role to existing project, I get error:

Error: role 'testrole' does not exist in project 'testproject'

I am using argocd 1.8.2 with provider version 0.4.8

@oboukili
Copy link
Collaborator

Hello @michalformanek, the fix should be included in the next release soon (0.5.0), let me know if that fixes it for you as I could not add acceptance test for this particular flow.

@michalformanek
Copy link
Author

michalformanek commented Jan 28, 2021

Hi @oboukili, we tried latest release and now we are getting different error -

Error: missing expected [

Our resource looks like this:


resource "argocd_project" "project" {
  metadata {
    name      = var.argocd_project_name
    namespace = var.argocd_namespace
    labels = {
      acceptance = "true"
    }
  }

  spec {
    description  = var.argocd_project_description
    source_repos = ["*"]

    destination {
      server    = var.cluster_url
      namespace = var.namespace
    }
  }
}

Are there any breaking changes in latest release, except for the orphaned_resources parameter?

@oboukili
Copy link
Collaborator

There shouldn’t be. Are you using v1.1.0?
Could you run your plan with TF_LOG=debug environment variable and paste the whole error log ?

@michalformanek
Copy link
Author

Ahh, okay, it seems like I just need to clean up my state - after that, everything works flawlessly

Thank you so much for the original fix! 😄

2021-01-28T14:13:00.566+0100 [DEBUG] plugin: plugin exited
2021/01/28 14:13:00 [WARN] UpgradeResourceState: unexpected type cty.Set(cty.Object(map[string]cty.Type{"ignore":cty.Set(cty.Object(map[string]cty.Type{"group":cty.String, "kind":cty.S
tring, "name":cty.String})), "warn":cty.Bool})) for map in json state
2021-01-28T14:13:00.568+0100 [DEBUG] plugin.terraform-provider-argocd_v1.1.0.exe: 2021/01/28 14:13:00 [WARN] unexpected type cty.Set(cty.Object(map[string]cty.Type{"ignore":cty.Set(cty
.Object(map[string]cty.Type{"group":cty.String, "kind":cty.String, "name":cty.String})), "warn":cty.Bool})) for map in json state
2021/01/28 14:13:00 [INFO] backend/local: plan operation completed

@oboukili
Copy link
Collaborator

Thanks for reporting that issue, I will try and make a bugfix release to take care of the schema migration caused by that breaking change. Sorry for the inconvenience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants