Documentation
¶
Index ¶
- Constants
- func CreatePlugin(pluginName string) (string, error)
- func CreateScheme() (*runtime.Scheme, error)
- func GetCertificatesFromPath(path string) ([]*x509.Certificate, error)
- func GetNamespace() string
- func GetServiceName() string
- func KeyFor(obj client.Object) types.NamespacedName
- func ParseDigest(digestStr string) (digest.Digest, error)
- func ParseSubjectReference(subRef string) (common.Reference, error)
- func ReplaceHomeShortcut(path string) string
- func TrimSpaceAndToLower(input string) string
- type MockResourceWriter
- func (w MockResourceWriter) Create(_ context.Context, _ client.Object, _ client.Object, ...) error
- func (w MockResourceWriter) Patch(_ context.Context, _ client.Object, _ client.Patch, ...) error
- func (w MockResourceWriter) Update(_ context.Context, _ client.Object, _ ...client.SubResourceUpdateOption) error
- type MockStatusClient
- type RequestKey
Constants ¶
const (
RatifyNamespaceEnvVar = "RATIFY_NAMESPACE"
)
Variables ¶
This section is empty.
Functions ¶
func CreatePlugin ¶
func CreateScheme ¶
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 ParseDigest ¶
ParseDigest parses the given string and returns a validated Digest object.
func ParseSubjectReference ¶
ParseSubjectReference parses the given subject and returns a valid reference
func ReplaceHomeShortcut ¶
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 ¶
returns the string in lower case without leading and trailing space
Types ¶
type MockResourceWriter ¶
type MockResourceWriter struct {
// contains filtered or unexported fields
}
func (MockResourceWriter) Create ¶
func (w MockResourceWriter) Create(_ context.Context, _ client.Object, _ client.Object, _ ...client.SubResourceCreateOption) error
func (MockResourceWriter) Patch ¶
func (w MockResourceWriter) Patch(_ context.Context, _ client.Object, _ client.Patch, _ ...client.SubResourcePatchOption) error
func (MockResourceWriter) Update ¶
func (w MockResourceWriter) Update(_ context.Context, _ client.Object, _ ...client.SubResourceUpdateOption) error
type MockStatusClient ¶
type MockStatusClient struct {
UpdateFailed bool
}
func (MockStatusClient) Status ¶
func (c MockStatusClient) Status() client.SubResourceWriter
type RequestKey ¶
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 ¶
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"]