breaking(terraform-agent): update files for agent host deployment#929
breaking(terraform-agent): update files for agent host deployment#929rene-oromtz wants to merge 16 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #929 +/- ##
=======================================
Coverage 73.85% 73.85%
=======================================
Files 108 108
Lines 10313 10313
Branches 886 886
=======================================
Hits 7617 7617
Misses 2508 2508
Partials 188 188
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
6003d08 to
52cfe91
Compare
agent/terraform/outputs.tf
Outdated
| output "provides" { | ||
| description = "Map of provided integration endpoints" | ||
| value = { | ||
| cos-agent = "cos-agent" |
There was a problem hiding this comment.
I think the intent of this spec was to provide a more terraform-native way of getting these, since terraform I think frowns upon dashes
| cos-agent = "cos-agent" | |
| cos_agent = "cos-agent" |
There was a problem hiding this comment.
Ah you are right: https://developer.hashicorp.com/terraform/language/style#resource-naming
Seems it supports both but guess they preferred the underscores
There was a problem hiding this comment.
Terraform didn't like it :(
# module.agent-host.juju_application.testflinger-agent-host will be destroyed
# (because juju_application.testflinger-agent-host is not in configuration)
- resource "juju_application" "testflinger-agent-host" {
...
This forced a recreation with the new application name:
# module.agent-host.juju_application.testflinger_agent_host will be created
+ resource "juju_application" "testflinger_agent_host" {
...
Plan: 3 to add, 0 to change, 1 to destroy.
Guess that we will need to keep the dashes for backwards compatibility...
There was a problem hiding this comment.
(This is just applicable for the juju_application resource... For all new resources I ended up using snake_case)
|
Hi @nancyc12 @diohe0311 if any of you have time, can anyone please help me to take a look at this PR? Want to get your feedback as this impacts TEL deployments so just want to make sure I'm not missing anything. I tested upgrading between the terraform module testflinger-agent-host-0.1.0 to this proposed version and changes should be non disruptive. |
Hey, I found that |
|
Hey Dio! Yes, I opened this PR to update all Terraform modules to 1.0 version. |
Description
This PR updates the terraform files for agent host to be able to work with authentication.
It also aligns with the standards defined in CC008 specification.
Changes introduced:
README.md: updated to be aligned with the requirements in Spec including variables, inputs and outputs.main.tf: modify file to include required variables, including modifyingmodel_uuidinstead ofmodelname.providers.tf: Empty file just for matching spec requirementsterraform.tf: renamedversions.tftoterraform.tfas required by spec. It also includes the use of "any" Terraform provider in 1.x version as all charm modules should be above 1.0.0 version.output.tf: includedapplicationandprovidesfrom charm application.variables.tf: This includes all the required variables in alphabetical orderlocals.tf: removed as it only included what it should now be covered by theconstraintsvariable.CONTRIBUTING.md: this includes the information that was in theREADME.mdregarding testing locally agent hosts deployment via Terraform. Also adds information about Pull Request requirements for semantic versioning.terraform/devdirectory added as well for simpliying local testing.Note
config map(string) should take care of all charm configuration, in order to keep base64 encoded as sensitive, handling them as separate variables that are then merged to the config var
This also adds a semantic version to follow the proposed lifecycle where the modification should be tagged with:
<product>-X-Y-Z.Semantic test: https://github.com/canonical/testflinger/actions/runs/22318803845/job/64571130324?pr=929
Resolved issues
Resolves CERTTF-837
Documentation
Public documentation already references Terraform
READMEfile:https://canonical-testflinger.readthedocs-hosted.com/latest/how-to/administer-agent-hosts/deploy-testflinger-agent-host/#terraform
Web service API changes
Tests
Tested on a multipass environment. Tagged commit b96e3b6 with version
testflinger-agent-host-0.1.0as this was the last modification to the terraform files.I then tested deploying with version 0.1.0 and upgrading to this branch version. While breaking changes on provider side (
model_uuidinstead ofmodelname), the application is NOT recreated, its updated in place as expected.Full testing:
https://pastebin.canonical.com/p/HwbG4757TM/