-
Notifications
You must be signed in to change notification settings - Fork 94
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
🌱 addon consume rollout helpers #225
🌱 addon consume rollout helpers #225
Conversation
cc @qiujian16 |
c2b4cda
to
b8ad457
Compare
b8ad457
to
fa37d3c
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #225 +/- ##
==========================================
+ Coverage 61.03% 61.09% +0.05%
==========================================
Files 128 129 +1
Lines 13719 13752 +33
==========================================
+ Hits 8374 8402 +28
Misses 4579 4579
- Partials 766 771 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
fa37d3c
to
332756d
Compare
36e2ffa
to
6dc54ef
Compare
6dc54ef
to
aa39283
Compare
/hold |
d87ef70
to
aefc37f
Compare
76e70d7
to
1f4e6a8
Compare
1f4e6a8
to
40a001c
Compare
023fd5c
to
08ce150
Compare
08ce150
to
3776d87
Compare
@@ -121,6 +122,13 @@ func (c *addonConfigurationController) sync(ctx context.Context, syncCtx factory | |||
return err | |||
} | |||
|
|||
// snapshot the rollout result before calling reconcile() | |||
// so that all the reconcilers are using the same rollout result | |||
err = graph.getRolloutResult() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it this is snapshot, just call it snapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to generateRolloutResult()
|
||
// get placement | ||
placement, err := c.getPlacement(installProgression.PlacementRef.Name, installProgression.PlacementRef.Namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me this part should be done within adding placementNode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -341,3 +383,11 @@ func desiredConfigsEqual(a, b addonConfigMap) bool { | |||
|
|||
return true | |||
} | |||
|
|||
func initClusters(pdTracker *clusterv1beta1.PlacementDecisionClustersTracker) (sets.Set[string], error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not quite sure why we need this func
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The input pdTracker does not include any clusters, so want to call Get() to fill in the existingScheduledClusterGroups and return the existing clusters. Might need to enhance the PlacementDecisionClustersTracker functions rather than add initClusters() here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this func
placementRef := installProgression.PlacementRef | ||
installConfigReference := installProgression.ConfigReferences | ||
|
||
// init pdTracker clusters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enhance the comment here, it is not quite clear the intention
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove initClusters func and add comments // refresh and get existing decision clusters
for _, addon := range n.children { | ||
if desiredConfigsEqual(addon.desiredConfigs, n.desiredConfigs) && addon.mcaUpgradeStatus == upgraded { | ||
count += 1 | ||
func (n *installStrategyNode) getRolloutResult() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call it getXXX is confusing, since it does not return a result. Commonly such get func should return a result and not change the internal state. You might want to call if generateRolloutResult
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to generateRolloutResult()
e8a812b
to
f40a82e
Compare
bed2c7e
to
a33b4bd
Compare
4cd980a
to
98db014
Compare
/approve would you also check the ut coverage? |
@qiujian16 yes, will add more UT, and another 2 PRs need to merge before merging this one. open-cluster-management-io/api#260 open-cluster-management-io/addon-framework#208 |
f2027dc
to
d1803d5
Compare
Signed-off-by: haoqing0110 <qhao@redhat.com>
d1803d5
to
2463035
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haoqing0110, qiujian16 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 |
/unhold |
c8410bf
into
open-cluster-management-io:main
Summary
Addon consuming rollout helper functions of open-cluster-management-io/api#254. This PR includes the rollout type All, Progressive and PreogresivePerGroup, timeout is not included.
Related issue(s)
#114