Documentation ¶
Index ¶
- Constants
- type ReferenceNotFound
- type Resolver
- func (r *Resolver) ResolveAll(ctx context.Context, metaObject genruntime.MetaObject) (ResourceHierarchy, genruntime.ConvertToARMResolvedDetails, error)
- func (r *Resolver) ResolveOwner(ctx context.Context, obj genruntime.MetaObject) (genruntime.MetaObject, error)
- func (r *Resolver) ResolveReference(ctx context.Context, ref genruntime.NamespacedResourceReference) (genruntime.MetaObject, error)
- func (r *Resolver) ResolveReferenceToARMID(ctx context.Context, ref genruntime.NamespacedResourceReference) (string, error)
- func (r *Resolver) ResolveReferencesToARMIDs(ctx context.Context, refs map[genruntime.NamespacedResourceReference]struct{}) (genruntime.ResolvedReferences, error)
- func (r *Resolver) ResolveResourceHierarchy(ctx context.Context, obj genruntime.MetaObject) (ResourceHierarchy, error)
- func (r *Resolver) ResolveResourceReferences(ctx context.Context, metaObject genruntime.MetaObject) (genruntime.ResolvedReferences, error)
- func (r *Resolver) ResolveResourceSecretReferences(ctx context.Context, metaObject genruntime.MetaObject) (genruntime.ResolvedSecrets, error)
- func (r *Resolver) ResolveSecretReferences(ctx context.Context, refs map[genruntime.NamespacedSecretReference]struct{}) (genruntime.ResolvedSecrets, error)
- func (r *Resolver) Scheme() *runtime.Scheme
- type ResourceHierarchy
- func (h ResourceHierarchy) AzureName() string
- func (h ResourceHierarchy) FullyQualifiedARMID(subscriptionID string) (string, error)
- func (h ResourceHierarchy) Location() (string, error)
- func (h ResourceHierarchy) ResourceGroup() (string, error)
- func (h ResourceHierarchy) RootKind() ResourceHierarchyRoot
- type ResourceHierarchyRoot
- type SecretNotFound
- type SecretResolver
Constants ¶
const ( ResourceHierarchyRootResourceGroup = ResourceHierarchyRoot("ResourceGroup") ResourceHierarchyRootSubscription = ResourceHierarchyRoot("Subscription") )
const ResourceGroupGroup = "resources.azure.com"
const ResourceGroupKind = "ResourceGroup"
If we wanted to type-assert we'd have to solve some circular dependency problems... for now this is ok.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReferenceNotFound ¶
type ReferenceNotFound struct { NamespacedName types.NamespacedName // contains filtered or unexported fields }
func NewReferenceNotFoundError ¶
func NewReferenceNotFoundError(name types.NamespacedName, cause error) *ReferenceNotFound
func (*ReferenceNotFound) Cause ¶
func (e *ReferenceNotFound) Cause() error
func (*ReferenceNotFound) Error ¶
func (e *ReferenceNotFound) Error() string
func (*ReferenceNotFound) Is ¶
func (e *ReferenceNotFound) Is(err error) bool
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver(client kubeclient.Client, reconciledResourceLookup map[schema.GroupKind]schema.GroupVersionKind) *Resolver
func (*Resolver) ResolveAll ¶
func (r *Resolver) ResolveAll(ctx context.Context, metaObject genruntime.MetaObject) (ResourceHierarchy, genruntime.ConvertToARMResolvedDetails, error)
ResolveAll resolves every reference on the provided genruntime.MetaObject. This includes: owner, all resource references, and all secrets.
func (*Resolver) ResolveOwner ¶
func (r *Resolver) ResolveOwner(ctx context.Context, obj genruntime.MetaObject) (genruntime.MetaObject, error)
ResolveOwner returns the MetaObject for the given resources owner. If the resource is supposed to have an owner but doesn't, this returns an ReferenceNotFound error. If the resource is not supposed to have an owner (for example, ResourceGroup), returns nil.
func (*Resolver) ResolveReference ¶
func (r *Resolver) ResolveReference(ctx context.Context, ref genruntime.NamespacedResourceReference) (genruntime.MetaObject, error)
ResolveReference resolves a reference, or returns an error if the reference is not pointing to a KubernetesResource
func (*Resolver) ResolveReferenceToARMID ¶
func (r *Resolver) ResolveReferenceToARMID(ctx context.Context, ref genruntime.NamespacedResourceReference) (string, error)
ResolveReferenceToARMID gets a references ARM ID. If the reference is just pointing to an ARM resource then the ARMID is returned. If the reference is pointing to a Kubernetes resource, that resource is looked up and its ARM ID is computed.
func (*Resolver) ResolveReferencesToARMIDs ¶
func (r *Resolver) ResolveReferencesToARMIDs(ctx context.Context, refs map[genruntime.NamespacedResourceReference]struct{}) (genruntime.ResolvedReferences, error)
ResolveReferencesToARMIDs resolves all provided references to their ARM IDs.
func (*Resolver) ResolveResourceHierarchy ¶
func (r *Resolver) ResolveResourceHierarchy(ctx context.Context, obj genruntime.MetaObject) (ResourceHierarchy, error)
ResolveResourceHierarchy gets the resource hierarchy for a given resource. The result is a slice of resources, with the uppermost parent at position 0 and the resource itself at position len(slice)-1
func (*Resolver) ResolveResourceReferences ¶
func (r *Resolver) ResolveResourceReferences(ctx context.Context, metaObject genruntime.MetaObject) (genruntime.ResolvedReferences, error)
ResolveResourceReferences resolves every reference found on the specified genruntime.MetaObject to its corresponding ARM ID.
func (*Resolver) ResolveResourceSecretReferences ¶
func (r *Resolver) ResolveResourceSecretReferences(ctx context.Context, metaObject genruntime.MetaObject) (genruntime.ResolvedSecrets, error)
ResolveResourceSecretReferences resolves all of the specified genruntime.MetaObject's secret references.
func (*Resolver) ResolveSecretReferences ¶
func (r *Resolver) ResolveSecretReferences( ctx context.Context, refs map[genruntime.NamespacedSecretReference]struct{}) (genruntime.ResolvedSecrets, error)
ResolveSecretReferences resolves all provided secret references
type ResourceHierarchy ¶
type ResourceHierarchy []genruntime.MetaObject
func (ResourceHierarchy) AzureName ¶
func (h ResourceHierarchy) AzureName() string
AzureName returns the Azure name for use in creating a resource.
func (ResourceHierarchy) FullyQualifiedARMID ¶
func (h ResourceHierarchy) FullyQualifiedARMID(subscriptionID string) (string, error)
FullyQualifiedARMID returns the fully qualified ARM ID of the resource
func (ResourceHierarchy) Location ¶
func (h ResourceHierarchy) Location() (string, error)
Location returns the location root of the hierarchy, or an error if the root is not a subscription.
func (ResourceHierarchy) ResourceGroup ¶
func (h ResourceHierarchy) ResourceGroup() (string, error)
ResourceGroup returns the resource group that the hierarchy is in, or an error if the hierarchy is not rooted in a resource group.
func (ResourceHierarchy) RootKind ¶
func (h ResourceHierarchy) RootKind() ResourceHierarchyRoot
type ResourceHierarchyRoot ¶
type ResourceHierarchyRoot string
type SecretNotFound ¶
type SecretNotFound struct { NamespacedName types.NamespacedName // contains filtered or unexported fields }
func NewSecretNotFoundError ¶
func NewSecretNotFoundError(name types.NamespacedName, cause error) *SecretNotFound
func (*SecretNotFound) Cause ¶
func (e *SecretNotFound) Cause() error
func (*SecretNotFound) Error ¶
func (e *SecretNotFound) Error() string
func (*SecretNotFound) Is ¶
func (e *SecretNotFound) Is(err error) bool
type SecretResolver ¶
type SecretResolver interface { ResolveSecretReference(ctx context.Context, ref genruntime.NamespacedSecretReference) (string, error) ResolveSecretReferences(ctx context.Context, refs map[genruntime.NamespacedSecretReference]struct{}) (genruntime.ResolvedSecrets, error) }
SecretResolver is a secret resolver
func NewKubeSecretResolver ¶
func NewKubeSecretResolver(client kubeclient.Client) SecretResolver