Skip to content

Commit

Permalink
feat(config): add noSchematicValidate to skip schematic validation
Browse files Browse the repository at this point in the history
Signed-off-by: budimanjojo <budimanjojo@gmail.com>
  • Loading branch information
budimanjojo committed Jul 15, 2024
1 parent a2d802c commit 415b0d8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
25 changes: 17 additions & 8 deletions docs/docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,17 +497,26 @@ disableSearchDomain: true
</tr>

<tr markdown="1">
<td markdown="1">`machineDisks`</td>
<td markdown="1">[][MachineDisk](#machinedisk)</td>
<td markdown="1">List of additional disks to partition, format, mount.<details><summary>*Show example*</summary>
<td markdown="1">`noSchematicValidate`</td>
<td markdown="1">bool</td>
<td markdown="1">Whether to skip schematic validation.<details><summary>*Show example*</summary>
```yaml
machineDisks:
- device: /dev/disk/by-id/ata-CT500MX500SSD1_2149E5EC1D9D
partitions:
- mountpoint: /var/mnt/sata
noSchematicValidate: true
```
</summary></td>
<td markdown="1" align="center">`[]`</td>
<td markdown="1" align="center">`false`</td>
<td markdown="1" align="center">:negative_squared_cross_mark:</td>
</tr>

<tr markdown="1">
<td markdown="1">`disableSearchDomain`</td>
<td markdown="1">bool</td>
<td markdown="1">Whether to disable generating default search domain.<details><summary>*Show example*</summary>
```yaml
disableSearchDomain: true
```
</summary></td>
<td markdown="1" align="center">`false`</td>
<td markdown="1" align="center">:negative_squared_cross_mark:</td>
</tr>

Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type NodeConfigs struct {
ExtraManifests []string `yaml:"extraManifests,omitempty" jsonschema:"description=List of manifest files to be added to the node"`
Patches []string `yaml:"patches,omitempty" jsonschema:"description=Patches to be applied to the node"`
TalosImageURL string `yaml:"talosImageURL" jsonschema:"example=factory.talos.dev/installer/e9c7ef96884d4fbc8c0a1304ccca4bb0287d766a8b4125997cb9dbe84262144e,description=Talos installer image url for the node"`
NoSchematicValidate bool `yaml:"noSchematicValidate" jsonschema:"description=Whether to skip schematic validation"`
Schematic *schematic.Schematic `yaml:"schematic,omitempty" jsonschema:"description=Talos image customization to be used in the installer image"`
MachineSpec MachineSpec `yaml:"machineSpec,omitempty" jsonschema:"description=Machine hardware specification"`
IngressFirewall *IngressFirewall `yaml:"ingressFirewall,omitempty" jsonschema:"description=Machine firewall specification"`
Expand Down
3 changes: 2 additions & 1 deletion pkg/config/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func (c TalhelperConfig) Validate() (Errors, Warnings) {
checkNodeTaints(node, k, &result)
checkNodeMachineDisks(node, k, &result)
checkNodeMachineFiles(node, k, &result)
if c.GetImageFactory().RegistryURL == "factory.talos.dev" {
if c.GetImageFactory().RegistryURL == "factory.talos.dev" && !node.NoSchematicValidate {
slog.Debug(fmt.Sprintf("validating schematic with official Talos schematic for node %s", node.Hostname))
checkNodeSchematic(node, k, c.GetTalosVersion(), &result)
}
checkNodeNameServers(node, k, &result)
Expand Down

0 comments on commit 415b0d8

Please sign in to comment.