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

OSD-24997: Show if a user is banned when using osdctl cluster context #671

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

Mhodesty
Copy link
Contributor

@Mhodesty Mhodesty commented Feb 24, 2025

This PR adds output to osdctl cluster context to show if a user is banned. The goal is to cut down on SRE toil time by showing this information at the beginning of the troubleshooting process. Output looks like this

User Ban Details
User is banned
Ban code = pending
Ban description = pending

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 24, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 24, 2025

@Mhodesty: This pull request references OSD-24997 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

In response to this:

This PR adds output to osdctl cluster context to show if a user is banned. The goal is to cut down on SRE toil time by showing this information at the beginning of the troubleshooting process. Output looks like this

>> User Ban Details User is banned Ban code = pending Ban description = pending

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.

@openshift-ci openshift-ci bot requested review from joshbranham and Tafhim February 24, 2025 16:16
Copy link
Contributor

@joshbranham joshbranham left a comment

Choose a reason for hiding this comment

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

Can you post some terminal output of this running with the new output, mostly because this command has zero unit tests and would be good to see it work if we aren't going to add test coverage

@@ -734,6 +759,21 @@ func printDynatraceResources(data *contextData) {
}
}

func printUserBannedStatus(data *contextData) {
var name string = "User Ban Details"
fmt.Println("\n" + delimiter + name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we always using fmt.Println already above? If so this is adding an extra \n between the last printed text and this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi JB.
https://redhat-internal.slack.com/archives/CCX9DB894/p1739809796051329
Here's a thread with the output on a cluster where a user is banned. See Jim's comment from 12:01 Saturday. I've also pasted the output as it shows in the command in the code block below.
This adds an extra \n between "User Ban Details" and "User is banned" or "User is not banned" increasing readability.

>> User Ban Details
User is banned
Ban code = pending
Ban description = pending

Copy link
Contributor

Choose a reason for hiding this comment

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

I more meant the full command output of osdctl cluster context $CLUSTER_ID to see if there is an extra newline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Here's the output of the osdctl command run on a cluster. I redacted the cluster identifying information but the output looks clean to me.

>> PagerDuty Alerts
Service: [Redacted]
None

>> External resources
CCX dashboard             [Redacted]
OHSS Cards                  [Redacted]
PagerDuty Service        [Redacted]
Splunk Audit Logs         [Redacted]

>> Dynatrace Details
Not an HCP or MC Cluster

>> User Ban Details
User is not banned

Copy link
Contributor

openshift-ci bot commented Feb 24, 2025

@Mhodesty: all tests passed!

Full PR test history. Your PR dashboard.

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link
Contributor

@joshbranham joshbranham left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 24, 2025
Copy link
Contributor

openshift-ci bot commented Feb 24, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joshbranham, Mhodesty

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 12e4598 into openshift:master Feb 24, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants