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

Credential name doesn't work since 0.9.0 #310

Closed
gboutry opened this issue Sep 12, 2023 · 5 comments · Fixed by #312
Closed

Credential name doesn't work since 0.9.0 #310

gboutry opened this issue Sep 12, 2023 · 5 comments · Fixed by #312
Labels
hint/main going on main branch kind/bug indicates a bug in the project
Milestone

Comments

@gboutry
Copy link
Contributor

gboutry commented Sep 12, 2023

Description

juju_model resource is breaking with value sunbeam-microk8s-creds (valid credentials registered in juju controller)

Urgency

Blocker for our release

Terraform Juju Provider version

0.9.0

Terraform version

1.3.7

Terraform Configuration(s)

https://github.com/canonical/sunbeam-terraform/

Reproduce / Test

Create a machine controller
Add a microk8s cloud to the controller
Reference its credentials in sunbeam-terraform
terraform init
terraform apply

Debug/Panic Output

When applying changes to juju_model.sunbeam, provider                                                                                                                                   
                    "provider[\"registry.terraform.io/juju/juju\"]" produced an unexpected new                                                                                                              
                    value: .credential: was cty.StringVal("sunbeam-microk8s-creds"), but now                                                                                                                
                    cty.StringVal("sunbeam-microk8s/micro1.project.serverstack/sunbeam-microk8s-creds").

Notes & References

This is a regression introduced in 0.9.0.
Deploying with 0.8.0 works fine.

@gboutry gboutry added the kind/bug indicates a bug in the project label Sep 12, 2023
@hmlanigan
Copy link
Member

@gboutry can you please point to where juju_model.sunbeam is defined in the GitHub repo provided.

@gboutry
Copy link
Contributor Author

gboutry commented Sep 12, 2023

@hmlanigan
Copy link
Member

@gboutry my understanding is that sunbeam hardcodes the version of the terraform provider used by pulling it into the snap, please confirm.

@gboutry
Copy link
Contributor Author

gboutry commented Sep 12, 2023

At snap build time, snapcraft will pull the providers respecting the plans' constraints.

We don't set upper constraints on terraform provider and 0.9.0 got pulled in our latest edge.

@gboutry
Copy link
Contributor Author

gboutry commented Sep 13, 2023

This job failed because credentials "" got translated to microk8s/admin/microk8s

Error message:

╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to juju_model.sunbeam, provider
│ "provider[\"registry.terraform.io/juju/juju\"]" produced an unexpected new
│ value: .credential: was cty.StringVal(""), but now
│ cty.StringVal("microk8s/admin/microk8s").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵

javacruft pushed a commit to canonical/sunbeam-terraform that referenced this issue Sep 14, 2023
sunbeam-terraform fails with new versions of
juju terraform provider, see [1]. Pin the
version to 0.8.0 until [1] is fixed and released.

[1] juju/terraform-provider-juju#310

(cherry picked from commit b4aef8e)
javacruft pushed a commit to canonical/snap-openstack that referenced this issue Sep 14, 2023
sunbeam-terraform fails with new versions of
juju terraform provider, see [1]. Pin the
version to 0.8.0 until [1] is fixed and released.

[1] juju/terraform-provider-juju#310

(cherry picked from commit 8231ca1)
@hmlanigan hmlanigan added the hint/main going on main branch label Sep 14, 2023
@hmlanigan hmlanigan added this to the 0.9.1 milestone Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hint/main going on main branch kind/bug indicates a bug in the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants