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 support for Events in k8s module #1297

Merged
merged 2 commits into from
Jun 29, 2023

Conversation

kaisoz
Copy link
Contributor

@kaisoz kaisoz commented May 24, 2023

Description

This PR adds support for k8s Events as stated in #1296

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backwards incompatible, include a migration guide.

Release Notes (draft)

  • Added Event functions.

Migration Guide

There aren`t backwards incompatible changes

@kaisoz
Copy link
Contributor Author

kaisoz commented May 24, 2023

This PR currently only adds support for listing events which, in my opinion, is the most used event-related operation. However, please let me know if there are other operations you'd like me to implement 😊

@kaisoz
Copy link
Contributor Author

kaisoz commented Jun 6, 2023

Hi @denis256!

You helped me with other PRs, do you think there's something missing in this one to get it merged?

Thanks!

@kaisoz
Copy link
Contributor Author

kaisoz commented Jun 22, 2023

Hi @zachreborn @denis256 ! Do you think this proposal is worth to be merged?

Thanks!


// ListEvents will retrieve the Events in the given namespace that match the given filters and return them. This will fail the
// test if there is an error.
func ListEvents(t testing.TestingT, options *KubectlOptions, filters metav1.ListOptions) []corev1.Event {
Copy link
Member

Choose a reason for hiding this comment

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

Will be helpful to have tests for ListEvents to track that in the future function will continue to work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your review @denis256 . I've done my tests with kubectl and it turns out that the events API doesn't return an error even if you provide the wrong namespace/filters.

That's why I rewrote the current tests to use the ListEvents function and also added a new test which makes sure that ListEventsE returns a nil error. What do you think?

@kaisoz kaisoz force-pushed the add-k8s-events-support branch 2 times, most recently from 8722211 to c7f46e3 Compare June 28, 2023 21:18
@denis256
Copy link
Member

Failed tests aren't related with implemented changes

@denis256 denis256 merged commit 1bd1d39 into gruntwork-io:master Jun 29, 2023
2 of 3 checks passed
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.

None yet

2 participants