-
Notifications
You must be signed in to change notification settings - Fork 137
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
Adds ruxitagentproc.conf update mechanism for CSI driver #366
Conversation
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.
Please pay attention to consistent naming. Different terms are used throughout the code: Ruxit
, RuxitConf
, and RuxitProc
. We agreed to call the API endpoint processmoduleconfig
. Therefore it seems logical to use the same term for the variables here as well: ProcessModuleConfig
conf/update.go
Outdated
|
||
// ConfMap is the representation of a config file with sections that are divided by headers (map[header] == section) | ||
// each section consists of key value pairs. | ||
type ConfMap map[string]map[string]string |
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.
Seems like this is the process module configuration. Why not name it like that?
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.
so I renamed stuff to ProcessModuleConfig
, but left the ConfMap
the same because I renamed the package to processmoduleconfig
and naming it processmoduleconfig.ProcessModuleConfig
feels very redundant :)
The basic idea is that after the csi driver downloads a oneagent version(zip) then it updates the
ruxitagentproc.conf
file within it according to what the settings on the tenant are.Details:
A new api was/will-be added on the tenant side to get the latest revision of the
ruxitagentproc.conf
file, this file is read on startup by the standalone agent to do its magic.The csi driver uses this api to get the revision and store it in the tenants directory for use when a new agent version is downloaded. The csi driver also periodically checks for newer revisions, and if there is one then it updates the latest downloaded versions
ruxitagentproc.conf
file again.To make multiple updates on a single version simple, during the initial update it makes a copy of the
ruxitagentproc.conf
next to it with the name_ruxitagentproc.conf
, so it uses_ruxitagentproc.conf
as the base for creating the latestruxitagentproc.conf
. This can be done because in case of a new revision we get all the information again and not thestuff that changed from the previous revision
.So the following is implemented:
dtclient
is able to query the new endpoint for the latestruxitagentproc.conf
revisionruxitagentproc.conf
file.TODO:In the beginning I added a new (simple) database table to keep track which revision is cached for a given tenant, this is probably unnecessary so I will look into just removing it.