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

update IsServerless() to use correct Kibana APIs #213

Merged
merged 5 commits into from
Jun 18, 2024

Conversation

fearful-symmetry
Copy link
Contributor

What does this PR do?

closes #181

The initial implementation of Client.IsServerless() was implemented as a hack before we had any kind of API; this updates the method to use the /api/status endpoint that now reports the build type.

You can test this against a "real" Kibana instance like this:

func TestServerlessInt(t *testing.T) {
	conn := Connection{
		URL:    "KIBANA_URL",
		HTTP:   http.DefaultClient,
		APIKey: "BEATS_API_KEY",
	}

	testClient := Client{
		Connection: conn,
	}

	got, err := testClient.KibanaIsServerless()
	require.NoError(t, err)
	require.True(t, got)

}

Why is it important?

The current implementation is broken.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

@fearful-symmetry fearful-symmetry self-assigned this Jun 17, 2024
@fearful-symmetry fearful-symmetry requested a review from a team as a code owner June 17, 2024 20:33
@fearful-symmetry fearful-symmetry requested review from AndersonQ and belimawr and removed request for a team June 17, 2024 20:33
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @fearful-symmetry

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jun 18, 2024
@pierrehilbert pierrehilbert merged commit 5273d99 into elastic:main Jun 18, 2024
5 checks passed
@TinaHeiligers
Copy link

Thanks for handling this @fearful-symmetry !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KibanaIsServerless check causes 400 Bad Request errors on Stateful Kibana
5 participants