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

[Fix] wait for the RHOAI/ODH operator CSV to be in state condition Su… #1177

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

jstourac
Copy link
Member

@jstourac jstourac commented Feb 6, 2024

…cceeded

The installation of ODH often failed due to the fact that we tried to apply the DSC on the cluster even before such CRD resource is known to the cluster (that means that operator itself hasn't been installed completely yet). This change should wait for the installation to be prepared for the DSC application. Timeout is set to 2 minutes.


CI: odh/job/autotrigger-smoke/11 for ODH ✅
CI: rhoai/job/autotrigger-smoke/11 for RHOAI ✅

@jstourac jstourac added the enhancements Bugfixes, enhancements, refactoring, ... in tests or libraries (PR will be listed in release-notes) label Feb 6, 2024
Copy link
Contributor

github-actions bot commented Feb 6, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass %
406 0 0 406 100

…cceeded

The installation of ODH often failed due to the fact that we tried to
apply the DSC on the cluster even before such CRD resource is known to
the cluster (that means that operator itself hasn't been installed
completely yet). This change should wait for the installation to be
prepared for the DSC application. Timeout is set to 2 minutes.
Copy link

sonarqubecloud bot commented Feb 7, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@jstourac jstourac marked this pull request as ready for review February 7, 2024 15:49
@jstourac jstourac added the verified This PR has been tested with Jenkins label Feb 7, 2024
Comment on lines +58 to +72
Wait Until Csv Is Ready
[Documentation] Waits some time for given CSV to be in Succeeded status condition
[Arguments] ${csv_name}
Log Waiting for the '${csv_name}' operator CSV in 'Succeeded' status condition console=yes
Wait Until Keyword Succeeds 6 times 20 seconds
... Csv Is Ready ${csv_name}
Log Operator '${csv_name}' CSV is in 'Succeeded' status condition now, let's continue console=yes

Csv Is Ready
[Documentation] Check whether given CSV to be in Succeeded status condition
[Arguments] ${csv_name}
${rc} ${output} = Run And Return Rc And Output
... oc get csv --namespace openshift-operators --output=json | jq --raw-output --exit-status '.items[] | select(.metadata.name | test("${csv_name}")).status.conditions[] | select(.phase == "Succeeded").phase' # robocop: disable:line-too-long
Should Be Equal As Integers ${rc} 0
Should Be Equal As Strings Succeeded ${output}
Copy link
Contributor

Choose a reason for hiding this comment

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

we have kw which check the subscription and looks for AllCatalogSourcesHealthy condition. Isn't it equivalent?

    Wait Until Operator Subscription Last Condition Is
    ...    type=CatalogSourcesUnhealthy    status=False
    ...    reason=AllCatalogSourcesHealthy    subcription_name=${SUBSCRIPTION_NAME}
    ...    namespace=${NAMESPACE}

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, TBH, I'm not really sure what is the proper way here. I saw that the subscription marks CatalogSourcesUnhealthy = false earlier than the CSV sets Succeeded = InstallSucceeded with message install strategy completed with no errors. Thus, I though that better way how to check for this is actually checking CSV status. But maybe I'm wrong here, please point me to some source of truth 🤷

Copy link
Contributor

@bdattoma bdattoma Feb 8, 2024

Choose a reason for hiding this comment

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

hmm I imagine it's a matter of microseconds/seconds? anyways, okay.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, the difference is definitely at least seconds. In case of ODH, it looks like the installation take a bit more time than for RHOAI for some reason, where we didn't hit this issue 🤷

I don't plan to use the other keyword here or this one on other places unless we face an issues, I guess 🙂

Copy link
Contributor

@tarukumar tarukumar left a comment

Choose a reason for hiding this comment

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

/lgtm

@bdattoma bdattoma merged commit 399717b into red-hat-data-services:master Feb 8, 2024
11 checks passed
@jstourac jstourac deleted the waitInstall branch February 8, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancements Bugfixes, enhancements, refactoring, ... in tests or libraries (PR will be listed in release-notes) verified This PR has been tested with Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants