Documentation ¶
Index ¶
- Constants
- func AddModeFlags(mode *Mode, command *cobra.Command)
- func AppendErrors(err error, errs ...error) error
- func CheckErrors[T interface{ ... }](messages ...T) error
- func ClientVersionCheck(ctx context.Context, c *client.Client) error
- func Confirm(prompt string) bool
- func ExtractFileFromTarGz(filename string, r io.ReadCloser) ([]byte, error)
- func ExtractTarGz(localPath string, r io.ReadCloser) error
- func FailIfMultiNodes(ctx context.Context, command string) error
- func ForEachResource(ctx context.Context, c *client.Client, ...) error
- func NonFatalError(err error) error
- func PrintApplyResults(resp *machine.ApplyConfigurationResponse)
- func ReadGRPCStream[S Stream[T], T Message](stream S, handler func(T, string, bool) error) error
- type ErrNonFatalError
- type Message
- type Mode
- type Stream
Constants ¶
const InteractiveMode machine.ApplyConfigurationRequest_Mode = -1
InteractiveMode fake mode value for the interactive config mode. Should be never passed to the API.
Variables ¶
This section is empty.
Functions ¶
func AddModeFlags ¶
AddModeFlags adds deprecated flags to the command and registers mode flag with it's parser.
func AppendErrors ¶
AppendErrors adds errors to the multierr wrapper.
func CheckErrors ¶
CheckErrors goes through the returned message list and checks if any messages have errors set.
func ClientVersionCheck ¶
ClientVersionCheck verifies that client is not outdated vs. Talos version.
func Confirm ¶ added in v1.4.0
Confirm asks the user to confirm their action. Anything other than `y` and `yes` returns false.
func ExtractFileFromTarGz ¶
func ExtractFileFromTarGz(filename string, r io.ReadCloser) ([]byte, error)
ExtractFileFromTarGz reads a single file data from an archive.
func ExtractTarGz ¶
func ExtractTarGz(localPath string, r io.ReadCloser) error
ExtractTarGz extracts .tar.gz archive from r into filesystem under localPath.
func FailIfMultiNodes ¶
FailIfMultiNodes checks if ctx contains multi-node request metadata.
func ForEachResource ¶
func ForEachResource(ctx context.Context, c *client.Client, callbackRD func(rd *meta.ResourceDefinition) error, callback func(ctx context.Context, hostname string, r resource.Resource, callError error) error, namespace string, args ...string, ) error
ForEachResource gets resources from the controller runtime and runs a callback for each resource.
func NonFatalError ¶
NonFatalError wraps another error into a ErrNonFatal.
func PrintApplyResults ¶
func PrintApplyResults(resp *machine.ApplyConfigurationResponse)
PrintApplyResults prints out all warnings and auto apply results.
Types ¶
type ErrNonFatalError ¶
type ErrNonFatalError struct {
// contains filtered or unexported fields
}
ErrNonFatalError represents the error that can be returned from the handler in the gRPC stream reader which doesn't mean that we should stop iterating over the messages in the stream, but log this error and continue the process.
func (*ErrNonFatalError) Error ¶
func (e *ErrNonFatalError) Error() string
Error implements error interface.
type Mode ¶
type Mode struct { Mode machine.ApplyConfigurationRequest_Mode // contains filtered or unexported fields }
Mode apply, patch, edit config update mode.