-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: compute schematic id only from the extensions #74
Conversation
9fb2b01
to
ffc9a44
Compare
@@ -30,7 +29,7 @@ import ( | |||
type TalosExtensionsController = qtransform.QController[*omni.TalosVersion, *omni.TalosExtensions] | |||
|
|||
// NewTalosExtensionsController instantiates the TalosExtensions controller. | |||
func NewTalosExtensionsController() *TalosExtensionsController { | |||
func NewTalosExtensionsController(imageFactoryClient *imagefactory.Client) *TalosExtensionsController { |
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.
Switch to using the new wrapper, so the only point where we create a new image factory GRPC client is actually in magefactory.Client
@@ -311,7 +311,7 @@ const createSchematic = async () => { | |||
meta_values: {}, | |||
}; | |||
|
|||
if (labels.value) { | |||
if (labels.value && Object.keys(labels.value).length > 0) { |
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.
If no labels were set, we were setting here a YAML with empty content for the labels key. Now we do not set any META information if there are no labels.
internal/backend/runtime/omni/controllers/omni/cluster_machine_config.go
Outdated
Show resolved
Hide resolved
internal/backend/runtime/omni/controllers/omni/cluster_machine_config_status.go
Outdated
Show resolved
Hide resolved
internal/backend/runtime/omni/controllers/omni/internal/talos/schematic.go
Outdated
Show resolved
Hide resolved
ffc9a44
to
4600223
Compare
4600223
to
46771f9
Compare
353b0fe
to
b979005
Compare
When determining the schematic ID of a machine, instead of relying the ID on the schematic ID meta-extension, compute the ID by gathering the extensions on the machine. This way, the extension ID will not contain the META values, labels or the kernel args. This ID is actually the ID we need, as when we compare the desired schematic with the actual one during a Talos upgrade, we are only interested in the changes in the list of extensions. This does not cause the kernel args, labels, etc. to disappear, as they are used at installation time and preserved afterward (e.g., during upgrades). Additionally: - Remove the list of extensions from the `Schematic` resource, as it relied upon the schematics always being created through Omni. This is not always the case - i.e., when a partial join config is used. Therefore, instead of relying on it, we store the list of extensions by directly reading them from the machine and storing them on the `MachineStatus` resource. - Skip setting the schematic META section at all if there are no labels set on Download Installation Media screen. Closes #55. Signed-off-by: Utku Ozdemir <[email protected]>
b979005
to
176f9d9
Compare
/m |
🙏🏻 |
When determining the schematic ID of a machine, instead of relying the ID on the schematic ID meta-extension, compute the ID by gathering the extensions on the machine. This way, the extension ID will not contain the META values, labels or the kernel args.
This ID is actually the ID we need, as when we compare the desired schematic with the actual one during a Talos upgrade, we are only interested in the changes in the list of extensions.
This does not cause the kernel args, labels, etc. to disappear, as they are used at installation time and preserved afterward (e.g., during upgrades).
Additionally:
Schematic
resource, as it relied upon the schematics always being created through Omni. This is not always the case - i.e., when a partial join config is used. Therefore, instead of relying on it, we store the list of extensions by directly reading them from the machine and storing them on theMachineStatus
resource.Closes #55.