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

Include elastic-api-version header in Kibana requests #1526

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Oct 27, 2023

Installing zips seems to require elastic-api-version header starting on Kibana 8.12.

@jsoriano jsoriano requested a review from a team October 27, 2023 18:00
@jsoriano jsoriano self-assigned this Oct 27, 2023
@jsoriano
Copy link
Member Author

test integrations

@jsoriano jsoriano marked this pull request as ready for review October 27, 2023 18:06
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @jsoriano

@mrodm
Copy link
Contributor

mrodm commented Oct 30, 2023

Latest comment to test integrations didn't trigger the build because of this error:

go.mod:206: replace github.com/jsoriano/elastic-package: version "b55f0d6933bf71c5fa4d22f6a4137cc5f9cd3119" invalid: unknown revision b55f0d6

Running this again

@mrodm
Copy link
Contributor

mrodm commented Oct 30, 2023

test integrations

@elasticmachine
Copy link
Collaborator

Created or updated PR in integrations repostiory to test this vesrion. Check elastic/integrations#8328

@@ -41,6 +41,7 @@ func (c *Client) InstallZipPackage(zipFile string) ([]packages.Asset, error) {
return nil, err
}
req.Header.Set("Content-Type", "application/zip")
req.Header.Add("elastic-api-version", "2023-10-31")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this header be added for all other requests performed by elastic-package (dashboards, status...)?

Maybe, it can be added (or moved?) here for all of them:

req.Header.Add("kbn-xsrf", install.DefaultStackVersion)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure, it only seems to be required here, maybe this API has been GA'ed on this version?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. I guess we could keep it here, and move it to the newRequest() function if there are new other API requests failing with the same error.

@@ -41,6 +41,7 @@ func (c *Client) InstallZipPackage(zipFile string) ([]packages.Asset, error) {
return nil, err
}
req.Header.Set("Content-Type", "application/zip")
req.Header.Add("elastic-api-version", "2023-10-31")
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. I guess we could keep it here, and move it to the newRequest() function if there are new other API requests failing with the same error.

@jsoriano jsoriano merged commit a5b1356 into elastic:main Nov 2, 2023
4 checks passed
@jsoriano jsoriano deleted the elastic-api-version-header branch November 2, 2023 11:03
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