-
Notifications
You must be signed in to change notification settings - Fork 61
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
Tfenv support #82
Tfenv support #82
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for this contribution.
Overall looks like a great addition; I've left a couple of comments.
@@ -568,7 +568,7 @@ func TestConnect(t *testing.T) { | |||
}, | |||
usage: resource.TrackerFn(func(_ context.Context, _ resource.Managed) error { return nil }), | |||
fs: afero.Afero{Fs: afero.NewMemMapFs()}, | |||
terraform: func(_ string) tfclient { | |||
terraform: func(_ string, _ ...string) tfclient { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a dedicated test that would check the environment propagation?
&& chmod +x /usr/local/bin/terraform \ | ||
RUN git clone https://github.com/tfutils/tfenv.git /opt/tfenv \ | ||
&& ln -s /opt/tfenv/bin/* /usr/local/bin \ | ||
&& tfenv use 1.3.7 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it intentional we use this exact hardcoded version here?
At this point in time, we will not allow overriding the Terraform binary with the possibility of one released after 1.5.x as they are released under the BSL license. This provider would violate the license terms, and we do not want to open the possibility for that even if the action was taken by a user of the provider. |
Description of your changes
Adds support for
tfenv
. The addition oftfenv
allows a user to optionally decouple the version of Terraform from the provider image, if we choose or need to do so. If left alone, the previous behavior is preserved (you get the version which ships with the image)This allows flexibility in that: we can choose the version of Terraform, and the version of the provider independently, should we choose to do so.
Decoupling of versions: The Terraform Interface is "relatively" stable now -
tfenv
would allow us to no longer require a specific version of the provider if we want to use a newer/older version of Terraform in my environment. HC decoupled the execution layer (TF) from the control layer very long ago and it dramatically improved the developer experience and the speed of development.Enterprise requirements: we test our TF code & modules against specific versions of Terraform and specific versions of TF providers, we want to ensure that we can implement these requirements on the execution layer (Crossplane TF provider).
@DanielRis