Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrCertManagerCRDsNotFound = fmt.Errorf("the cert-manager CRDs are not yet installed on the Kubernetes API server") ErrVersionNotDetected = fmt.Errorf("could not detect the cert-manager version") ErrMultipleVersionsDetected = fmt.Errorf("detect multiple different cert-manager versions") )
Functions ¶
This section is empty.
Types ¶
type VersionChecker ¶
type VersionChecker struct {
// contains filtered or unexported fields
}
VersionChecker implements a version checker using a controller-runtime client
func New ¶
New returns a cert-manager version checker. Prefer New over NewFromClient since New will ensure the scheme is configured correctly.
func NewFromClient ¶
func NewFromClient(cl client.Client) *VersionChecker
NewFromClient initialises a VersionChecker using the given client. Prefer New instead, which will ensure that the scheme on the client is configured correctly.
func (*VersionChecker) Version ¶
func (o *VersionChecker) Version(ctx context.Context) (*Version, error)
Version determines the installed cert-manager version. First, we look for the "certificates.cert-manager.io" CRD and try to extract the version from that resource's labels. Then, if it uses a webhook, that webhook service resource's labels are checked for a label. Lastly the pods linked to the webhook its labels are checked and the image tag is used to determine the version. If no "certificates.cert-manager.io" CRD is found, the older "certificates.certmanager.k8s.io" CRD is tried too.