test

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package test contains common logic used across the test suites in the falcoctl project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEmptyFile

func CreateEmptyFile(name string) (string, error)

CreateEmptyFile create a directory + file under /tmp.

func DependenciesFromReader

func DependenciesFromReader(descReader io.Reader) (*oci.ArtifactConfig, error)

DependenciesFromReader extracts oci.ArtifactConfig from a reader.

func FreePort

func FreePort() (int, error)

FreePort get a free port on the system by listening in a socket, checking the bound port number and then closing the socket.

func ImageIndexFromReader

func ImageIndexFromReader(descReader io.Reader) (*v1.Index, error)

ImageIndexFromReader extracts v1.Index from a reader.

func IndexFromReader

func IndexFromReader(descReader io.Reader) (*v1.Index, error)

IndexFromReader extracts a v1.Index from a reader.

func ManifestFromReader

func ManifestFromReader(descReader io.Reader) (*v1.Manifest, error)

ManifestFromReader extracts a v1.Manifest from a reader.

func NewOrasRegistry

func NewOrasRegistry(host string, plainHTTP bool) (*remote.Registry, error)

NewOrasRegistry creates a registry to interact with a remote OCI registry.

func StartRegistry

func StartRegistry(ctx context.Context, cfg *configuration.Configuration) error

StartRegistry starts a new OCI registry and returns it's address.

Types

type Layer

type Layer struct {
	Config   *oci.ArtifactConfig
	Manifest *v1.Manifest
}

Layer holds config and manifest for an artifact.

type PluginArtifact

type PluginArtifact struct {
	Descriptor *v1.Descriptor
	Index      *v1.Index
	Platforms  map[string]*Layer
	Tags       []string
}

PluginArtifact holds OCI metadata for a plugin artifact.

func FetchPluginFromRegistry

func FetchPluginFromRegistry(ctx context.Context, ref, tag string, orasRegistry *remote.Registry) (*PluginArtifact, error)

FetchPluginFromRegistry fetches metadata for a plugin artifact.

type RulesfileArtifact

type RulesfileArtifact struct {
	Descriptor *v1.Descriptor
	Layer      *Layer
	Tags       []string
}

RulesfileArtifact holds OCI metadata for a rulesfile artifact.

func FetchRulesfileFromRegistry

func FetchRulesfileFromRegistry(ctx context.Context, ref, tag string, orasRegistry *remote.Registry) (*RulesfileArtifact, error)

FetchRulesfileFromRegistry fetches metadata for a plugin artifact.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL