-
Notifications
You must be signed in to change notification settings - Fork 133
SREP-217: Improving filtering on osdctl-cloudtrail command #760
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
SREP-217: Improving filtering on osdctl-cloudtrail command #760
Conversation
|
@evlin-rh: An error was encountered searching for bug SREP-217 on the Jira server at https://issues.redhat.com/. No known errors were detected, please see the full error message for details. Full error message.
You do not have the permission to see the specified issue.: request failed. Please analyze the request body for more details. Status code: 401:
Please contact an administrator to resolve this issue, then request a bug refresh with DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
2308a64 to
ac03f7a
Compare
5501638 to
b69e6a5
Compare
|
/label tide/merge-method-squash |
cmd/cloudtrail/permission-denied.go
Outdated
|
|
||
| func newCmdPermissionDenied() *cobra.Command { | ||
| opts := &permissionDeniedEventsOptions{} | ||
| opts := &permissionDeniedEventsOptions{} //Stores address of struct into opts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems redundant
|
Here's a possible improvement to the CLI flags, which greatly reduces the number of flags needed: $ osdctl cloudtrail write-events --include username=example1 --include username=example2 --exclude resourcetype=example3 This way, you start with two lists, include and exclude, it's straightforward to tell whether the lists have any value in common (which we don't want), and parsing is fairly easy by splitting on the = symbol |
4f5e244 to
a5e8820
Compare
baf01cb to
f1e9230
Compare
|
/lgtm |
|
/retest |
|
/retest |
FIX: permission_denied.go now uses GetEvents()
CLEANUP: Comment and Code Cleanup
ADD: Filters for write-event.go
REFACTOR: Filters.go
CLEANUP: Code Cleanup, Variable Renaming
ADD: Sample code in flags
REFACTOR & FIX: Code cleanup in cloudtrail & filter.go refactored
NEW CODE: Remodel filter function to use lambda for readability
REFACTOR: Refactored Files To Provide Linear Imports
FIX: Issues with go.mod
FEAT: Added ValidateFilters before any time requiring operation are required
REFACTOR: Added filter package
REMOVE: util.go
FEAT: Added functionality to inlcude resource-name & type
This is mainly because permission denied also requires PrintEvent
FIX: testdata go files had issues with imports
REFACTOR: removed event, aws and filter packages to reduce complexity.
FEAT: Added EndTime for --until flag
FEAT: Added --print-format to allow users to specify which fields to print
REFACTOR: Added time.go for --until --after --since flag
DONE: Final Cleanup for SREP-217 & Documentation
|
/retest |
1 similar comment
|
/retest |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: evlin-rh, zmird-r The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@evlin-rh: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
…#760) * SREP-217: Changed cluster-id to id-cluster * ADD: Username Filter for OSDCTL Write Events Still Missing ErrorChecking and Showing errors if no matching username * UPDATE: Added Print Username Not recognized if nothing found * ADD: Events Filter * ADD: Resource Name and Type to PrintEvents * ADD: Resource Type Filters * Update: Resource Type and Name Both Working * REFACTOR: Refactored AWS.go Write-events.go Refactored aws.go to use Case-Switching to prevent duplications of Code Used Slices for Filters * REFACTOR: Created Filter Function Moved Filtering into its own separate function * ADD: Exclusion Filters More said in documentation * ADD: Filter by list and Print out Errors * ADD: Filters with ARN * Test * ADD: Day and Weeks to --since flag FIX: permission_denied.go now uses GetEvents() CLEANUP: Comment and Code Cleanup ADD: Filters for write-event.go REFACTOR: Filters.go CLEANUP: Code Cleanup, Variable Renaming ADD: Sample code in flags REFACTOR & FIX: Code cleanup in cloudtrail & filter.go refactored NEW CODE: Remodel filter function to use lambda for readability REFACTOR: Refactored Files To Provide Linear Imports FIX: Issues with go.mod FEAT: Added ValidateFilters before any time requiring operation are required REFACTOR: Added filter package REMOVE: util.go FEAT: Added functionality to inlcude resource-name & type This is mainly because permission denied also requires PrintEvent FIX: testdata go files had issues with imports REFACTOR: removed event, aws and filter packages to reduce complexity. FEAT: Added EndTime for --until flag FEAT: Added --print-format to allow users to specify which fields to print REFACTOR: Added time.go for --until --after --since flag DONE: Final Cleanup for SREP-217 & Documentation --------- Co-authored-by: openshift-merge-bot[bot] <148852131+openshift-merge-bot[bot]@users.noreply.github.com>
Added additional filters as flags to the osdctl cloudtrail write-events command:
The filters are lists and can be specified as inclusive or exclusive.
Add days and weeks to the --since flag.
Add inclusive and exclusive filters.