Vu Dinh
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
--- title: Operator Condition Improvement authors: - "@dinhxuanvu" reviewers: - "@ecordell" approvers: - "@ecordell" creation-date: 2021-05-05 last-updated: 2021-05-05 status: provisional --- # Operator Condition Improvement ## Release Signoff Checklist - [ ] Enhancement is `implementable` - [ ] Design details are appropriately documented from clear requirements - [ ] Test plan is defined - [ ] Graduation criteria for dev preview, tech preview, GA ## Summary There is a potential race condition for the `Upgradeable` condition in OperatorCondition due to lacking of version control. ## Bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1927340 ## Motivation ### Problems with Current Operator Condition Currently, operator is pushing changes to OperatorCondition's status to signal its `Upgradeable` condition and OLM is reading the status to determine if the operator is upgradeable. However, there is no mechanism for operator and OLM to acknowledge their actions. For example, operator is unable to know if OLM has read its Upgradeable condition or OLM is unable to know if this current Upgradeable condition is up-to-date or not. This leads to a potential race condition where the operator sets the deployment pod ready or OLM allows the upgrade to succeed prematurely. ## Proposal ### Technical Background - Operator is currently expected to update `Upgradeable` condition to OperatorCondition's `status` to signal its condition during upgrade. - By default, the `Upgradeable` condition is not set in the OperatorCondition's status which indicates the upgrade can happen freely. - OLM (olm-operator) will allow the upgrade to succeed (moving CSV's status from `Pending` to `Succeeded`) if `Upgradeable` condition is set to `True`. - Admin can set `Upgradeable` overrides in OperatorCondition's `spec` to supersede the `Upgradeable` condition in the `status`. ### Proposed Changes OperatorCondition can use the `generation` and `observedCondition` mechanism to create feedback loop and version control for both operator and OLM to keep track of condition changes and acknowleage each other's action. Object's `generation` in `metadata` is automatically incremented when the spec is updated but not the status. The `conditions` array will be added to OperatorCondition's spec and operator is now expected to only update the `conditions` in the spec to reflect its condition and no longer push changes to OperatorCondition's status. As the spec is updated, the `generation` is incremented and OperatorCondition's controller will watch and acknowledge the changes by updating the OperatorCondition's status with `observedGeneration` to match the current `generation`. The operator can read the OperatorCondition's status and check `observedGeneration` and compare with the recorded `generation`/`observedGeneration` that it has set previously in the spec to determine if OLM has reconciled the OperatorCondition's conditions. ``` apiVersion: operators.coreos.com/v1 kind: OperatorCondition metadata: generation: 2 spec: conditions: - lastTransitionTime: "2021-05-05T16:56:44Z" lastUpdateTime: "2021-05-05T16:56:44Z" message: The operator is not ready reason: The operator is not upgradeable status: "False" observedGeneration: 1 type: Upgradeable status: conditions: - lastTransitionTime: "2021-05-05T16:56:50Z" lastUpdateTime: "2021-05-05T16:56:50" message: The operator is not ready reason: The operator is not upgradeable status: "False" observedGeneration: 2 type: Upgradeable ``` Here is an example of the flow. 0. Operator pod does not report ready. The OperatorCondition object is created by the controller with generation = `1` for the operator. 1. Operator sets `Upgradeable` condition in the spec to `False`, increments generation to `2`. Ideally, the operator should set `observedGeneration` in the condition in the spec to the current `generation` that it has read which is `1`. In this way, when it reads the object again it can compare the `observedGeneration` in the spec and status. 2. OLM sees the `Upgradeable` to `False` spec change, and sets `Upgradeable` to `False` in the status along with `status.observedGeneration` to `2`. 3. The operator sees that `observedGeneration` is now `2`, which is >= what the operator set in step (1). It knows OLM has seen `Upgradeable=False` and realizes it’s now safe to report the pod as ready. 4. The operator sets `spec.conditions.Upgradeable` to `True` and OLM will reconcile this change to the OperatorCondition's status. 5. Finally, OLM (olm-operator) will pick this status and switch CSV status from `Pending` to `Succeeded`. Note that, OLM will not take action in term of moving CSV's status if `generation` =! `observedGeneration`. ## Actionable Items 1. Update OperatorCondition's CRD to add the `conditions` to the spec - https://github.com/operator-framework/api/pull/119 - https://github.com/operator-framework/operator-lifecycle-manager/pull/2160 3. Publish a document to present the workflow on how to use OperatoCondition properly 4. Backport this to OCP 4.7 (which is when OperatorConditon is first introduced)

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully