Documentation ¶
Index ¶
Constants ¶
const ( // MinK8sMajorVersion is the minimum supported Major version MinK8sMajorVersion = 1 // MinK8sMinorVersion is the minimum supported Minor version MinK8sMinorVersion = 12 // MinK8sGitVersion is the minimum supported k8s version MinK8sGitVersion = "v1.12.0" // RbacGroupName describe hte rbac group name RbacGroupName = "rbac.authorization.k8s.io" )
const ( // APIVersionKey describes the APIVersion key APIVersionKey = "apiVersion" // FeatureGateTestPVCName is the name of the pvc created by the feature gate // validation test FeatureGateTestPVCName = "kubestr-featuregate-test" // DefaultNS describes the default namespace DefaultNS = "default" // PodNamespaceEnvKey describes the pod namespace env variable PodNamespaceEnvKey = "POD_NAMESPACE" )
const ( // ErrorColor formatted color red ErrorColor = "\033[1;31m%s\033[0m" // SuccessColor formatted color green SuccessColor = "\033[1;32m%s\033[0m" // YellowColor formatted color yellow YellowColor = "\033[1;33m%s\033[0m" )
const ( // StatusOK is the success status code StatusOK = StatusCode("OK") // StatusWarning is the informational status code StatusWarning = StatusCode("Warning") // StatusError is the failure status code StatusError = StatusCode("Error") // StatusInfo is the Info status code StatusInfo = StatusCode("Info") )
const Logo = `` /* 266-byte string literal not displayed */
Variables ¶
var ( DefaultQPS = float32(50) DefaultBurst = 100 )
var CSIDriverList = []*CSIDriver{}/* 109 elements not displayed */
Functions ¶
func LoadDynCli ¶ added in v0.4.0
LoadDynCli loads the config and returns a dynamic CLI
func LoadKubeCli ¶ added in v0.4.0
func LoadKubeCli() (kubernetes.Interface, error)
LoadKubeCli load the config and returns a kubernetes client NewClient returns a k8 client configured by the kanister environment.
Types ¶
type CSIDriver ¶
type CSIDriver struct { NameUrl string DriverName string Versions string Description string Persistence string AccessModes string DynamicProvisioning string Features string }
func (*CSIDriver) SupportsSnapshots ¶
type Kubestr ¶
Kubestr is the primary object for running the kubestr tool. It holds all the cluster state information as well.
func NewKubestr ¶
NewKubestr initializes a new kubestr object to run preflight tests
func (*Kubestr) KubernetesChecks ¶
func (p *Kubestr) KubernetesChecks() []*TestOutput
KubernetesChecks runs all the baseline checks on the cluster
func (*Kubestr) ValidateProvisioners ¶
func (p *Kubestr) ValidateProvisioners(ctx context.Context) ([]*Provisioner, error)
ValidateProvisioners validates the provisioners in a cluster
type Provisioner ¶
type Provisioner struct { ProvisionerName string CSIDriver *CSIDriver URL string StorageClasses []*SCInfo VolumeSnapshotClasses []*VSCInfo StatusList []Status }
Provisioner holds the important information of a provisioner
func (*Provisioner) Print ¶
func (v *Provisioner) Print()
Print prints the provionsioner specific details
type Status ¶
type Status struct { StatusCode StatusCode StatusMessage string Raw interface{} `json:",omitempty"` }
Status is a generic structure to return a status
type TestOutput ¶
TestOutput is the generic return value for tests
func MakeTestOutput ¶ added in v0.4.0
func MakeTestOutput(testname string, code StatusCode, mesg string, raw interface{}) *TestOutput
func (*TestOutput) Print ¶
func (t *TestOutput) Print()
Print prints a TestRetVal as a string output