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: set cnset status replicas to cloneset ready replicas #433

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

loveRhythm1990
Copy link
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes # https://github.com/matrixorigin/MO-Cloud/issues/1321

What this PR does / why we need it:

only when cn pod ready, the cluster ready condition should be true

Special notes for your reviewer:

There are two ways to fix this probelm:

  1. the simple one, let cn.status.replicas mean the ready replicas, not the total replicas, that is what this pr does. also in unit-agent, field cn.status.replicas means the ready replicas.
  2. the complex one, add another cn.status.readyReplicas field to indicate ready replicas

Additional documentation (e.g. design docs, usage docs, etc.):

in openkruise cloneset the field cs.Status.Replicas means the total replicas

@@ -118,7 +118,7 @@ func (c *Actor) Observe(ctx *recon.Context[*v1alpha1.CNSet]) (recon.Action[*v1al
})
}
cn.Status.Stores = stores
cn.Status.Replicas = cs.Status.Replicas
cn.Status.Replicas = cs.Status.ReadyReplicas
Copy link
Contributor

Choose a reason for hiding this comment

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

we need add a ReadyReplicas field since Replicas is for autoscaler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

@aylei aylei left a comment

Choose a reason for hiding this comment

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

lgtm

@aylei aylei merged commit 147a3b2 into matrixorigin:main Sep 20, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants