Documentation ¶
Index ¶
- func SortSecretsInSchemaOrder(resources []*SecretPair)
- type EntryError
- type Options
- type SchemaOrder
- type SecretError
- type SecretPair
- func (p *SecretPair) IsInvalid() bool
- func (p *SecretPair) IsMandatory() bool
- func (p *SecretPair) Key() string
- func (p *SecretPair) Name() string
- func (p *SecretPair) Namespace() string
- func (p *SecretPair) SchemaObject() (*schema.Object, error)
- func (p *SecretPair) SetSchemaObject(schemaObject *schema.Object)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortSecretsInSchemaOrder ¶ added in v0.0.73
func SortSecretsInSchemaOrder(resources []*SecretPair)
SortSecretsInSchemaOrder sorts the secrets in schema order with the entry with a schema with the most properties being first
Types ¶
type EntryError ¶
type EntryError struct { // Key the secret key Key string // Properties property names for the key Properties []string }
EntryError represents the missing entries
type Options ¶
type Options struct { Dir string Namespace string SecretClient extsecrets.Interface KubeClient kubernetes.Interface // ExternalSecrets the loaded secrets ExternalSecrets []*v1.ExternalSecret // EditorCache the optional cache of editors EditorCache map[string]editor.Interface }
Options options for verifying secrets
func (*Options) Verify ¶
func (o *Options) Verify() ([]*SecretPair, error)
Verify loads the secrets and verifies which are valid to aid the edit/populate operations
func (*Options) VerifyAndFilter ¶ added in v0.0.71
func (o *Options) VerifyAndFilter() ([]*SecretPair, error)
VerifyAndFilter loads the secrets and verifies which are valid to aid the edit/populate operations then filters out any duplicate entries which are using the same underlying secret mappings.
e.g. if 2 secrets are populated to the same actual location then we can omit one of them since there's no need to write to the same location twice.
We prefer the secrets which have schemas associated and that have the most entries.
type SchemaOrder ¶ added in v0.0.73
type SchemaOrder []*SecretPair
func (SchemaOrder) Len ¶ added in v0.0.73
func (a SchemaOrder) Len() int
func (SchemaOrder) Less ¶ added in v0.0.73
func (a SchemaOrder) Less(i, j int) bool
func (SchemaOrder) Swap ¶ added in v0.0.73
func (a SchemaOrder) Swap(i, j int)
type SecretError ¶
type SecretError struct { // ExternalSecret the external secret which is not valid ExternalSecret v1.ExternalSecret // EntryErrors the errors for each secret entry EntryErrors []*EntryError }
SecretError returns an error for a secret
func VerifySecret ¶
func VerifySecret(es *v1.ExternalSecret, secret *corev1.Secret) (*SecretError, error)
VerifySecret verifies the secret
type SecretPair ¶
type SecretPair struct { // ExternalSecret the external secret which is not valid ExternalSecret v1.ExternalSecret // Secret the secret if there is one Secret *corev1.Secret // Error last validation error at last check Error *SecretError // contains filtered or unexported fields }
SecretPair the external secret and the associated Secret an error for a secret
func (*SecretPair) IsInvalid ¶ added in v0.0.61
func (p *SecretPair) IsInvalid() bool
IsInvalid returns true if the validation failed
func (*SecretPair) IsMandatory ¶ added in v0.0.61
func (p *SecretPair) IsMandatory() bool
IsMandatory returns true if the secret is a mandatory secret
func (*SecretPair) Key ¶ added in v0.0.73
func (p *SecretPair) Key() string
Key returns the unique key of the secret
func (*SecretPair) Name ¶ added in v0.0.73
func (p *SecretPair) Name() string
Name returns the name of the secret
func (*SecretPair) Namespace ¶ added in v0.0.73
func (p *SecretPair) Namespace() string
Namespace returns the namespace of the secret
func (*SecretPair) SchemaObject ¶ added in v0.0.69
func (p *SecretPair) SchemaObject() (*schema.Object, error)
SchemaObject returns the optional schema object from the annotation
func (*SecretPair) SetSchemaObject ¶ added in v0.0.73
func (p *SecretPair) SetSchemaObject(schemaObject *schema.Object)
SetSchemaObject sets the cached schema object: typically used for testing