Documentation ¶
Index ¶
- func CreateE2E(ctx context.Context, resources []CreateResource) (map[string]interface{}, error)
- func CreateFromFile(ctx context.Context, client klient.Client, resourceFile string) ([]map[string]interface{}, error)
- func CreateFromManifest(ctx context.Context, client klient.Client, resourceBytes []byte) ([]map[string]interface{}, error)
- func CreateKubernetesDomain(ctx context.Context, spec *KubernetesSpec) (types.Domain, error)
- func DestroyAllResources(ctx context.Context, client klient.Client, collections map[string]interface{}, ...) error
- func EvaluateWait(waitPayload Wait) error
- func GetResourcesDynamically(ctx context.Context, resource *ResourceRule) ([]map[string]interface{}, error)
- func QueryCluster(ctx context.Context, resources []Resource) (map[string]interface{}, error)
- func WaitForCondition(condition string, namespace string, timeout string, args ...string) (err error)
- func WaitForExistence(kind string, namespace string, timeout time.Duration) (err error)
- type CreateResource
- type Field
- type FieldType
- type KubernetesDomain
- type KubernetesSpec
- type Resource
- type ResourceRule
- type Wait
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateE2E ¶ added in v0.4.0
func CreateE2E(ctx context.Context, resources []CreateResource) (map[string]interface{}, error)
CreateE2E() creates the test resources, reads status, and destroys them
func CreateFromFile ¶ added in v0.4.0
func CreateFromFile(ctx context.Context, client klient.Client, resourceFile string) ([]map[string]interface{}, error)
CreateResourceFromFile() creates the resource from a file
func CreateFromManifest ¶ added in v0.4.0
func CreateFromManifest(ctx context.Context, client klient.Client, resourceBytes []byte) ([]map[string]interface{}, error)
CreateResourceFromManifest() creates the resource from the manifest string
func CreateKubernetesDomain ¶ added in v0.6.0
func DestroyAllResources ¶ added in v0.4.0
func DestroyAllResources(ctx context.Context, client klient.Client, collections map[string]interface{}, namespaces []string) error
DestroyAllResources() removes all the created resources
func EvaluateWait ¶
This is specific to Lula - Check if we need to execute any wait operations.
func GetResourcesDynamically ¶
func GetResourcesDynamically(ctx context.Context, resource *ResourceRule) ( []map[string]interface{}, error)
GetResourcesDynamically() requires a dynamic interface and processes GVR to return []map[string]interface{} This function is used to query the cluster for specific subset of resources required for processing
func QueryCluster ¶
QueryCluster() requires context and a Payload as input and returns []unstructured.Unstructured This function is used to query the cluster for all resources required for processing
Types ¶
type CreateResource ¶ added in v0.4.0
type Field ¶
type FieldType ¶
type FieldType string
const ( FieldTypeJSON FieldType = "json" FieldTypeYAML FieldType = "yaml" DefaultFieldType FieldType = FieldTypeJSON )
type KubernetesDomain ¶
type KubernetesDomain struct { // Context is the context that Kubernetes resources are being evaluated in Context context.Context `json:"context" yaml:"context"` // Spec is the specification of the Kubernetes resources Spec *KubernetesSpec `json:"spec,omitempty" yaml:"spec,omitempty"` }
func (KubernetesDomain) GetResources ¶
func (k KubernetesDomain) GetResources() (resources types.DomainResources, err error)
func (KubernetesDomain) IsExecutable ¶ added in v0.4.0
func (k KubernetesDomain) IsExecutable() bool
type KubernetesSpec ¶
type KubernetesSpec struct { Resources []Resource `json:"resources" yaml:"resources"` Wait *Wait `json:"wait,omitempty" yaml:"wait,omitempty"` CreateResources []CreateResource `json:"create-resources" yaml:"create-resources"` }
type Resource ¶
type Resource struct { Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` ResourceRule *ResourceRule `json:"resource-rule,omitempty" yaml:"resource-rule,omitempty"` }
type ResourceRule ¶
type ResourceRule struct { Name string `json:"name" yaml:"name"` Group string `json:"group" yaml:"group"` Version string `json:"version" yaml:"version"` Resource string `json:"resource" yaml:"resource"` Namespaces []string `json:"namespaces" yaml:"namespaces"` Field *Field `json:"field,omitempty" yaml:"field,omitempty"` }