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

Use terraform-runner /live api in Terraform::Runner.available? method #86

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

putmanoj
Copy link
Contributor

@putmanoj putmanoj commented Nov 8, 2024

This is a small change.

  • We have added the Loopback4 Health checks component https://loopback.io/doc/en/lb4/Health.html
  • So now we use the /live api added by the component, in Terraform::Runner.available? method
  • /ping api also will be available.

@agrare
Copy link
Member

agrare commented Nov 8, 2024

@putmanoj will this work with any version of the opentofu-runner or is this API new?

@@ -20,8 +20,10 @@

describe "is .available" do
before do
stub_request(:get, "#{terraform_runner_url}/ping")
.to_return(:status => 200, :body => {'count' => 0}.to_json)
ENV["TERRAFORM_RUNNER_URL"] = "https://1.2.3.4:7000"
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed since we do stub_const("ENV", ENV.to_h.merge("TERRAFORM_RUNNER_URL" => terraform_runner_url)) up on line 11?

@agrare
Copy link
Member

agrare commented Nov 8, 2024

@putmanoj can you squash these 4 commits into 1? I don't normally push for this but this change is so simple I don't think these 4 commits really show any meaningful progress to be preserved in the git history.

@agrare
Copy link
Member

agrare commented Nov 8, 2024

Also can you add a comment in the PR and commit description about why the change the /live vs /ping fixes the issue?

@agrare agrare self-assigned this Nov 8, 2024
@agrare agrare added the enhancement New feature or request label Nov 8, 2024
@agrare
Copy link
Member

agrare commented Nov 13, 2024

cc @putmanoj #86 (comment) and #86 (comment) are still outstanding

@putmanoj putmanoj force-pushed the use-terraform-runner-live-api branch from 0d41bc8 to d876a44 Compare November 15, 2024 15:38
@putmanoj
Copy link
Contributor Author

Done @agrare

@agrare agrare merged commit 07ce648 into ManageIQ:master Nov 15, 2024
4 checks passed
@agrare
Copy link
Member

agrare commented Nov 15, 2024

I'm not going to mark this for backport yet until we confirm that a version of the opentofu-runner will be in the target branch

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

Successfully merging this pull request may close these issues.

2 participants