fix: do not fail cluster create when input dir does not contain talosconfig

As `--input-dir` flag now supports partial configs, it should not fail when there is no talosconfig in the directory.

This was the missing part in .

Additionally, allow the `--cidr` flag when `--input-dir` is used - it is used even when the input configs are provided.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
This commit is contained in:
Utku Ozdemir 2024-03-06 11:39:29 +03:00
parent 1ec6683e0c
commit f02aeec922
No known key found for this signature in database
GPG Key ID: 65933E76F0549B0D
2 changed files with 5 additions and 2 deletions
cmd/talosctl/cmd/mgmt/cluster
pkg/machinery/config/bundle

@ -1169,7 +1169,6 @@ func checkForDefinedGenFlag(flags *pflag.FlagSet) string {
networkIPv4Flag,
networkIPv6Flag,
networkMTUFlag,
networkCIDRFlag,
nameserversFlag,
clusterDiskSizeFlag,
clusterDisksFlag,

@ -85,6 +85,10 @@ func NewBundle(opts ...Option) (*Bundle, error) {
// Pull existing talosconfig
talosConfig, err := os.Open(filepath.Join(options.ExistingConfigs, "talosconfig"))
if os.IsNotExist(err) { // talosconfig is optional
return bundle, nil
}
if err != nil {
return bundle, err
}