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 committed Mar 16, 2024
1 parent 5a8abf5 commit 4600223
Show file tree
Hide file tree
Showing 38 changed files with 493 additions and 260 deletions.
2 changes: 1 addition & 1 deletion client/api/common/omni.pb.go

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

2 changes: 1 addition & 1 deletion client/api/omni/management/management.pb.go

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

2 changes: 1 addition & 1 deletion client/api/omni/oidc/oidc.pb.go

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

2 changes: 1 addition & 1 deletion client/api/omni/resources/resources.pb.go

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

2 changes: 1 addition & 1 deletion client/api/omni/specs/auth.pb.go

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

2 changes: 1 addition & 1 deletion client/api/omni/specs/ephemeral.pb.go

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

2 changes: 1 addition & 1 deletion client/api/omni/specs/oidc.pb.go

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

130 changes: 66 additions & 64 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.

7 changes: 6 additions & 1 deletion 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
Loading

0 comments on commit 4600223

Please sign in to comment.