Skip to content

Conversation

@strottos
Copy link
Contributor

Also reimplemented the complex sed into go as found a few bugs, e.g. previously it was turning "23.2.3" to "3.2.3" which is obviously not what we wanted. I think the logic is now much more straightforward.

Don't 100% guarantee we're doing the right thing every time but I believe it's at least backwards compatible with before. Added a couple of TODO's in the test for real examples of packages that I wasn't certain about.

@strottos strottos changed the title Feature/upgrade to agent conf server 011 Upgrade to new APIs in agent and configuration service versions 0.1.1 Mar 25, 2025
Remarks: StringAddressed("`dpkg-query -W -f='${Package} ${Version}'` is used to collect the installed packages and their versions."),
})

command := `dpkg-query -W -f='${Package} ${Version}\n'`

Choose a reason for hiding this comment

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

tasty

assert.Equal(t, len(packages), len(packageStrings))

// Check the correct packages are in the map
for expectedPkg, expectedVersion := range map[string]string{

Choose a reason for hiding this comment

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

wow, thorough as hell

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's overkill for sure, I got overexcited 😂

@strottos strottos merged commit c657292 into main Mar 27, 2025
1 check 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.

4 participants