fix: avoid double append of talos.platform kernel argument

The example configuration generated by talosctl contains

```yaml
extraKernelArgs:
  - talos.platform=metal
```

in the install section, which, if uncommented, causes the installer to append the
`talos.platform` option twice. Thus, if the platform is set/changed here, it will
not be respected. This change allows the existing value to be overridden.

Signed-off-by: Dennis Marttinen <twelho@welho.tech>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
Dennis Marttinen 2022-07-05 10:01:12 +03:00 committed by Andrey Smirnov
parent 27dfe7c035
commit c2a5126088
No known key found for this signature in database
GPG Key ID: 7B26396447AB6DFD

View File

@ -54,7 +54,11 @@ func Install(p runtime.Platform, seq runtime.Sequence, opts *Options) (err error
return err
}
if err = cmdline.AppendAll(opts.ExtraKernelArgs, procfs.WithOverwriteArgs("console")); err != nil {
if err = cmdline.AppendAll(
opts.ExtraKernelArgs,
procfs.WithOverwriteArgs("console"),
procfs.WithOverwriteArgs(constants.KernelParamPlatform),
); err != nil {
return err
}