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

Make events cmd work well with lowercased and only kind selector #4409

Merged
merged 1 commit into from Nov 20, 2023

Conversation

somtochiama
Copy link
Member

@somtochiama somtochiama commented Nov 16, 2023

The events cmd didn't return data if the kind in the --for selector was lowercase. This pr fixes that. It also adds validation for the --type and --for flags.

Before

➜  flux2 git:(flux-events) flux events --for alert/webapp    
✗ No events found in flux-system namespace.

Now

 ./bin/flux events --for alert/webapp
LAST SEEN               TYPE    REASON                          OBJECT          MESSAGE                                                                                                                                                 
3h53m                   Warning NotificationDispatchFailed      Alert/webapp    failed to send notification for HelmRepository/flux-system/podinfo: postMessage failed: failed to execute request: context deadline exceeded                   
3h41m                   Warning NotificationDispatchFailed      Alert/webapp    failed to send notification for HelmChart/flux-system/flux-system-flagger: postMessage failed: failed to execute request: context deadline exceeded            
3h2m (x4 over 3h49m)    Warning NotificationDispatchFailed      Alert/webapp    failed to send notification for Kustomization/flux-system/apps: postMessage failed: failed to execute request: context deadline exceeded 

The PR also updates the --for selector now supports specifying only a kind.

 ./bin/flux events --for kustomization --all-namespaces 
NAMESPACE       LAST SEEN       TYPE    REASON                  OBJECT                                  MESSAGE                                                     
flux-system     9h              Normal  ReconciliationSucceeded Kustomization/flux-system               Reconciliation finished in 454.865792ms, next run in 10m0s      
flux-system     9h              Normal  ReconciliationSucceeded Kustomization/flux-system               Reconciliation finished in 519.357167ms, next run in 10m0s      
flux-system     8h              Normal  ReconciliationSucceeded Kustomization/kube-prometheus-stack     Reconciliation finished in 131.935666ms, next run in 1h0m0s     
flux-system     8h              Normal  ReconciliationSucceeded Kustomization/apps                      Reconciliation finished in 77.008625ms, next run in 1h0m0s      

@stefanprodan stefanprodan added the area/monitoring Monitoring related issues and pull requests label Nov 16, 2023
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

cmd/flux/events.go Outdated Show resolved Hide resolved
cmd/flux/events.go Outdated Show resolved Hide resolved
@somtochiama somtochiama changed the title Make events cmd work well with lowercased kinds Make events cmd work well with lowercased and only kind selector Nov 16, 2023
cmd/flux/events.go Outdated Show resolved Hide resolved
cmd/flux/events.go Outdated Show resolved Hide resolved
cmd/flux/events.go Outdated Show resolved Hide resolved
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
@stefanprodan stefanprodan merged commit 4cb89ad into fluxcd:main Nov 20, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/monitoring Monitoring related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants