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

feat: migrate to use tofu #969

Merged
merged 11 commits into from
Mar 19, 2024
Merged

feat: migrate to use tofu #969

merged 11 commits into from
Mar 19, 2024

Conversation

pivotal-marcela-campo
Copy link
Member

Checklist:

  • Have you added or updated tests to validate the changed functionality?
    * [ ] Have you added Release Notes in the docs repositories?
  • Have you followed the Conventional Commits specification?

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/187247378

The labels on this github issue will be updated when the story is started.

@pivotal-marcela-campo pivotal-marcela-campo changed the title Migrate tofu feat: migrate to use tofu Mar 15, 2024
Copy link
Member

@blgm blgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. There are a couple of additional things to highlight.

  • The project is "OpenTofu" and the command is "tofu". Sometimes I see "Tofu" in the code, and I think this should either be a reference to the OpenTofu project, or a reference to the (lowercase) "tofu" command.
  • I don't see any changes to the docs yet

return &manifest.Manifest{}
}

// TODO: can we avoid passing URL template if we change the logic in the packer?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A "TODO" should either be done, or removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, haven't look at that one yet.

}
}

func testManifestTwoTofus() *manifest.Manifest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Go, a function name starting Test... in a ..._test.go file is a test. To avoid confusion, it would be better to rename these functions as fakeManifestTofu() or similar to make it clear that they are test fakes, and not typo'd test functions.

},
TerraformVersions: []manifest.TerraformVersion{
{
Version: version1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version.Must(version.NewVersion("1.6.0")) is safer and also neater

@pivotal-marcela-campo
Copy link
Member Author

This is great. There are a couple of additional things to highlight.

  • The project is "OpenTofu" and the command is "tofu". Sometimes I see "Tofu" in the code, and I think this should either be a reference to the OpenTofu project, or a reference to the (lowercase) "tofu" command.
  • I don't see any changes to the docs yet

There is a separate story for the docs. Indeed the tofu versus Tofu versus OpenTofu is confusing, we did have tf vs Terraform vs terraform before. I tried to be as consistent as I could given the amount of changes. It can definitely be improved but I am leaning towards reviewing after we have it working in the pipelines.

Also changed log messages to mention Tofu instead of terraform

For now we test explicitely passing the URL template for tofu binaries
We'll look into changing the default behaviour later so that it doesn't
need to be specified.

[#187199910](https://www.pivotaltracker.com/story/show/187199910)
Also update all integration tests to use tofu instead of terraform

[#187199910](https://www.pivotaltracker.com/story/show/187199910)
@pivotal-marcela-campo pivotal-marcela-campo marked this pull request as ready for review March 19, 2024 14:32
@pivotal-marcela-campo pivotal-marcela-campo merged commit a8cd4eb into main Mar 19, 2024
8 checks passed
@pivotal-marcela-campo pivotal-marcela-campo deleted the migrate-tofu branch March 19, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants