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

To detect and show the unsupported conditions on the console banner #2166

Merged
merged 3 commits into from
Feb 10, 2023

Conversation

xiaoyu74
Copy link
Contributor

@xiaoyu74 xiaoyu74 commented Jun 8, 2022

Which issue this PR addresses:

To proactively detect the unsupported conditions of the ARO Cluster and show the notifications on the console banner for the end-user. The detailed description is in the task ADO-7551905

What this PR does / why we need it:

To implement an ARO operator checker to detect "unsupported conditions" and displaying the notifications on the console banner automatically. Then, make the operator marked as upgradable=False.

We haven't considered all the unsupported conditions; this PR will mainly focus on the conditions below:

  • ARO Cluster has less than 3 worker nodes
  • Default route is configured in the Cluster
  • Custom Network Security Group is configured in the Cluster

We will constantly update with more conditions based on the opinions/discussions/suggestions from the team

Test plan for issue:

Testing with an ARO dev cluster to confirm the new checker is working and the notification is shown on the banner as expected.

  • Deploy an ARO dev cluster

  • In your local ARO-RP repo, run the ARO operator locally to test the new ARO checker:
    oc scale -n openshift-azure-operator deployment/aro-operator-master --replicas=0
    CLUSTER=cluster-name go run -tags aro,containers_image_openpgp ./cmd/aro operator master

  • Testing the checker with the first unsupported condition which is too less worker nodes
    oc scale --replicas=<number-of-replicas> machineset/<machineset-name> -n openshift-machine-api
    oc scale --replicas=0 machineset/shawn-dev-mbcp2-worker-australiaeast3 -n openshift-machine-api

  • Then, check if the notification is shown on the cluster console banner as expected. Also, the ARO operator upgradable status is set as "False"

  • Scale up the worker node to 3 or more and the notification should be removed from the banner

Is there any documentation that needs to be updated for this PR?

N/A - This is a new ADO task, and I will document it after the task completed and test passed.

@xiaoyu74 xiaoyu74 changed the title Aro checker controller ARO operator checker to detect the unsupported conditions Jun 8, 2022
@xiaoyu74 xiaoyu74 self-assigned this Jun 8, 2022
@xiaoyu74 xiaoyu74 changed the title ARO operator checker to detect the unsupported conditions [DRAFT] To detect and show the unsupported conditions on the console banner Jun 8, 2022
@xiaoyu74 xiaoyu74 removed their assignment Jun 9, 2022
@github-actions
Copy link

github-actions bot commented Jul 5, 2022

Please rebase pull request.

@github-actions github-actions bot added the needs-rebase branch needs a rebase label Jul 5, 2022
@github-actions github-actions bot removed the needs-rebase branch needs a rebase label Jul 12, 2022
@xiaoyu74 xiaoyu74 force-pushed the aro_checker_controller branch 5 times, most recently from 2c809b7 to 71c3f6f Compare July 13, 2022 22:08
@xiaoyu74 xiaoyu74 marked this pull request as ready for review July 20, 2022 22:08
@xiaoyu74 xiaoyu74 changed the title [DRAFT] To detect and show the unsupported conditions on the console banner To detect and show the unsupported conditions on the console banner Jul 20, 2022
@hawkowl
Copy link
Collaborator

hawkowl commented Jul 25, 2022

@xiaoyu74 I think this is looking good so far.

@facchettos
Copy link
Contributor

facchettos commented Jul 25, 2022

before you spend more time on it, I think we should have a discussion about it with PMs. I had a talk with Jerome regarding some openshift version out-of-support notification and I am afraid what he told me also applies here (that we should only do AZComms). I will start a thread on slack with everyone involved

@SrinivasAtmakuri SrinivasAtmakuri added the skippy pull requests raised by member of Team Skippy label Oct 13, 2022
@xiaoyu74 xiaoyu74 requested review from s-amann and removed request for ross-bryan November 23, 2022 08:59
Copy link
Contributor

@facchettos facchettos left a comment

Choose a reason for hiding this comment

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

A little flow simplification and then it's good for me 🚀

@github-actions github-actions bot added the needs-rebase branch needs a rebase label Dec 13, 2022
@github-actions
Copy link

Please rebase pull request.

@github-actions github-actions bot removed the needs-rebase branch needs a rebase label Jan 10, 2023
Copy link
Contributor

@facchettos facchettos left a comment

Choose a reason for hiding this comment

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

I think I missed something during my last review :(
I think there is a little error in the logic when you create the banner

@facchettos
Copy link
Contributor

there might be a go.mod , or go.sum, or vendor.txt missing from your commit

@xiaoyu74
Copy link
Contributor Author

xiaoyu74 commented Feb 8, 2023

there might be a go.mod , or go.sum, or vendor.txt missing from your commit
@facchettos - Thanks for your feedback, I think I got the same issue discussed here go vendoring errors and it has been fixed.

Copy link
Contributor

@facchettos facchettos left a comment

Choose a reason for hiding this comment

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

🚀


func (ucc *UnsupportedConditionChecker) addConsoleBanner(ctx context.Context, consoleText string) error {
notification, err := ucc.consolecli.ConsoleV1().ConsoleNotifications().Get(ctx, consoleBannerName, metav1.GetOptions{})
if kerrors.IsNotFound(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this control flow is clean and easy to understand, thank you 🚀

@hawkowl hawkowl dismissed stale reviews from darthhexx and SudoBrendan February 10, 2023 04:06

old

@hawkowl hawkowl merged commit 17754ac into Azure:master Feb 10, 2023
@xiaoyu74 xiaoyu74 deleted the aro_checker_controller branch May 4, 2023 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review skippy pull requests raised by member of Team Skippy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants