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 events configured to watch specific fields #228

Merged
merged 6 commits into from Jan 9, 2020

Conversation

Surbhidongaonkar
Copy link
Contributor

@Surbhidongaonkar Surbhidongaonkar commented Dec 4, 2019

ISSUE TYPE
  • Feature Pull Request
SUMMARY

This commit makes botkube notify about specific field updates. The updates can be in any of the spec, metadata or status.
Botkube should notify about this according to users specifications.

Fixes #203

@Surbhidongaonkar Surbhidongaonkar force-pushed the UpdateFields branch 6 times, most recently from 60fb226 to 0e108c9 Compare Dec 4, 2019
@Surbhidongaonkar
Copy link
Contributor Author

Surbhidongaonkar commented Dec 4, 2019

Fixing the failed checks, Will Update once done.

@Surbhidongaonkar Surbhidongaonkar force-pushed the UpdateFields branch 2 times, most recently from f09a0b9 to afc4fbf Compare Dec 4, 2019
@Surbhidongaonkar
Copy link
Contributor Author

Surbhidongaonkar commented Dec 4, 2019

Fixing the failed checks, Will Update once done.

Fixed by modifying cmp_test.go

@Surbhidongaonkar Surbhidongaonkar force-pushed the UpdateFields branch 2 times, most recently from e438ef5 to 329a7d8 Compare Dec 4, 2019
@Surbhidongaonkar Surbhidongaonkar requested a review from PrasadG193 Dec 5, 2019
@Surbhidongaonkar Surbhidongaonkar force-pushed the UpdateFields branch 2 times, most recently from 2df9857 to 2dc3689 Compare Dec 7, 2019
@Surbhidongaonkar Surbhidongaonkar changed the title update events configured to watch only specific fields update events configured to watch specific fields Dec 9, 2019
@Surbhidongaonkar Surbhidongaonkar force-pushed the UpdateFields branch 4 times, most recently from 0c45e63 to 889dd2a Compare Dec 9, 2019
pkg/controller/controller.go Show resolved Hide resolved
@PrasadG193
Copy link
Collaborator

PrasadG193 commented Dec 18, 2019

@Surbhidongaonkar could you please rebase with develop?

pkg/utils/cmp.go Outdated
if !rs.Equal() {
vx, vy := r.path.Last().Values()
path := fmt.Sprintf("%#v", r.path)
if ok := strings.Contains(path, ".Spec."); ok {
if ok := strings.Contains(path, "."+strings.Title(r.field)); ok {
Copy link
Collaborator

@PrasadG193 PrasadG193 Dec 22, 2019

Choose a reason for hiding this comment

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

I think we should support regex/jsonpath here.
Suppose I am interested only in change in container status of Pod, so I can just set status.containerStatuses[*].ready in updateSetting and that should work.

Copy link
Collaborator

@PrasadG193 PrasadG193 Jan 7, 2020

Choose a reason for hiding this comment

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

I have some working code changes for jsonpath on my local repo. I'll cherry-pick the commits and raise a new PR

Surbhidongaonkar and others added 4 commits Jan 1, 2020
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
@PrasadG193
Copy link
Collaborator

PrasadG193 commented Jan 8, 2020

@Surbhidongaonkar I have pushed few commit. Can you please refactor diff_test.go accordingly?

@PrasadG193
Copy link
Collaborator

PrasadG193 commented Jan 8, 2020

Screenshots:

image

image

image

@Surbhidongaonkar
Copy link
Contributor Author

Surbhidongaonkar commented Jan 8, 2020

@Surbhidongaonkar I have pushed few commit. Can you please refactor diff_test.go accordingly?

sure! Will do.

@Surbhidongaonkar
Copy link
Contributor Author

Surbhidongaonkar commented Jan 9, 2020

@Surbhidongaonkar I have pushed few commit. Can you please refactor diff_test.go accordingly?

Updated diff_test.go.

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
@PrasadG193 PrasadG193 merged commit 20f035a into kubeshop:develop Jan 9, 2020
1 check 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.

Make update events configurable to watch only specific fields
2 participants