open-telemetry/opamp-go

ServerOfferedVersion and ServerOfferedHash are never changed

Closed this issue · 1 comments

As per the documentation

// The version of the package that the Server offered to the Agent. // MUST be set if the installation of the package is initiated by an earlier offer // from the Server to install this package. // // MUST be empty if the Agent has this package but it was installed locally and // was not offered by the Server. // // Note that it is possible for both agent_has_version and server_offered_version // fields to be set and to have different values. This is for example possible if // the Agent already has a version of the package successfully installed, the Server // offers a different version, but the Agent fails to install that version.

but if we look at the code, the ServerOfferedVersion and ServerOfferedHash is only initialized when the status is null and never changes after.

Let's take case when the Client is started for the first time and the PackageStatus is nil, now server has offered a package a1 version v1 and is successful. In This case, agenthasversion and serverofferedversion will the same as v1. IN the next check-in server has provided a v2 version for the package a1, upon successful only the agenthasversion fied is upgraded to v2 but the serverofferedversion still remains at v1(at least this is what I am observing).

Please do look into and clarify be if my understanding is wrong.

Fixed in #246