mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-20 22:21:13 +02:00
This PR will add in some code to pre-pull the installer image before we run an upgrade of a given talos node. Additionally, this will add some functional args to the install package to allow for specifying whether or not to pull the installer image. This was needed since there was no sense in pulling the installer again once we made it that far into the upgrade process. Signed-off-by: Spencer Smith <robertspencersmith@gmail.com>
30 lines
732 B
Go
30 lines
732 B
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package install
|
|
|
|
// Option controls generate options specific to input generation.
|
|
type Option func(o *Options) error
|
|
|
|
// WithImagePull disables pulling the installer image during an install
|
|
func WithImagePull(shouldPull bool) Option {
|
|
return func(o *Options) error {
|
|
o.ImagePull = shouldPull
|
|
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// Options describes generate parameters.
|
|
type Options struct {
|
|
ImagePull bool
|
|
}
|
|
|
|
// DefaultInstallOptions returns default options.
|
|
func DefaultInstallOptions() Options {
|
|
return Options{
|
|
ImagePull: true,
|
|
}
|
|
}
|