Versions in this module Expand all Collapse all v0 v0.1.0 Jan 4, 2024 Changes in this version + var ErrorTimeExceeded = fmt.Errorf("time limit exceeded") + func GuessResourceFromKind(kind string) string + func JobberTemplateFunctions() map[string]any + func TemplateFunc_NewBoundBearerToken(forServiceAccount *TransitiveServiceAccount) (tokenAsAString string, err error) + func TemplateFunc_PodIPString(resource *TransitivePod) (string, error) + type ActionEvent struct + AffectedResource *GenericK8sResource + Error error + ExpandedTemplateBuffer *bytes.Buffer + StderrBuffer *bytes.Buffer + StdoutBuffer *bytes.Buffer + Type ActionEventType + type ActionEventType int + const ActionCompletedSuccessfully + const AnErrorOccurred + const ExecutionSuccessful + const JobCompleted + const PodMovedToRunningState + const ResourceCreated + const TemplateExpanded + const ValuesTransformCompleted + type Client struct + func NewClientUsingKubeconfigFile(filePath string) (*Client, error) + func (client *Client) CreateNamespaceUsingGeneratedName(generatedBaseName string) (*corev1.Namespace, error) + func (client *Client) DefaultResourceDeletionOptions() metav1.DeleteOptions + func (client *Client) DeleteNamespace(named string) error + func (client *Client) DetermineResourceFromGroupVersionKind(gvk schema.GroupVersionKind) (schema.GroupVersionResource, error) + func (client *Client) Discovery() *discovery.DiscoveryClient + func (client *Client) Dynamic() *dynamic.DynamicClient + func (client *Client) Set() *kubernetes.Clientset + type Configuration struct + Test *ConfigurationTest + func ReadConfigurationYamlFromFile(filePath string, configExpansionVars map[string]string) (*Configuration, error) + func ReadConfigurationYamlFromReader(r io.Reader) (*Configuration, error) + func (c *Configuration) CharactersInLongestCaseName() uint + func (c *Configuration) CharactersInLongestUnitName() uint + type ConfigurationAssetArchive struct + FilePath string + type ConfigurationDefaultNamespace struct + Basename string + type ConfigurationPipeline struct + ActionDefinitionsRootDirectory string + ActionsInOrder []string + type ConfigurationTest struct + AssetArchive *ConfigurationAssetArchive + Cases []*TestCase + DefaultNamespace *ConfigurationDefaultNamespace + GlobalValues map[string]any + Pipeline *ConfigurationPipeline + Units []*TestUnit + type ContextualAssetsDirectoryManager struct + func NewContextualAssetsDirectoryManager() *ContextualAssetsDirectoryManager + func (m *ContextualAssetsDirectoryManager) CreateTestAssetsRootDirectory() *TestCaseAssetsDirectoryCreationOutcome + func (m *ContextualAssetsDirectoryManager) CreateTestCaseDirectories(testUnit *TestUnit, testCase *TestCase) *TestCaseAssetsDirectoryCreationOutcome + func (m *ContextualAssetsDirectoryManager) CreateTestUnitDirectory(testUnit *TestUnit) *TestCaseAssetsDirectoryCreationOutcome + func (m *ContextualAssetsDirectoryManager) GenerateArchiveFileAt(archiveFilePath string) error + func (m *ContextualAssetsDirectoryManager) RemoveAssetsDirectory() error + func (m *ContextualAssetsDirectoryManager) TestCaseAssetsDirectoryPathsFor(testUnit *TestUnit, testCase *TestCase) *TestCaseDirectoryPaths + func (m *ContextualAssetsDirectoryManager) TestRootAssetDirectoryPath() string + func (m *ContextualAssetsDirectoryManager) TestUnitAssetDirectoryPathFor(testUnit *TestUnit) string + type CreatedResourceTracker struct + func NewCreatedResourceTracker() *CreatedResourceTracker + func (tracker *CreatedResourceTracker) AddCreatedResource(r *DeletableK8sResource) + func (tracker *CreatedResourceTracker) AttemptToDeleteAllAsYetUndeletedResources() []*ResourceDeletionAttempt + type CustomerTemplateFunctions struct + func (t *CustomerTemplateFunctions) Add(functionName string, function any) *CustomerTemplateFunctions + type DeletableK8sResource struct + type Event struct + Context EventContext + Error error + ExecuableInformation *ExecutableEvent + FileEvent *FileEvent + ResourceInformation *ResourceEvent + Type EventType + ValuesTransformInformation *ValuesTransformEvent + type EventContext struct + CaseName string + UnitName string + func EventContextFor(testUnit *TestUnit, testCase *TestCase) EventContext + type EventType int + const ArchiveFileCreatedSuccessfully + const ArchiveFileCreationFailed + const AssetDirectoryCreatedSuccessfully + const AssetDirectoryCreationFailed + const AssetDirectoryDeletedSuccessfully + const AssetDirectoryDeletionFailed + const ExecutableRunFailure + const ExecutableRunSuccess + const JobFailedToComplete + const PipelineDefinitionIsInvalid + const ResourceCreationFailure + const ResourceCreationSuccess + const ResourceDeletionFailure + const ResourceDeletionSuccess + const ResourceTemplateExpansionFailure + const TestCaseCompletedSuccessfully + const TestCaseStarted + const TestUnitCompletedSuccessfully + const TestUnitStarted + const TestingCompletedSuccesfully + const ValuesTransformFailure + const ValuesTransformSuccess + const WaitingForJobToComplete + const WaitingForPodToReachRunningState + type ExecutableEvent struct + ExecutableName string + StderrOutputRetriever StringRetriever + StdoutOutputRetriever StringRetriever + type FileEvent struct + Path string + type FileOrDirectoryCreationError struct + Path string + func NewFileOrDirectoryCreationError(path string, errorStringFormat string, a ...any) *FileOrDirectoryCreationError + func (e *FileOrDirectoryCreationError) Error() string + type GenericK8sResource struct + Group string + Kind string + Name string + Version string + func NewGenericK8sResourceFromUnstructured(u *unstructured.Unstructured, client *Client) (*GenericK8sResource, error) + func NewGenericK8sResourceFromUnstructuredMap(inputMap map[string]any, client *Client) (*GenericK8sResource, error) + func (resource *GenericK8sResource) ApiObject() *unstructured.Unstructured + func (resource *GenericK8sResource) AsAJob() *TransitiveJob + func (resource *GenericK8sResource) AsAPod() *TransitivePod + func (resource *GenericK8sResource) Create() (err error) + func (resource *GenericK8sResource) Delete() error + func (resource *GenericK8sResource) GvkString() string + func (resource *GenericK8sResource) Information() *K8sResourceInformation + func (resource *GenericK8sResource) NamespaceName() string + func (resource *GenericK8sResource) SetNamespace(namespaceName string) + func (resource *GenericK8sResource) UnstructuredMap() map[string]any + func (resource *GenericK8sResource) UpdateStatus() (err error) + type JobCompletionFailureError struct + ResourceInformation *K8sResourceInformation + func NewJobCompletionFailureError(resourceInformation *K8sResourceInformation, errorStringFormat string, ...) *JobCompletionFailureError + func (e *JobCompletionFailureError) Error() string + type K8sResourceInformation struct + Kind string + Name string + NamespaceName string + type Pipeline struct + func NewPipelineFromStringDescriptors(pipelineDescriptors []string, pipelineActionBasePath string) (*Pipeline, error) + func (pipeline *Pipeline) NextAction() *PipelineAction + func (pipeline *Pipeline) Restart() *PipelineAction + type PipelineAction struct + ActionFullyQualifiedPath string + Descriptor string + Type PipelineActionType + func PipelineActionFromStringDescriptor(descriptor string, pipelineActionBasePath string) (*PipelineAction, error) + func (action *PipelineAction) Run(pipelineVariables *PipelineVariables, client *Client, ...) + type PipelineActionOutcome struct + CreatedResource *GenericK8sResource + Error error + OutputBuffer *bytes.Buffer + StderrBuffer *bytes.Buffer + Variables *PipelineVariables + func (outcome *PipelineActionOutcome) WriteErrorToFile(filePath string, fileModeIfFileIsCreated os.FileMode) error + func (outcome *PipelineActionOutcome) WriteOutputToFile(filePath string, fileModeIfFileIsCreated os.FileMode) error + type PipelineActionType int + const Executable + const TemplatedResource + const ValuesTransform + type PipelineRuntimeNamespace struct + Name string + type PipelineRuntimeValues struct + DefaultNamespace *PipelineRuntimeNamespace + func NewEmptyPipelineRuntimeValues(client *Client) *PipelineRuntimeValues + func (values *PipelineRuntimeValues) Add(resource *GenericK8sResource) *PipelineRuntimeValues + func (values *PipelineRuntimeValues) CreatedAsset(group string, version string, kind string, name string) *GenericK8sResource + func (values *PipelineRuntimeValues) CreatedPod(podName string) (*TransitivePod, error) + func (values *PipelineRuntimeValues) ServiceAccount(inNamespace string, accountName string) (*TransitiveServiceAccount, error) + type PipelineVariables struct + Context *PipelineVariablesContext + Runtime *PipelineRuntimeValues + Values *PipelineVariablesValues + func NewEmptyPipelineVariables(client *Client) *PipelineVariables + func (v *PipelineVariables) AndTestCaseRetrievedAssetsDirectoryAt(path string) *PipelineVariables + func (v *PipelineVariables) AndUsingDefaultNamespaceNamed(generatedNamespaceName string) *PipelineVariables + func (v *PipelineVariables) DeepCopy() *PipelineVariables + func (v *PipelineVariables) RescopedToCaseNamed(testCaseName string) *PipelineVariables + func (v *PipelineVariables) RescopedToUnitNamed(testUnitName string) *PipelineVariables + func (v *PipelineVariables) SetDefaultNamespaceNameTo(generatedNamespaceName string) *PipelineVariables + func (v *PipelineVariables) SetTestCaseRetrievedAssetsDirectoryPath(path string) *PipelineVariables + func (v *PipelineVariables) WithCaseValues(caseValues map[string]any) *PipelineVariables + func (v *PipelineVariables) WithGlobalValues(globalValues map[string]any) *PipelineVariables + func (v *PipelineVariables) WithUnitValues(unitValues map[string]any) *PipelineVariables + type PipelineVariablesContext struct + TestCaseName string + TestCaseRetrievedAssetsDirectoryPath string + TestUnitName string + type PipelineVariablesValues struct + Case map[string]any + Global map[string]any + Unit map[string]any + type ResourceCreationError struct + ResourceInformation *K8sResourceInformation + TemplateName string + func NewResourceCreationError(fromTemplateNamed string, resourceInformation *K8sResourceInformation, ...) *ResourceCreationError + func (e *ResourceCreationError) Error() string + type ResourceDeletionAttempt struct + Error error + Resource *DeletableK8sResource + type ResourceEvent struct + ExpandedTemplateRetriever StringRetriever + ResourceDetails *K8sResourceInformation + TemplateName string + type Runner struct + func NewRunner(config *Configuration, client *Client) *Runner + func (runner *Runner) RunTest(eventChannel chan<- *Event) + type StringRetriever func() string + type TemplateError struct + TemplateName string + func NewTemplateError(templateName string, errorStringFormat string, a ...any) *TemplateError + func (e *TemplateError) Error() string + type TestCase struct + Name string + Values map[string]any + type TestCaseAssetsDirectoryCreationOutcome struct + DirectoryCreationFailureError error + DirectoryPathOfFailedCreation string + SuccessfullyCreatedDirectoryPaths []string + type TestCaseDirectoryPaths struct + Executables string + ExpandedTemplates string + RetrievedAssets string + Root string + ValuesTransforms string + type TestUnit struct + Name string + Values map[string]any + type TransitiveJob struct + func (job *TransitiveJob) WaitForCompletion() error + type TransitivePod struct + func (pod *TransitivePod) IpString() (string, error) + func (pod *TransitivePod) UpdateStatus() (err error) + func (pod *TransitivePod) WaitForRunningState(lengthOfTimeToWait time.Duration) error + type TransitiveServiceAccount struct + func (sa *TransitiveServiceAccount) GenerateBoundBearerTokenString() (string, error) + type Updatable interface + UpdateStatus func() error + type ValuesTransformEvent struct + InputValuesRetriever StringRetriever + OutputValuesRetriever StringRetriever + StderrOutputRetriever StringRetriever + TransformerName string + type WaitTimer struct + MaximumTimeToWait time.Duration + ProbeInterval time.Duration + func NewWaitTimer(maximumTimetoWait time.Duration, probeInterval time.Duration) *WaitTimer + func (t *WaitTimer) TestExpectation(againstObject Updatable, expectationFunc WaitTimerExpectationFunction) (err error) + type WaitTimerExpectationFunction func(objectToTest Updatable) (expectationReached bool, errorOccurred error)