utils

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RatifyNamespaceEnvVar = "RATIFY_NAMESPACE"
)

Variables

This section is empty.

Functions

func CreatePlugin added in v1.2.0

func CreatePlugin(pluginName string) (string, error)

func CreateScheme added in v1.2.0

func CreateScheme() (*runtime.Scheme, error)

func GetCertificatesFromPath

func GetCertificatesFromPath(path string) ([]*x509.Certificate, error)

Return list of certificates loaded from path when path is a directory, this method loads all certs in directory and resolve symlink if needed

func GetNamespace

func GetNamespace() string

GetNamespace returns the namespace.

func GetServiceName

func GetServiceName() string

GetServiceName returns the service name.

func KeyFor added in v1.2.0

func KeyFor(obj client.Object) types.NamespacedName

func ParseDigest

func ParseDigest(digestStr string) (digest.Digest, error)

ParseDigest parses the given string and returns a validated Digest object.

func ParseSubjectReference

func ParseSubjectReference(subRef string) (common.Reference, error)

ParseSubjectReference parses the given subject and returns a valid reference

func ReplaceHomeShortcut

func ReplaceHomeShortcut(path string) string

Replace the shortcut prefix in a path with the home directory For example in a unix os, ~/.config/ becomes /home/azureuser/.config after replacement

func TrimSpaceAndToLower

func TrimSpaceAndToLower(input string) string

returns the string in lower case without leading and trailing space

Types

type MockResourceWriter added in v1.2.0

type MockResourceWriter struct {
	// contains filtered or unexported fields
}

func (MockResourceWriter) Create added in v1.2.0

func (MockResourceWriter) Patch added in v1.2.0

func (MockResourceWriter) Update added in v1.2.0

type MockStatusClient added in v1.2.0

type MockStatusClient struct {
	UpdateFailed bool
}

func (MockStatusClient) Status added in v1.2.0

type RequestKey added in v1.2.0

type RequestKey struct {
	// Subject is image name in the request key.
	Subject string
	// Namespace is the scope of the image.
	Namespace string
}

RequestKey is a structured external data request key.

func ParseRequestKey added in v1.2.0

func ParseRequestKey(key string) (RequestKey, error)

ParseRequestKey parses key string to a structured RequestKey object. Example 1: key: [gatekeeper-system]docker.io/test/hello:v1 match slice: ["[gatekeeper-system]docker.io/test/hello:v1" "[gatekeeper-system]" "gatekeeper-system" "docker.io/test/hello:v1"] Example 2: key: docker.io/test/hello:v1 match slice: ["docker.io/test/hello:v1" "" "" "docker.io/test/hello:v1"]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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