Documentation ¶
Index ¶
- Variables
- func EnsureDefaultAuthFilePath() (string, error)
- func EnsureDefaultConfigFilePath() (string, error)
- func Error(str string)
- func Errorf(format string, args ...interface{})
- func ExecCommand(name string, args ...string) error
- func Fatal(str string)
- func Fatalf(format string, args ...interface{})
- func GetCloudClientConnection(cloudAddr string) (*grpc.ClientConn, error)
- func Info(str string)
- func Infof(format string, args ...interface{})
- func RunClusterChecks(checks []Checker) error
- func RunDefaultClusterChecks() error
- func RunExtraClusterChecks() error
- func VersionCompatible(version string, minVersion string) (bool, error)
- func WithSignalCancellable(ctx context.Context) (context.Context, func())
- type CLIOutputEntry
- func (c *CLIOutputEntry) Error(str string)
- func (c *CLIOutputEntry) Errorf(format string, args ...interface{})
- func (c *CLIOutputEntry) Fatal(str string)
- func (c *CLIOutputEntry) Fatalf(format string, args ...interface{})
- func (c *CLIOutputEntry) Info(str string)
- func (c *CLIOutputEntry) Infof(format string, args ...interface{})
- func (c *CLIOutputEntry) WithColor(textColor *color.Color) *CLIOutputEntry
- func (c *CLIOutputEntry) WithError(err error) *CLIOutputEntry
- type Checker
- type ClusterType
- type ParallelTaskRunner
- type SerialTaskRunner
- type Task
Constants ¶
This section is empty.
Variables ¶
var DefaultClusterChecks = []Checker{
kernelVersionCheck,
clusterTypeIsSupported,
k8sVersionCheck,
hasKubectlCheck,
userCanCreateNamespace,
}
DefaultClusterChecks is a list of cluster that are performed by default.
var ExtraClusterChecks = []Checker{
allowListClusterCheck,
}
ExtraClusterChecks is a list of checks for the cluster that are not required for deployment, but are highly recommended.
Functions ¶
func EnsureDefaultAuthFilePath ¶
EnsureDefaultAuthFilePath returns the file path for the auth file.
func EnsureDefaultConfigFilePath ¶
EnsureDefaultConfigFilePath returns the file path for the config file.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf prints the input string to stderr formatted with the input args.
func ExecCommand ¶
ExecCommand runs a command and returns stderr as the error.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf prints the input string to stderr formatted with the input args.
func GetCloudClientConnection ¶
func GetCloudClientConnection(cloudAddr string) (*grpc.ClientConn, error)
GetCloudClientConnection gets the GRPC connection based on the cloud addr.
func Infof ¶
func Infof(format string, args ...interface{})
Infof prints the input string to stdout formatted with the input args.
func RunClusterChecks ¶
RunClusterChecks will run a list of checks and print out their results. The first error is returned, but we continue to run all checks.
func RunDefaultClusterChecks ¶
func RunDefaultClusterChecks() error
RunDefaultClusterChecks runs the default configured checks.
func RunExtraClusterChecks ¶
func RunExtraClusterChecks() error
RunExtraClusterChecks runs the extra configured checks.
func VersionCompatible ¶
VersionCompatible checks to make sure version >= minVersion as per semver.
Types ¶
type CLIOutputEntry ¶
type CLIOutputEntry struct {
// contains filtered or unexported fields
}
CLIOutputEntry represents an output log entry.
func WithColor ¶
func WithColor(c *color.Color) *CLIOutputEntry
WithColor returns a struct that can be used to log text to the CLI in a specific color.
func WithError ¶
func WithError(err error) *CLIOutputEntry
WithError returns a struct that can be used to log text to the CLI with a specific error.
func (*CLIOutputEntry) Error ¶
func (c *CLIOutputEntry) Error(str string)
Error prints the input string to stderr.
func (*CLIOutputEntry) Errorf ¶
func (c *CLIOutputEntry) Errorf(format string, args ...interface{})
Errorf prints the input string to stderr formatted with the input args.
func (*CLIOutputEntry) Fatal ¶
func (c *CLIOutputEntry) Fatal(str string)
Fatal prints the input string to stderr.
func (*CLIOutputEntry) Fatalf ¶
func (c *CLIOutputEntry) Fatalf(format string, args ...interface{})
Fatalf prints the input string to stderr formatted with the input args.
func (*CLIOutputEntry) Info ¶
func (c *CLIOutputEntry) Info(str string)
Info prints the input string to stdout.
func (*CLIOutputEntry) Infof ¶
func (c *CLIOutputEntry) Infof(format string, args ...interface{})
Infof prints the input string to stdout formatted with the input args.
func (*CLIOutputEntry) WithColor ¶
func (c *CLIOutputEntry) WithColor(textColor *color.Color) *CLIOutputEntry
WithColor returns a struct that can be used to log text to the CLI in a specific color.
func (*CLIOutputEntry) WithError ¶
func (c *CLIOutputEntry) WithError(err error) *CLIOutputEntry
WithError returns a struct that can be used to log text to the CLI with a specific error.
type Checker ¶
type Checker interface { // Returns the name of the Checker. Name() string // Checker returns nil for pass, or error. Check() error }
Checker is a named check.
func NamedCheck ¶
NamedCheck is used to easily create a Checker with a name.
type ClusterType ¶
type ClusterType int
ClusterType represents all possible types of a K8s cluster.
const ( // ClusterTypeUnknown is an unknown cluster type. ClusterTypeUnknown ClusterType = iota // ClusterTypeGKE is a GKE cluster. ClusterTypeGKE // ClusterTypeEKS is an EKS cluster. ClusterTypeEKS // ClusterTypeAKS is an AKS cluster. ClusterTypeAKS // ClusterTypeKind is a kind cluster. ClusterTypeKind // ClusterTypeDockerDesktop is a Docker for Desktop cluster. ClusterTypeDockerDesktop // ClusterTypeMinikubeKVM2 is a minikube cluster running with the kvm2 driver. ClusterTypeMinikubeKVM2 // ClusterTypeMinikubeHyperkit is a minikube cluster running with the hyperkit driver. ClusterTypeMinikubeHyperkit // ClusterTypeMinikubeOther is a minikube cluster running with a driver not specified in // the other enums. ClusterTypeMinikubeOther // ClusterTypeK0s is a k0s cluster. ClusterTypeK0s // ClusterTypeK3s is a k3s cluster. ClusterTypeK3s // ClusterTypeOpenShift is an OpenShift cluster. ClusterTypeOpenShift )
type ParallelTaskRunner ¶
type ParallelTaskRunner struct {
// contains filtered or unexported fields
}
ParallelTaskRunner runs tasks in parallel and displays them in a table.
func NewParallelTaskRunner ¶
func NewParallelTaskRunner(tasks []Task) *ParallelTaskRunner
NewParallelTaskRunner creates a new ParallelTaskRunner
func (*ParallelTaskRunner) RunAndMonitor ¶
func (s *ParallelTaskRunner) RunAndMonitor() error
RunAndMonitor runs tasks and shows output in a table.
type SerialTaskRunner ¶
type SerialTaskRunner struct {
// contains filtered or unexported fields
}
SerialTaskRunner runs tasks in serial and displays them in a table.
func NewSerialTaskRunner ¶
func NewSerialTaskRunner(tasks []Task) *SerialTaskRunner
NewSerialTaskRunner creates a new SerialTaskRunner
func (*SerialTaskRunner) RunAndMonitor ¶
func (s *SerialTaskRunner) RunAndMonitor() error
RunAndMonitor runs tasks and shows output in a table.