utils

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// ClusterDefault is the default cluster
	ClusterDefault = shared.ClusterDefault
	// ClusterTarget is the target cluster
	ClusterTarget = shared.ClusterTarget
)

Variables

This section is empty.

Functions

func AssureStringSlice added in v0.17.3

func AssureStringSlice(mod *abstract.ModificationState, dst *[]string, value []string)

AssureStringSlice handles modification of a string slice.

func BestDomainRange added in v0.12.0

func BestDomainRange(domain string, domainRanges []string) string

BestDomainRange returns best fitting domain range value or "".

func EqualStringSlice added in v0.17.3

func EqualStringSlice(a, b []string) bool

EqualStringSlice compares string slices.

func ExtractDomains added in v0.12.0

func ExtractDomains(spec *api.CertificateSpec) ([]string, error)

ExtractDomains collects CommonName and DNSNames directly from spec or from CSR. The first item is the common name if provided.

func IsInDomainRange

func IsInDomainRange(domain, domainRange string) bool

IsInDomainRange returns true if domain is in domain range.

func IsInDomainRanges

func IsInDomainRanges(domain string, domainRanges []string) bool

IsInDomainRanges returns true if domain is in domain ranges.

func LoggerFactory added in v0.17.6

func LoggerFactory(key client.ObjectKey, serial uint32) legobridge.LoggerInfof

LoggerFactory is the logger factory for DNS challenges.

func NormalizeDomainRange

func NormalizeDomainRange(domainRange string) string

NormalizeDomainRange normalizes domain to lower case, drops wildcard and suffix dot.

Types

type CertificateObject

type CertificateObject struct {
	resources.Object
}

CertificateObject encapsulates the certificate resource object.

func Certificate

func Certificate(o resources.Object) *CertificateObject

Certificate returns the certificate object

func (*CertificateObject) Certificate

func (o *CertificateObject) Certificate() *api.Certificate

Certificate casts the object to certificate.

func (*CertificateObject) SafeFirstDNSName added in v0.12.0

func (o *CertificateObject) SafeFirstDNSName() string

SafeFirstDNSName returns the first DNS name (common name if set) or "".

func (*CertificateObject) Spec

Spec returns the certificate spec

func (*CertificateObject) Status

Status returns the certificate status

type Cluster added in v0.12.0

type Cluster = shared.Cluster

Cluster is the cluster type

type IssuerKey added in v0.12.0

type IssuerKey struct {
	// contains filtered or unexported fields
}

IssuerKey provides cluster, name and namespace of an issuer

func NewDefaultClusterIssuerKey added in v0.12.0

func NewDefaultClusterIssuerKey(name string) IssuerKey

NewDefaultClusterIssuerKey creates key for an issuer on the default cluster

func NewIssuerKey added in v0.12.0

func NewIssuerKey(cluster Cluster, namespace, name string) IssuerKey

NewIssuerKey creates key for an issuer. namespace is ignored for default cluster

func (IssuerKey) Cluster added in v0.12.0

func (k IssuerKey) Cluster() Cluster

Cluster returns the issuer cluster

func (IssuerKey) ClusterName added in v0.12.0

func (k IssuerKey) ClusterName() string

ClusterName returns the cluster name

func (IssuerKey) Name added in v0.12.0

func (k IssuerKey) Name() string

Name returns the issuer name

func (IssuerKey) Namespace added in v0.12.0

func (k IssuerKey) Namespace() string

Namespace returns the issuer namespace (namespace is empty if it is on default cluster)

func (IssuerKey) NamespaceOrDefault added in v0.12.0

func (k IssuerKey) NamespaceOrDefault(def string) string

NamespaceOrDefault returns the issuer namespace or the given default if it is on default cluster

func (IssuerKey) ObjectName added in v0.12.0

func (k IssuerKey) ObjectName(def string) resources.ObjectName

ObjectName returns the object name for the issuer key. If it is on the default cluster, the given namespace is used.

func (IssuerKey) Secondary added in v0.16.0

func (k IssuerKey) Secondary() bool

Secondary returns true if it is a provided issuer from the default cluster ("secondary" cluster in the new wording).

func (IssuerKey) String added in v0.12.0

func (k IssuerKey) String() string

String returns the string representation

type IssuerKeySet added in v0.12.0

type IssuerKeySet map[IssuerKey]struct{}

IssuerKeySet is a set of IssuerKeys

func NewIssuerKeySet added in v0.12.0

func NewIssuerKeySet(keys ...IssuerKey) IssuerKeySet

NewIssuerKeySet creates a new set

func (IssuerKeySet) Add added in v0.12.0

func (s IssuerKeySet) Add(keys ...IssuerKey)

Add adds keys to the set

func (IssuerKeySet) Contains added in v0.12.0

func (s IssuerKeySet) Contains(key IssuerKey) bool

Contains checks if set contains the key

func (IssuerKeySet) Copy added in v0.12.0

func (s IssuerKeySet) Copy() IssuerKeySet

Copy creates a copy of the set

func (IssuerKeySet) Remove added in v0.12.0

func (s IssuerKeySet) Remove(key IssuerKey)

Remove removes a key from the set

type IssuerObject

type IssuerObject struct {
	resources.Object
}

IssuerObject encapsulates the issuer resource object.

func Issuer

func Issuer(o resources.Object) *IssuerObject

Issuer returns the issuer object.

func (*IssuerObject) Issuer

func (o *IssuerObject) Issuer() *api.Issuer

Issuer returns the issuer.

func (*IssuerObject) Spec

func (o *IssuerObject) Spec() *api.IssuerSpec

Spec returns the issuer resource object spec.

func (*IssuerObject) Status

func (o *IssuerObject) Status() *api.IssuerStatus

Status returns the issuer resource object status.

type IssuerSecretKey added in v0.12.0

type IssuerSecretKey struct {
	IssuerKey
}

IssuerSecretKey is the key for an issuer secret

func NewIssuerSecretKey added in v0.12.0

func NewIssuerSecretKey(cluster Cluster, namespace, name string) IssuerSecretKey

NewIssuerSecretKey creates key for an issuer secret. namespace is ignored for default cluster

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL