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

Add IsCloud() and IsEnterprise() helper methods to client #675

Merged
merged 2 commits into from
Apr 11, 2023

Conversation

sebasslash
Copy link
Contributor

@sebasslash sebasslash commented Apr 6, 2023

Description

These are helper methods that will enable external tools using a go-tfe client to make TFC or TFE-specific decisions. Thus far we haven't had an authoritative, simple way to determine if an instance is TFC or TFE. TFC and future TFE releases will start including a header TFP-AppName which will let us know if the given instance is TFC or TFE. For most users however, they will know beforehand what kind of instance their client is interacting with.

@sebasslash sebasslash requested a review from a team as a code owner April 6, 2023 18:02
@sebasslash sebasslash force-pushed the add-app-name-header branch from 02c8902 to 6088619 Compare April 6, 2023 18:04
nfagerlund
nfagerlund previously approved these changes Apr 6, 2023
Copy link
Member

@nfagerlund nfagerlund left a comment

Choose a reason for hiding this comment

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

I don't have a TFE instance around to trivially test this against, but it works against cloud right now, and the code looks fine. (Though, I can't seem to find where in the TFC code we actually add the header. 😅)

@sebasslash
Copy link
Contributor Author

This header won't be available until the next TFE release and I don't have a way of spinning up a TFE box, I'll just wait for nightly CI. You can find the header in the api/v2 base controller, search for app_name. This change was mostly for determining if an instance was TFC, since not every TFE release includes the TFE version header or the AppName header.

@brandonc brandonc merged commit 2a1107b into main Apr 11, 2023
@brandonc brandonc deleted the add-app-name-header branch April 11, 2023 19:24
@github-actions
Copy link

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

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

Successfully merging this pull request may close these issues.

3 participants