diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go index 0955e64cb5..860e1a2e85 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go @@ -51,7 +51,7 @@ func (m *Metal) Configuration(ctx context.Context, r state.State) ([]byte, error getURL := func() string { downloadEndpoint, err := PopulateURLParameters(ctx, *option, r) if err != nil { - log.Fatalf("failed to populate talos.config fetch URL: %q ; %s", *option, err.Error()) + log.Printf("failed to populate talos.config fetch URL: %q ; %s", *option, err.Error()) } log.Printf("fetching machine config from: %q", downloadEndpoint) diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url.go b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url.go index 8cb305fb24..9ed04a2a59 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/metal/url.go @@ -14,6 +14,7 @@ import ( "github.com/cosi-project/runtime/pkg/resource" "github.com/cosi-project/runtime/pkg/safe" "github.com/cosi-project/runtime/pkg/state" + "github.com/hashicorp/go-multierror" "github.com/siderolabs/talos/pkg/machinery/constants" hardwareResource "github.com/siderolabs/talos/pkg/machinery/resources/hardware" @@ -78,25 +79,27 @@ func PopulateURLParameters(ctx context.Context, downloadURL string, r state.Stat return nil } + var multiErr *multierror.Error + if err := substitute(constants.UUIDKey, getSystemUUID); err != nil { - return "", err + multiErr = multierror.Append(multiErr, err) } if err := substitute(constants.SerialNumberKey, getSystemSerialNumber); err != nil { - return "", err + multiErr = multierror.Append(multiErr, err) } if err := substitute(constants.MacKey, getMACAddress); err != nil { - return "", err + multiErr = multierror.Append(multiErr, err) } if err := substitute(constants.HostnameKey, getHostname); err != nil { - return "", err + multiErr = multierror.Append(multiErr, err) } u.RawQuery = values.Encode() - return u.String(), nil + return u.String(), multiErr.ErrorOrNil() } //nolint:gocyclo @@ -123,6 +126,7 @@ func getResource[T resource.Resource](ctx context.Context, r state.State, namesp // ok, proceed case state.Destroyed, state.Bootstrapped: // ignore + continue case state.Errored: return "", event.Error() }