-
Notifications
You must be signed in to change notification settings - Fork 768
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
Renaming labels creates new labels. #173
Labels
Type: Bug
Something isn't working as documented
Comments
Would be ideal if there was an authoritative labels resource, using something like the dynamic blocks introduced in 0.12, each block is a label. Any labels not found in the supplied list will be removed. |
shouichi
added a commit
to shouichi/terraform-provider-github
that referenced
this issue
Oct 21, 2019
It would be great to get it fixed given that there are already 2 PRs for that. |
shouichi
added a commit
to shouichi/terraform-provider-github
that referenced
this issue
Mar 3, 2020
shouichi
added a commit
to shouichi/terraform-provider-github
that referenced
this issue
Mar 3, 2020
jcudit
pushed a commit
to terraformtesting/terraform-provider-github
that referenced
this issue
Mar 3, 2020
kfcampbell
pushed a commit
to kfcampbell/terraform-provider-github
that referenced
this issue
Jul 26, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Terraform version: v0.11.8
Provider version: v1.3.0
Problem
It seems like when changing the name property on a label the provider creates a new label with the new name and leaves the old one intact.
Cause
The reason for this is due to the implementation in https://github.com/terraform-providers/terraform-provider-github/blob/master/github/resource_github_issue_label.go.
In
resourceGithubIssueLabelCreateOrUpdate
the following flow is used:Check if
newName
is a label, if it is update it and if it isn't create a new one. The problem here is that the original name is not the one that is checked. So if a label is changed in terraform fromlabel1
andlabel2
, github is searched forlabel2
, which does not exist yet so a new label is created and the oldlabel1
is left behind.Solution
When checking for existence, the original name should be used.
The text was updated successfully, but these errors were encountered: