Skip to content

Commit

Permalink
feat: compute schematic id only from the extensions
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
utkuozdemir authored and Unix4ever committed Mar 21, 2024
1 parent 1e4e303 commit 353b0fe
Show file tree
Hide file tree
Showing 29 changed files with 499 additions and 259 deletions.
128 changes: 65 additions & 63 deletions client/api/omni/specs/omni.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions client/api/omni/specs/omni.proto
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,17 @@ message MachineStatusSpec {

message Schematic {
// Id is the image factory schematic id used for the image generation.
//
// This must be be plain id computed solely from the system extensions, not including the kernel command line arguments, META content etc.
string id = 1;

// Invalid marks the machine as having extensions installed bypassing image factory.
// Which makes it impossible to detect schematic id and manage the image generation
// using image factory.
bool invalid = 2;

// Extensions is the list of extensions installed on the machine.
repeated string extensions = 3;
}

message MaintenanceConfig {
Expand Down Expand Up @@ -907,7 +912,7 @@ message ImagePullStatusSpec {
// SchematicSpec keeps all schematics generated by Omni.
// For each schematic it keeps information about the list of extensions.
message SchematicSpec {
repeated string extensions = 1;
reserved 1;
}

// TalosExtensionsSpec represents all available extensions for a particular Talos version.
Expand Down Expand Up @@ -937,4 +942,4 @@ message SchematicConfigurationSpec {
string schematic_id = 1;

Target target = 2;
}
}
Loading

0 comments on commit 353b0fe

Please sign in to comment.