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

Init error return #419

Open
zthacker opened this issue Oct 27, 2023 · 0 comments
Open

Init error return #419

zthacker opened this issue Oct 27, 2023 · 0 comments

Comments

@zthacker
Copy link

Hey All,

I couldn't find this answer anywhere, so I'd like to ask here.

Given the following code:

	tf, err := tfexec.NewTerraform("./terraformexample", execPath)
	if err != nil {
		return err
	}

	err = tf.Init(context.Background(), tfexec.Upgrade(true))
	if err != nil {
		return err
	}

I expect tf.Init to return an error as there are no terraform config files in the ./terraformexampole directory. However, this isn't the case.

If I were to run terraform init within that directory, it does error out in reference to not having any terraform config files.

Am I doing anything wrong, or is this expected? My confusion comes from the tf.Init doc:

Init represents the terraform init subcommand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant