Documentation
¶
Index ¶
- Constants
- func AddDistributionMeta(object client.Object, distro *api.Distribution)
- func DistributionFromIngress(class api.ObjectReference, ingress []corev1.LoadBalancerIngress) api.Distribution
- func GetDistributionClass(object client.Object) *api.ObjectReference
- func GetIngressHost(ingress []corev1.LoadBalancerIngress) string
- type Certificate
- type CertificateResolver
- type CertificateWrapper
- type DistributionClassReader
Constants ¶
const ( AnnotationDistributionClass = "cdn.redcoat.dev/distribution-class" AnnotationClusterDistributionClass = "cdn.redcoat.dev/cluster-distribution-class" )
Variables ¶
This section is empty.
Functions ¶
func AddDistributionMeta ¶
func AddDistributionMeta(object client.Object, distro *api.Distribution)
Adds the default metadata to the given Distribuition
This is only called at creation, and not on update so that third party annotations, finalizers, etc, are not cleared.
func DistributionFromIngress ¶
func DistributionFromIngress( class api.ObjectReference, ingress []corev1.LoadBalancerIngress, ) api.Distribution
Convienience function which returns a Distribution with default http and https ports set, and the host set from the given LoadBalancerIngress slice.
func GetDistributionClass ¶
func GetDistributionClass(object client.Object) *api.ObjectReference
Looks at the annotations on the given object and tries to determine the (Cluster)DistributionClass that is desired.
func GetIngressHost ¶
func GetIngressHost(ingress []corev1.LoadBalancerIngress) string
Checks to see if a LoadBalancerIngress[] resource has any values and uses this as the origin hostname if it does
Types ¶
type Certificate ¶
type Certificate struct { // The certificate on its own Certificate CertificateWrapper // Any certificates up the certification path for this certificate Chain []byte // The private key for this certificate Key []byte }
Holds a complete loaded and parsed certificate
type CertificateResolver ¶
This loads a certificate secret from the kubernetes api, performs serveral checks on it, and returns it as a parsed Certificate
func (*CertificateResolver) Resolve ¶
func (c *CertificateResolver) Resolve(secretRef client.ObjectKey) (*Certificate, error)
Loads the the secret given and parses it as a kubernetes.io/tls-secret
type CertificateWrapper ¶
type CertificateWrapper struct { Encoded []byte Parsed *x509.Certificate }
Holds the Original and Parsed representations of the certificate
type DistributionClassReader ¶
A DistributionClassReader is a kind of client.Reader which is tailored to loading DistributionClass resources from a given Object Reference
func (*DistributionClassReader) GetDistributionClassSpec ¶
func (r *DistributionClassReader) GetDistributionClassSpec( ctx context.Context, ref api.ObjectReference, obj client.Object, ) (*api.DistributionClassSpec, error)
Gets a DistributionClassSpec for the given Object Reference and calling Object
If it is not a cluster-scoped type, the Namespace of the given calling Object will be used in the query.