Documentation
¶
Index ¶
- Constants
- Variables
- func CRDsExist(apiresource string) bool
- func CompleteFlags(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective)
- func CompleteScenarios(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective)
- func CompleteServices(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func CreateNamespace(name string, labels ...string) error
- func Dashboards(testName string) error
- func DeleteNamespaces(selector string, testNames ...string) error
- func ErrContainerNotReady(out []byte) bool
- func ErrNamespaceNotFound(out []byte) bool
- func ErrNoMatchingResources(out []byte) bool
- func ErrNoResources(out []byte) bool
- func ErrNotFound(out []byte) bool
- func ErrPodNotFound(out []byte) bool
- func ForceDelete(testName string) error
- func GetChaosResources(testName string) error
- func GetFrisbeeResources(testName string, watch bool) error
- func GetK8sEvents(testName string) error
- func GetK8sResources(testName string) error
- func GetTemplateResources(testName string) error
- func Helm(testName string, command ...string) ([]byte, error)
- func HelmIgnoreNotFound(err error) error
- func InstallFrisbeeOnK8s(command []string, options *FrisbeeInstallOptions)
- func InstallPDFExporter(location string)
- func Kubectl(testName string, command ...string) ([]byte, error)
- func KubectlLogs(ctx context.Context, testName string, tail bool, lines int, pods ...string) error
- func LabelNamespace(name string, labels ...string) error
- func LoggedHelm(testName string, command ...string) ([]byte, error)
- func LoggedKubectl(testName string, command ...string) ([]byte, error)
- func NoArgs(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective)
- func OpenShell(testName string, podName string, shellArgs ...string) error
- func PopulateInstallFlags(cmd *cobra.Command, options *FrisbeeInstallOptions)
- func RenderGoTemplate(item interface{}, w io.Writer, tpl string) error
- func RenderGoTemplateList(list []interface{}, w io.Writer, tpl string) error
- func RenderJSON(obj interface{}, w io.Writer) error
- func RenderList(obj interface{}, w io.Writer) error
- func RenderPrettyList(obj ui.TableData, w io.Writer) error
- func RenderYaml(obj interface{}, w io.Writer) error
- func RunTest(testName string, testFile string, mode ValidationMode) error
- func WaitForCondition(ctx context.Context, testName string, condition v1alpha1.ConditionType, ...) error
- type CliObjRenderer
- type FrisbeeInstallOptions
- type OutputType
- type PDFExporter
- type ValidationMode
Constants ¶
View Source
const ( ClusterScope = "" FrisbeeInstallation = "frisbee" FrisbeeNamespace = "frisbee" )
View Source
const ( FrisbeeRepo = "https://carv-ics-forth.github.io/frisbee/charts" JetstackRepo = "https://charts.jetstack.io" )
View Source
const ( NotReadyRegex = `.* container "(\w+)" in pod "(.*)" is waiting to start: (\w+)` NoPodsFoundReg = `.* pods "\w+" not found` NotResourcesFoundReg = `No resources found*` NotFound = `Error from server (NotFound)` NoResources = `No resources found in .+ namespace.` NoMatchingResources = `no matching resources found` PodNotFound = `Error from server \(NotFound\): pods ".+" not found` NamespaceNotFound = `Error from server \(NotFound\): namespaces ".+" not found` )
View Source
const ( Scenarios = "scenarios.frisbee.dev" Clusters = "clusters.frisbee.dev" Services = "services.frisbee.dev" Chaos = "chaos.frisbee.dev" Cascades = "cascades.frisbee.dev" Calls = "calls.frisbee.dev" VirtualObjects = "virtualobjects.frisbee.dev" Templates = "templates.frisbee.dev" )
View Source
const ( NetworkChaos = "networkchaos.chaos-mesh.org" PodChaos = "podchaos.chaos-mesh.org" IOChaos = "iochaos.chaos-mesh.org" KernelChaos = "kernelchaos.chaos-mesh.org" TimeChaos = "timechaos.chaos-mesh.org" )
View Source
const ( K8PODs = "pods" K8PVCs = "persistentvolumeclaims" K8PVs = "persistentvolumes" K8SStorageClasses = "storageclasses.storage.k8s.io" )
View Source
const ( FilterSYS = string(v1alpha1.LabelComponent + "=" + v1alpha1.ComponentSys) FilterSUT = string(v1alpha1.LabelComponent + "=" + v1alpha1.ComponentSUT) )
View Source
const (
AllPods = "all"
)
View Source
const EmptyChaosResourceInspectionFields = "Kind Job InjectionTime Phase Target"
View Source
const EmptyK8SResourceInspectionFields = "API Kind Name Action Component Phase* Reason* Message*"
View Source
const EmptyResourceInspectionFields = "Name Kind Job Component Phase Reason Message"
View Source
const EmptyTemplateResources = "Chart Template Parameters"
View Source
const (
K8SRemoveFinalizer = `--patch=[{"op":"remove","path":"/metadata/finalizers"}]`
)
View Source
const (
ManagedNamespace = "app.kubernetes.io/managed-by=Frisbee"
)
View Source
const (
TestTimeout = "24h"
)
Variables ¶
View Source
var BackoffPodCreation = wait.Backoff{ Duration: 10 * time.Second, Factor: 1.5, Jitter: 0.1, Steps: 60, }
View Source
var ChaosResourceInspectionFields = strings.Join([]string{
"custom-columns=Kind:.kind",
"Job:.metadata.name",
"InjectionTime:.metadata.creationTimestamp",
"Phase:.status.experiment.desiredPhase",
"Target:.status.experiment.containerRecords[*].id",
}, ",")
View Source
var FrisbeeResourceInspectionFields = strings.Join([]string{
"custom-columns=Name:.metadata.namespace",
"Kind:.kind",
"Job:.metadata.name",
"Component:.metadata.labels.scenario\\.frisbee\\.dev\\/component",
"Phase:.status.phase",
"Reason:.status.reason",
"Message:.status.message",
}, ",")
View Source
var K8SResourceInspectionFields = strings.Join([]string{
"custom-columns=API:.apiVersion",
"Kind:.kind",
"Name:.metadata.name",
"Action:.metadata.labels.scenario\\.frisbee\\.dev\\/action",
"Component:.metadata.labels.scenario\\.frisbee\\.dev\\/component",
"Phase*:.status.phase",
"Reason*:.status.reason",
"Message*:.status.message",
}, ",")
View Source
var TemplateInspectionFields = strings.Join([]string{
"custom-columns=Chart:.metadata.annotations.meta\\.helm\\.sh\\/release-name",
"Template:.metadata.name",
"Parameters:spec.inputs.parameters",
}, ",")
Functions ¶
func CompleteFlags ¶ added in v1.0.41
func CompleteScenarios ¶ added in v1.0.41
func CompleteScenarios(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective)
CompleteScenarios list the available test-cases
func CompleteServices ¶ added in v1.0.41
func CompleteServices(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
CompleteServices list the available services. Assumes that args[0] is the namespace
func CreateNamespace ¶
func Dashboards ¶
func DeleteNamespaces ¶
func ErrContainerNotReady ¶ added in v1.0.26
func ErrNamespaceNotFound ¶ added in v1.0.37
func ErrNoMatchingResources ¶ added in v1.0.41
func ErrNoResources ¶ added in v1.0.37
func ErrNotFound ¶ added in v1.0.26
func ErrPodNotFound ¶ added in v1.0.37
func ForceDelete ¶
ForceDelete iterates the Frisbee CRDs and remove its finalizers.
func GetChaosResources ¶
func GetFrisbeeResources ¶
func GetK8sEvents ¶ added in v1.0.28
func GetK8sResources ¶
func GetTemplateResources ¶
func HelmIgnoreNotFound ¶ added in v1.0.28
func InstallFrisbeeOnK8s ¶ added in v1.0.28
func InstallFrisbeeOnK8s(command []string, options *FrisbeeInstallOptions)
func InstallPDFExporter ¶ added in v1.0.41
func InstallPDFExporter(location string)
func KubectlLogs ¶ added in v1.0.37
KubectlLogs provides convenience on printing the logs from prods. Filter query:
- Run with '--logs all'. -> monitor all pods (SYS + SUT)
- Run with '--logs SYS'. -> monitor only SYS pods
- Run with '--logs SUT'. -> monitor only SUT pods
- Run with '--logs pod1'. -> monitor a specific pod
- Run with '--logs pod1,pod2,pod3,...'. -> monitoring multiple pods
func LabelNamespace ¶ added in v1.0.25
func LoggedHelm ¶ added in v1.0.28
func LoggedKubectl ¶ added in v1.0.28
func PopulateInstallFlags ¶ added in v1.0.28
func PopulateInstallFlags(cmd *cobra.Command, options *FrisbeeInstallOptions)
func RenderGoTemplateList ¶
func RenderJSON ¶
func RenderList ¶
func RenderYaml ¶
func WaitForCondition ¶ added in v1.0.27
Types ¶
type CliObjRenderer ¶
type FrisbeeInstallOptions ¶ added in v1.0.28
type FrisbeeInstallOptions struct {
NoCertManager bool
}
type OutputType ¶
type OutputType string
const ( OutputGoTemplate OutputType = "go" OutputJSON OutputType = "json" OutputYAML OutputType = "yaml" OutputPretty OutputType = "pretty" )
type PDFExporter ¶ added in v1.0.41
type PDFExporter string
var ( // DefaultPDFExport points to either FastPDFExporter or LongPDFExporter. DefaultPDFExport PDFExporter // FastPDFExporter is fast on individual panels, but does not render dashboard with many panels. FastPDFExporter PDFExporter // LongPDFExporter can render dashboards with many panels, but it's a bit slow. LongPDFExporter PDFExporter )
type ValidationMode ¶ added in v1.0.30
type ValidationMode uint8
const ( ValidationNone ValidationMode = iota ValidationClient ValidationServer )
Click to show internal directories.
Click to hide internal directories.