Documentation ¶
Index ¶
- Constants
- func SortSecretsInSchemaOrder(resources []*SecretPair)
- func SortSecretsInSchemaTemplateOrder(resources []*SecretPair)
- type EntryError
- type ExternalSecretLocation
- type Options
- func (o *Options) AddFlags(cmd *cobra.Command)
- func (o *Options) ExternalSecretByName(secretName string) (*v1.ExternalSecret, error)
- func (o *Options) Load() ([]*SecretPair, error)
- func (o *Options) Validate() error
- func (o *Options) Verify() ([]*SecretPair, error)
- func (o *Options) VerifyAndFilter() ([]*SecretPair, error)
- type SchemaOrder
- type SchemaTemplateOrder
- 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 ¶
const FileSystem string = "filesystem"
const Kubernetes string = "kubernetes"
Variables ¶
This section is empty.
Functions ¶
func SortSecretsInSchemaOrder ¶
func SortSecretsInSchemaOrder(resources []*SecretPair)
SortSecretsInSchemaOrder sorts the secrets in schema order with the entry with a schema with the most properties being first
func SortSecretsInSchemaTemplateOrder ¶
func SortSecretsInSchemaTemplateOrder(resources []*SecretPair)
SortSecretsInSchemaTemplateOrder sorts the secrets in schema order with the entry without template functions 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 ExternalSecretLocation ¶
type ExternalSecretLocation string
type Options ¶
type Options struct { options.BaseOptions Dir string Namespace string SecretNamespace string Filter string SecretClient extsecrets.Interface KubeClient kubernetes.Interface Source string SecretStoreManagerFactory secretstore.FactoryInterface // 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) ExternalSecretByName ¶
func (o *Options) ExternalSecretByName(secretName string) (*v1.ExternalSecret, error)
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 ¶
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 ¶
type SchemaOrder []*SecretPair
func (SchemaOrder) Len ¶
func (a SchemaOrder) Len() int
func (SchemaOrder) Less ¶
func (a SchemaOrder) Less(i, j int) bool
func (SchemaOrder) Swap ¶
func (a SchemaOrder) Swap(i, j int)
type SchemaTemplateOrder ¶
type SchemaTemplateOrder []*SecretPair
func (SchemaTemplateOrder) Len ¶
func (a SchemaTemplateOrder) Len() int
func (SchemaTemplateOrder) Less ¶
func (a SchemaTemplateOrder) Less(i, j int) bool
func (SchemaTemplateOrder) Swap ¶
func (a SchemaTemplateOrder) 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 ¶
func (p *SecretPair) IsInvalid() bool
IsInvalid returns true if the validation failed
func (*SecretPair) IsMandatory ¶
func (p *SecretPair) IsMandatory() bool
IsMandatory returns true if the secret is a mandatory secret
func (*SecretPair) Namespace ¶
func (p *SecretPair) Namespace() string
Namespace returns the namespace of the secret
func (*SecretPair) SchemaObject ¶
func (p *SecretPair) SchemaObject() (*schema.Object, error)
SchemaObject returns the optional schema object from the annotation
func (*SecretPair) SetSchemaObject ¶
func (p *SecretPair) SetSchemaObject(schemaObject *schema.Object)
SetSchemaObject sets the cached schema object: typically used for testing