-
Notifications
You must be signed in to change notification settings - Fork 225
Ota 1966 b #1382
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
base: main
Are you sure you want to change the base?
Ota 1966 b #1382
Changes from all commits
84fb0d7
8129746
341cb19
c1387a6
4e68884
a1d1840
3d77f7f
6b295ac
c6742ef
b71d5e8
0c789af
5010f3f
907f9ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -182,6 +182,13 @@ func (optr *Operator) syncStatus(ctx context.Context, original, config *configv1 | |||||||||||||||||||||||||||||||||||||
| if klog.V(6).Enabled() { | ||||||||||||||||||||||||||||||||||||||
| klog.Infof("Apply config: %s", cmp.Diff(original, config)) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| if optr.shouldEnableProposalController() { | ||||||||||||||||||||||||||||||||||||||
| if len(config.Status.History) < len(original.Status.History) { | ||||||||||||||||||||||||||||||||||||||
| klog.V(internal.Normal).Infof("Reconciling proposals because ClusterVersion.status.history got pruned") | ||||||||||||||||||||||||||||||||||||||
| // queue optr.proposalController.Sync() to manage proposals | ||||||||||||||||||||||||||||||||||||||
| optr.proposalController.Queue().Add(optr.proposalController.QueueKey()) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+185
to
+191
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential nil dereference when checking pruned history. At Line 186, 💡 Suggested fix if optr.shouldEnableProposalController() {
- if len(config.Status.History) < len(original.Status.History) {
+ originalHistoryLen := 0
+ if original != nil {
+ originalHistoryLen = len(original.Status.History)
+ }
+ if len(config.Status.History) < originalHistoryLen {
klog.V(internal.Normal).Infof("Reconciling proposals because ClusterVersion.status.history got pruned")
// queue optr.proposalController.Sync() to manage proposals
optr.proposalController.Queue().Add(optr.proposalController.QueueKey())
}
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| updated, err := applyClusterVersionStatus(ctx, optr.client.ConfigV1(), config, original) | ||||||||||||||||||||||||||||||||||||||
| optr.rememberLastUpdate(updated) | ||||||||||||||||||||||||||||||||||||||
| return err | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
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.
Swap the ConfigMap callback parameters before prompt lookups break.
pkg/proposal/controller.gocalls this getter as(namespace, name), but this callback interprets the arguments as(name, namespace)and then doesConfigMaps(namespace).Get(name). In practice that inverts the lookup and the proposal controller will fail to fetch its promptConfigMap.🐛 Minimal fix
📝 Committable suggestion
🤖 Prompt for AI Agents