Copilot commented on code in PR #915:
URL: https://github.com/apache/solr-operator/pull/915#discussion_r4687415764


##########
controllers/common.go:
##########
@@ -46,15 +48,24 @@ func patchResource(ctx context.Context, c client.Client, 
obj client.Object, orig
        return c.Patch(ctx, obj, client.MergeFromWithOptions(orig, 
client.MergeFromWithOptimisticLock{}))
 }
 
+// takenOverLists are the atomic lists that operators before v0.10 took over 
from the applier, by writing them back with
+// the empty fields that the Go types fill in, such as a resources block on 
every container.
+var takenOverLists = []fieldpath.Path{
+       fieldpath.MakePathOrDie("spec", "customSolrKubeOptions", "podOptions", 
"initContainers"),
+       fieldpath.MakePathOrDie("spec", "customSolrKubeOptions", "podOptions", 
"sidecarContainers"),
+       fieldpath.MakePathOrDie("spec", "zookeeperRef", "provided", 
"zookeeperPodPolicy", "initContainers"),
+       fieldpath.MakePathOrDie("spec", "zookeeperRef", "provided", 
"zookeeperPodPolicy", "containers"),

Review Comment:
   These ZooKeeper paths do not match the SolrCloud API: `ZookeeperSpec` 
declares `initContainers` and `containers` directly under 
`spec.zookeeperRef.provided` (`api/v1beta1/solrcloud_types.go:870–876`), not 
under `zookeeperPodPolicy`. Consequently, neither path matches the operator's 
actual field set, so both lists lose their only owner and remain on the object 
when a later apply omits them. Remove the `zookeeperPodPolicy` segment from 
both paths so ZooKeeper lists receive the intended migration.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to