-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
provider/bitbucket fork_policy not updated correctly #9529
Comments
I dont get this at all. ╭─cwood@cwood ~/Projects/playground/terraform
╰─♥ terraform apply
bitbucket_repository.test-repository: Creating...
clone_https: "" => "<computed>"
clone_ssh: "" => "<computed>"
fork_policy: "" => "no_forks"
has_issues: "" => "false"
has_wiki: "" => "false"
is_private: "" => "true"
language: "" => "other"
name: "" => "test-repository-3kjh4asdkj"
owner: "" => "colinbits"
scm: "" => "git"
bitbucket_repository.test-repository: Creation complete
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
The state of your infrastructure has been saved to the path
below. This state is required to modify and destroy your
infrastructure, so keep it safe. To inspect the complete state
use the `terraform show` command.
State path: terraform.tfstate
╭─cwood@cwood ~/Projects/playground/terraform
╰─♥ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but
will not be persisted to local or remote state storage.
bitbucket_repository.test-repository: Refreshing state... (ID: colinbits/test-repository-3kjh4asdkj)
No changes. Infrastructure is up-to-date. This means that Terraform
could not detect any differences between your configuration and
the real physical resources that exist. As a result, Terraform
doesn't need to do anything.
╭─cwood@cwood ~/Projects/playground/terraform
╰─♥ terraform apply
bitbucket_repository.test-repository: Refreshing state... (ID: colinbits/test-repository-3kjh4asdkj)
Apply complete! Resources: 0 added, 0 changed, 0 destroyed. |
This might be a issue with the PUT api. Ill take a look. |
I just talked to our devs and the issue is with is_private and forking_policy. It can only be set on create and can not be updated yet. I can set this to on change to delete and create the repo. |
Apologies for the late reply @cwood and thank you for your patience. I just tried my original code and was indeed unable to reproduce it. I'll chalk it up to a ghost in the machine. That being said, I do see issues with the Setting this to "on change -> delete" seems dangerous (unless I am misunderstanding). I certainly wouldn't want to lose a repo just because I updated a flag in TF. |
The bug is submitted internally, for now, this is more an issue with the bitbucket API then with terraform. The code that handles the fork policy is really just two flags and it will block based on is_private or not. Eg; if you set is_private to False from True it wont allow you to unless the forking policy. Depending on your change bitbucket might allow you through. |
Thanks for the clarification @cwood! Do you have any updates at this point? |
Not super this has been ticketed in our Jira. Ill see if I can poke seomeone on our API team to handle this. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Hi there,
I'm running into a problem with the
bitbucket_repository
resource. It seems remote fields are not correctly updated, even though they are stored in thetfstate
file.This ticket is specific to
fork_policy
, but I've noticed similar issues withis_private
andlanguage
.Terraform Version
Terraform v0.7.7
Affected Resource(s)
Terraform Configuration Files
Note: in the above example,
bitbucket_username
is just the same username used to configure the provider itself.Panic Output
no panic
Expected Behavior
The
fork_policy
should be set on an initial run and then only show up as changed when it actually has changedActual Behavior
The
fork_policy
shows as changed on every run.Steps to Reproduce
terraform apply
terraform apply
will then show that the resource has been updated, again. This shows up as changed resource on every run.Important Factoids
n/a
The text was updated successfully, but these errors were encountered: