Skip to content

Commit 176f9d9

Browse files
utkuozdemirUnix4ever
authored andcommitted
feat: compute schematic id only from the extensions
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]>
1 parent 1e4e303 commit 176f9d9

File tree

31 files changed

+506
-261
lines changed

31 files changed

+506
-261
lines changed

client/api/omni/specs/omni.pb.go

Lines changed: 65 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/api/omni/specs/omni.proto

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,17 @@ message MachineStatusSpec {
127127

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

132134
// Invalid marks the machine as having extensions installed bypassing image factory.
133135
// Which makes it impossible to detect schematic id and manage the image generation
134136
// using image factory.
135137
bool invalid = 2;
138+
139+
// Extensions is the list of extensions installed on the machine.
140+
repeated string extensions = 3;
136141
}
137142

138143
message MaintenanceConfig {
@@ -907,7 +912,7 @@ message ImagePullStatusSpec {
907912
// SchematicSpec keeps all schematics generated by Omni.
908913
// For each schematic it keeps information about the list of extensions.
909914
message SchematicSpec {
910-
repeated string extensions = 1;
915+
reserved 1;
911916
}
912917

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

939944
Target target = 2;
940-
}
945+
}

0 commit comments

Comments
 (0)