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 flux events command #3628

Merged
merged 6 commits into from
Mar 9, 2023
Merged

Add flux events command #3628

merged 6 commits into from
Mar 9, 2023

Conversation

somtochiama
Copy link
Member

This pull request closes #3618

$ flux events
LAST SEEN               TYPE    REASON                  OBJECT                          MESSAGE                                                                                                       
60m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.51342644s, next run in 10m0s                                                    
53m (x20 over 19h)      Normal  ArtifactUpToDate        HelmChart/flux-system-ww-gitops artifact up-to-date with remote revision: '4.0.14'                                                           
50m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.568797687s, next run in 10m0s                                                   
40m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.521790217s, next run in 10m0s                                                   
30m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.634660693s, next run in 10m0s                                                   
20m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.52127281s, next run in 10m0s                                                    
10m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.628969204s, next run in 10m0s                                                   
3m30s (x120 over 19h)   Normal  Succeeded               Provider/slack                  Reconciliation finished, next run in 10m0s                                                                   
3m8s (x240 over 19h)    Normal  info                    ImagePolicy/podinfo-acr         Latest image tag for 'asia-southeast1-docker.pkg.dev/dx-somtoxhi/podinfo/podinfo' resolved to: v6.0.1        
2m31s (x328 over 19h)   Warning error                   ImagePolicy/podinfo             Cannot determine latest tag for policy: unable to determine latest version from provided list                
2m30s (x923 over 15h)   Normal  GitOperationSucceeded   GitRepository/flux-system       no changes since last reconcilation: observed revision 'main@sha1:3d86db5afdf2adacd4feb5fb95e8866be5517482'  
91s (x596 over 19h)     Normal  GitOperationSucceeded   GitRepository/podinfo           no changes since last reconcilation: observed revision 'master@sha1:1abc44f0d8dd6cd9df76090ea4ad694b70e03ee4'
15s                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.519954174s, next run in 10m0s 

Filter by resource

$ flux events --for Kustomization/flux-system
LAST SEEN               TYPE    REASON                  OBJECT                          MESSAGE                                                                                                     
51m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.568797687s, next run in 10m0s                                                  
41m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.521790217s, next run in 10m0s                                                  
31m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.634660693s, next run in 10m0s                                                  
21m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.52127281s, next run in 10m0s                                                   
11m                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.628969204s, next run in 10m0s                                                  
3m31s (x923 over 15h)   Normal  GitOperationSucceeded   GitRepository/flux-system       no changes since last reconcilation: observed revision 'main@sha1:3d86db5afdf2adacd4feb5fb95e8866be5517482' 
76s                     Normal  ReconciliationSucceeded Kustomization/flux-system       Reconciliation finished in 1.519954174s, next run in 10m0s 

@hiddeco hiddeco self-requested a review February 23, 2023 18:44
@somtochiama somtochiama marked this pull request as ready for review February 27, 2023 02:48
@kingdonb
Copy link
Member

kingdonb commented Mar 2, 2023

I have a local copy of this now and will try it out for a couple days 👍

@stefanprodan stefanprodan added enhancement New feature or request area/UX labels Mar 9, 2023
@hiddeco hiddeco changed the title Add events cmd Add flux events command Mar 9, 2023
@hiddeco hiddeco force-pushed the flux-events-cmd branch 4 times, most recently from 765893b to 03e1fd8 Compare March 9, 2023 13:01
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @somtochiama and @hiddeco

@hiddeco hiddeco force-pushed the flux-events-cmd branch 4 times, most recently from 951071d to f99f5d2 Compare March 9, 2023 13:31
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Did some tidying to improve UX and solved an issue with the routines which caused the process to hang on certain systems with very fast CPUs.

Also tried to improve the way kinds are mapped, but I think it would be better in the future to separate GVK mapping from relational stuff by using the core Kubernetes packages which are available for this, as this would also allow to resolve short hands, etc. Plus reduce the maintenance effort of things that do not have other "relational" stuff attached to them.

See my individual commits to get a better idea of this.

However, this seems to work decent enough for initial introduction for now. Thank you @somtochiama. 🙇

somtochiama and others added 6 commits March 9, 2023 14:41
This adds a command to Flux which behaves similarly as `kubectl events`,
including the Flux sources events when showing events for top level
objects, thus making debugging easy for Flux users.

For example, `flux events --for kustomization/<name>` includes the
events of its source (e.g. a `GitRepository`, `OCIRepository` or
`Bucket`).

In addition, `flux events --for helmrelease/<name>` includes events of
the `HelmChart` and `HelmRepository`. While `flux events --for
alerts/<name>` includes the events of the `Provider`.

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement flux events command
4 participants