Documentation ¶
Index ¶
- Constants
- func Into(provider string, from map[string][]byte, to map[string]string) error
- func Patch(ctx context.Context, cl client.Client, obj client.Object) error
- func PatchStatus(ctx context.Context, cl client.Client, obj client.Object) error
- type B64
- type DefaultSynchronizer
- type List
- type Mapping
- type ProviderSync
- type Raw
- type SecretMapperSync
- type SecretSync
- type Sync
- type Template
Constants ¶
const ( // RancherCredentialsNamespace is the default namespace for // cloud provider credentials. RancherCredentialsNamespace = "cattle-global-data" // NameAnnotation is the annotation key for the cloud credential secret name. NameAnnotation = "field.cattle.io/name" // DriverNameAnnotation is the annotation key for the cloud provider driver name. DriverNameAnnotation = "provisioning.cattle.io/driver" )
Variables ¶
This section is empty.
Functions ¶
func Into ¶ added in v0.5.0
Into maps the secret keys from source secret data according to credentials map.
Types ¶
type B64 ¶ added in v0.5.0
type B64 struct {
// contains filtered or unexported fields
}
B64 is a structure for encoding a secret key as base64.
type DefaultSynchronizer ¶
type DefaultSynchronizer struct { Source *turtlesv1.CAPIProvider Destination client.Object // contains filtered or unexported fields }
DefaultSynchronizer is a structure mirroring state of the CAPI Operator Provider object.
func NewDefaultSynchronizer ¶
func NewDefaultSynchronizer(cl client.Client, capiProvider *turtlesv1.CAPIProvider, destination client.Object) *DefaultSynchronizer
NewDefaultSynchronizer returns a new instance of DefaultSynchronizer.
type List ¶
type List []Sync
List contains a list of syncers to apply the syncing logic.
type Mapping ¶ added in v0.5.0
type Mapping struct {
// contains filtered or unexported fields
}
Mapping defines a mapping between a source and destination secret keys.
type ProviderSync ¶
type ProviderSync struct { *DefaultSynchronizer Destination api.Provider }
ProviderSync is a structure mirroring state of the CAPI Operator Provider object.
func (*ProviderSync) Sync ¶
func (s *ProviderSync) Sync(_ context.Context) error
Sync updates the mirror object state from the upstream source object Direction of updates: Spec -> down up <- Status.
func (*ProviderSync) SyncObjects ¶
func (s *ProviderSync) SyncObjects()
SyncObjects updates the Source CAPIProvider object and the destination provider object states. Direction of updates: Spec -> <Common>Provider CAPIProvider <- Status.
func (ProviderSync) Template ¶
func (ProviderSync) Template(capiProvider *turtlesv1.CAPIProvider) client.Object
Template returning the mirrored CAPI Operator manifest template.
type Raw ¶ added in v0.5.0
type Raw struct {
// contains filtered or unexported fields
}
Raw is a structure for storing a secret key without encoding.
type SecretMapperSync ¶ added in v0.5.0
type SecretMapperSync struct { *SecretSync RancherSecret *corev1.Secret }
SecretMapperSync is a structure mirroring variable secret state of the Rancher secret data.
func (*SecretMapperSync) Get ¶ added in v0.5.0
func (s *SecretMapperSync) Get(ctx context.Context) error
Get retrieves the source Rancher secret and destenation secret.
func (SecretMapperSync) GetSecret ¶ added in v0.5.0
func (SecretMapperSync) GetSecret(capiProvider *turtlesv1.CAPIProvider) *corev1.Secret
GetSecret returning the source secret resource template.
func (*SecretMapperSync) Sync ¶ added in v0.5.0
func (s *SecretMapperSync) Sync(ctx context.Context) error
Sync updates the credentials secret with required values from rancher manager secret.
func (SecretMapperSync) Template ¶ added in v0.5.0
func (SecretMapperSync) Template(capiProvider *turtlesv1.CAPIProvider) client.Object
Template returning the mirrored secret resource template.
type SecretSync ¶
type SecretSync struct { *DefaultSynchronizer Secret *corev1.Secret }
SecretSync is a structure mirroring variable secret state of the CAPI Operator Provider object.
func (SecretSync) GetSecret ¶
func (SecretSync) GetSecret(capiProvider *turtlesv1.CAPIProvider) *corev1.Secret
GetSecret returning the mirrored secret resource template.
func (*SecretSync) Sync ¶
func (s *SecretSync) Sync(_ context.Context) error
Sync updates the mirror object state from the upstream source object Direction of updates: Spec -> down up <- Status.
func (*SecretSync) SyncObjects ¶
func (s *SecretSync) SyncObjects()
SyncObjects updates the Source CAPIProvider object and the environment secret state. Direction of updates: Spec.Features + Spec.Variables -> Status.Variables -> Secret.
func (SecretSync) Template ¶
func (SecretSync) Template(capiProvider *turtlesv1.CAPIProvider) client.Object
Template returning the mirrored secret resource template.
type Sync ¶
type Sync interface { Template(source *turtlesv1.CAPIProvider) client.Object Get(ctx context.Context) error Sync(ctx context.Context) error Apply(ctx context.Context, reterr *error) }
Sync is an inteface for mirroring state of the CAPI Operator Provider object on child objects.
func NewProviderSync ¶
func NewProviderSync(cl client.Client, capiProvider *turtlesv1.CAPIProvider) Sync
NewProviderSync creates a new mirror object.
func NewSecretMapperSync ¶ added in v0.5.0
func NewSecretMapperSync(ctx context.Context, cl client.Client, capiProvider *turtlesv1.CAPIProvider) Sync
NewSecretMapperSync creates a new secret mapper object sync.
func NewSecretSync ¶
func NewSecretSync(cl client.Client, capiProvider *turtlesv1.CAPIProvider) Sync
NewSecretSync creates a new secret object sync.