Skip to content

Conversation

@jsoriano
Copy link
Member

@jsoriano jsoriano commented Mar 5, 2024

Follow up to #1679, to provide contexts to kibana client.

@jsoriano jsoriano self-assigned this Mar 5, 2024
@jsoriano jsoriano changed the title Context all the things kibana Provide contexts to kibana methods Mar 5, 2024
@jsoriano jsoriano marked this pull request as ready for review March 21, 2024 10:46
@jsoriano jsoriano requested a review from a team March 21, 2024 10:46
return result.WithError(fmt.Errorf("can't create the package installer: %w", err))
}
installedPackage, err := packageInstaller.Install()
installedPackage, err := packageInstaller.Install(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add here context.WithoutCancel(ctx) to allow running teardown ?

Currently, it does not deletes the package if it is pressed Ctrl+C during the installation.

2024/03/25 11:06:40 DEBUG Skip validation of the built .zip package
2024/03/25 11:06:40 DEBUG POST https://127.0.0.1:5601/api/fleet/epm/packages
^C2024/03/25 11:06:40  INFO Signal caught!
2024/03/25 11:06:40 ERROR request failed error="Post \"https://127.0.0.1:5601/api/fleet/epm/packages\": context canceled" method=POST url=https://127.0.0.1:5601/api/fleet/epm/packages
interrupted

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in ecd4600, along with the tear down context.

At the end I am only running the tear down if the installation failed by context cancellation, in other cases I think we can assume that the package was not installed.

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @jsoriano

Copy link
Contributor

@mrodm mrodm left a comment

Choose a reason for hiding this comment

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

Nice! 🚀

@jsoriano jsoriano merged commit 62fe1c9 into elastic:main Mar 26, 2024
@jsoriano jsoriano deleted the context-all-the-things-kibana branch March 26, 2024 12:06
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