talos/internal/pkg/install/options.go
Spencer Smith 5e8cab4dd5 fix: check for installer image before proceeding with upgrade
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>
2020-01-09 15:05:28 -08:00

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,
}
}