certmanager

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: AGPL-3.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCertificateReady added in v0.0.2

func IsCertificateReady(certificate *certmanagerv1.Certificate) bool

func IsIssuerReady added in v0.0.2

func IsIssuerReady(issuerStatus *certmanagerv1.IssuerStatus) bool

Types

type Client

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

func NewClient

func NewClient(config *rest.Config) (*Client, error)

func (*Client) CreateCertificate

func (cmc *Client) CreateCertificate(ctx *contexts.Context, namespace, name string, issuerRef cmmeta.IssuerReference, opts CreateCertificateOptions) (*certmanagerv1.Certificate, error)

func (*Client) CreateIssuer

func (cmc *Client) CreateIssuer(ctx *contexts.Context, namespace, name string, config certmanagerv1.IssuerConfig, opts CreateIssuerOptions) (*certmanagerv1.Issuer, error)

CreateIssuer creates a cert-manager Issuer with the given config. The config is the discriminated union cert-manager uses to choose the issuer's backend, e.g. certmanagerv1.IssuerConfig{CA: &certmanagerv1.CAIssuer{SecretName: …}} for a CA issuer backed by a certificate secret, or certmanagerv1.IssuerConfig{SelfSigned: &certmanagerv1.SelfSignedIssuer{}} for a self-signed root.

func (*Client) DeleteCertificate

func (cmc *Client) DeleteCertificate(ctx *contexts.Context, namespace, name string) error

func (*Client) DeleteIssuer

func (cmc *Client) DeleteIssuer(ctx *contexts.Context, namespace, name string) error

func (*Client) GetCertificate added in v0.0.2

func (cmc *Client) GetCertificate(ctx *contexts.Context, namespace, name string) (*certmanagerv1.Certificate, error)

func (*Client) GetClusterIssuer added in v0.0.7

func (cmc *Client) GetClusterIssuer(ctx *contexts.Context, name string) (*certmanagerv1.ClusterIssuer, error)

func (*Client) GetIssuer added in v0.0.2

func (cmc *Client) GetIssuer(ctx *contexts.Context, namespace, name string) (*certmanagerv1.Issuer, error)

func (*Client) ReissueCertificate

func (cmc *Client) ReissueCertificate(ctx *contexts.Context, namespace, name string) (certificate *certmanagerv1.Certificate, err error)

Trigger an immediate re-issuance of a certificate

func (*Client) WaitForReadyCertificate

func (cmc *Client) WaitForReadyCertificate(ctx *contexts.Context, namespace, name string, opts WaitForReadyCertificateOpts) (certificate *certmanagerv1.Certificate, err error)

func (*Client) WaitForReadyIssuer

func (cmc *Client) WaitForReadyIssuer(ctx *contexts.Context, namespace, name string, opts WaitForReadyIssuerOpts) (issuer *certmanagerv1.Issuer, err error)

type ClientInterface

type ClientInterface interface {
	// Issuers
	CreateIssuer(ctx *contexts.Context, namespace, name string, config certmanagerv1.IssuerConfig, opts CreateIssuerOptions) (*certmanagerv1.Issuer, error)
	WaitForReadyIssuer(ctx *contexts.Context, namespace, name string, opts WaitForReadyIssuerOpts) (*certmanagerv1.Issuer, error)
	GetIssuer(ctx *contexts.Context, namespace, name string) (*certmanagerv1.Issuer, error)
	DeleteIssuer(ctx *contexts.Context, namespace, name string) error
	// Cluster issuers
	GetClusterIssuer(ctx *contexts.Context, name string) (*certmanagerv1.ClusterIssuer, error)
	// Certificates
	CreateCertificate(ctx *contexts.Context, namespace, name string, issuerRef cmmeta.IssuerReference, opts CreateCertificateOptions) (*certmanagerv1.Certificate, error)
	WaitForReadyCertificate(ctx *contexts.Context, namespace, name string, opts WaitForReadyCertificateOpts) (*certmanagerv1.Certificate, error)
	ReissueCertificate(ctx *contexts.Context, namespace, name string) (*certmanagerv1.Certificate, error)
	GetCertificate(ctx *contexts.Context, namespace, name string) (*certmanagerv1.Certificate, error)
	DeleteCertificate(ctx *contexts.Context, namespace, name string) error
}

type CreateCertificateOptions

type CreateCertificateOptions struct {
	helpers.GenerateName
	IsCA          bool
	CAConstraints *certmanagerv1.NameConstraints
	CommonName    string
	DNSNames      []string
	Duration      *time.Duration
	SecretLabels  map[string]string
	SecretName    string
	Usages        []certmanagerv1.KeyUsage
	KeyAlgorithm  certmanagerv1.PrivateKeyAlgorithm
}

type CreateIssuerOptions

type CreateIssuerOptions struct {
	helpers.GenerateName
}

type MockClientInterface

type MockClientInterface struct {
	mock.Mock
}

MockClientInterface is an autogenerated mock type for the ClientInterface type

func NewMockClientInterface

func NewMockClientInterface(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockClientInterface

NewMockClientInterface creates a new instance of MockClientInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockClientInterface) CreateCertificate

func (_m *MockClientInterface) CreateCertificate(ctx *contexts.Context, namespace string, name string, issuerRef v1.IssuerReference, opts CreateCertificateOptions) (*certmanagerv1.Certificate, error)

CreateCertificate provides a mock function with given fields: ctx, namespace, name, issuerRef, opts

func (*MockClientInterface) CreateIssuer

func (_m *MockClientInterface) CreateIssuer(ctx *contexts.Context, namespace string, name string, config certmanagerv1.IssuerConfig, opts CreateIssuerOptions) (*certmanagerv1.Issuer, error)

CreateIssuer provides a mock function with given fields: ctx, namespace, name, config, opts

func (*MockClientInterface) DeleteCertificate

func (_m *MockClientInterface) DeleteCertificate(ctx *contexts.Context, namespace string, name string) error

DeleteCertificate provides a mock function with given fields: ctx, namespace, name

func (*MockClientInterface) DeleteIssuer

func (_m *MockClientInterface) DeleteIssuer(ctx *contexts.Context, namespace string, name string) error

DeleteIssuer provides a mock function with given fields: ctx, namespace, name

func (*MockClientInterface) EXPECT

func (*MockClientInterface) GetCertificate added in v0.0.2

func (_m *MockClientInterface) GetCertificate(ctx *contexts.Context, namespace string, name string) (*certmanagerv1.Certificate, error)

GetCertificate provides a mock function with given fields: ctx, namespace, name

func (*MockClientInterface) GetClusterIssuer added in v0.0.7

func (_m *MockClientInterface) GetClusterIssuer(ctx *contexts.Context, name string) (*certmanagerv1.ClusterIssuer, error)

GetClusterIssuer provides a mock function with given fields: ctx, name

func (*MockClientInterface) GetIssuer added in v0.0.2

func (_m *MockClientInterface) GetIssuer(ctx *contexts.Context, namespace string, name string) (*certmanagerv1.Issuer, error)

GetIssuer provides a mock function with given fields: ctx, namespace, name

func (*MockClientInterface) ReissueCertificate

func (_m *MockClientInterface) ReissueCertificate(ctx *contexts.Context, namespace string, name string) (*certmanagerv1.Certificate, error)

ReissueCertificate provides a mock function with given fields: ctx, namespace, name

func (*MockClientInterface) WaitForReadyCertificate

func (_m *MockClientInterface) WaitForReadyCertificate(ctx *contexts.Context, namespace string, name string, opts WaitForReadyCertificateOpts) (*certmanagerv1.Certificate, error)

WaitForReadyCertificate provides a mock function with given fields: ctx, namespace, name, opts

func (*MockClientInterface) WaitForReadyIssuer

func (_m *MockClientInterface) WaitForReadyIssuer(ctx *contexts.Context, namespace string, name string, opts WaitForReadyIssuerOpts) (*certmanagerv1.Issuer, error)

WaitForReadyIssuer provides a mock function with given fields: ctx, namespace, name, opts

type MockClientInterface_CreateCertificate_Call

type MockClientInterface_CreateCertificate_Call struct {
	*mock.Call
}

MockClientInterface_CreateCertificate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateCertificate'

func (*MockClientInterface_CreateCertificate_Call) Return

func (*MockClientInterface_CreateCertificate_Call) Run

type MockClientInterface_CreateIssuer_Call

type MockClientInterface_CreateIssuer_Call struct {
	*mock.Call
}

MockClientInterface_CreateIssuer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateIssuer'

func (*MockClientInterface_CreateIssuer_Call) Return

func (*MockClientInterface_CreateIssuer_Call) Run

type MockClientInterface_DeleteCertificate_Call

type MockClientInterface_DeleteCertificate_Call struct {
	*mock.Call
}

MockClientInterface_DeleteCertificate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteCertificate'

func (*MockClientInterface_DeleteCertificate_Call) Return

func (*MockClientInterface_DeleteCertificate_Call) Run

func (*MockClientInterface_DeleteCertificate_Call) RunAndReturn

type MockClientInterface_DeleteIssuer_Call

type MockClientInterface_DeleteIssuer_Call struct {
	*mock.Call
}

MockClientInterface_DeleteIssuer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteIssuer'

func (*MockClientInterface_DeleteIssuer_Call) Return

func (*MockClientInterface_DeleteIssuer_Call) Run

func (*MockClientInterface_DeleteIssuer_Call) RunAndReturn

type MockClientInterface_Expecter

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

func (*MockClientInterface_Expecter) CreateCertificate

func (_e *MockClientInterface_Expecter) CreateCertificate(ctx interface{}, namespace interface{}, name interface{}, issuerRef interface{}, opts interface{}) *MockClientInterface_CreateCertificate_Call

CreateCertificate is a helper method to define mock.On call

  • ctx *contexts.Context
  • namespace string
  • name string
  • issuerRef v1.IssuerReference
  • opts CreateCertificateOptions

func (*MockClientInterface_Expecter) CreateIssuer

func (_e *MockClientInterface_Expecter) CreateIssuer(ctx interface{}, namespace interface{}, name interface{}, config interface{}, opts interface{}) *MockClientInterface_CreateIssuer_Call

CreateIssuer is a helper method to define mock.On call

  • ctx *contexts.Context
  • namespace string
  • name string
  • config certmanagerv1.IssuerConfig
  • opts CreateIssuerOptions

func (*MockClientInterface_Expecter) DeleteCertificate

func (_e *MockClientInterface_Expecter) DeleteCertificate(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_DeleteCertificate_Call

DeleteCertificate is a helper method to define mock.On call

  • ctx *contexts.Context
  • namespace string
  • name string

func (*MockClientInterface_Expecter) DeleteIssuer

func (_e *MockClientInterface_Expecter) DeleteIssuer(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_DeleteIssuer_Call

DeleteIssuer is a helper method to define mock.On call

  • ctx *contexts.Context
  • namespace string
  • name string

func (*MockClientInterface_Expecter) GetCertificate added in v0.0.2

func (_e *MockClientInterface_Expecter) GetCertificate(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_GetCertificate_Call

GetCertificate is a helper method to define mock.On call

  • ctx *contexts.Context
  • namespace string
  • name string

func (*MockClientInterface_Expecter) GetClusterIssuer added in v0.0.7

func (_e *MockClientInterface_Expecter) GetClusterIssuer(ctx interface{}, name interface{}) *MockClientInterface_GetClusterIssuer_Call

GetClusterIssuer is a helper method to define mock.On call

  • ctx *contexts.Context
  • name string

func (*MockClientInterface_Expecter) GetIssuer added in v0.0.2

func (_e *MockClientInterface_Expecter) GetIssuer(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_GetIssuer_Call

GetIssuer is a helper method to define mock.On call

  • ctx *contexts.Context
  • namespace string
  • name string

func (*MockClientInterface_Expecter) ReissueCertificate

func (_e *MockClientInterface_Expecter) ReissueCertificate(ctx interface{}, namespace interface{}, name interface{}) *MockClientInterface_ReissueCertificate_Call

ReissueCertificate is a helper method to define mock.On call

  • ctx *contexts.Context
  • namespace string
  • name string

func (*MockClientInterface_Expecter) WaitForReadyCertificate

func (_e *MockClientInterface_Expecter) WaitForReadyCertificate(ctx interface{}, namespace interface{}, name interface{}, opts interface{}) *MockClientInterface_WaitForReadyCertificate_Call

WaitForReadyCertificate is a helper method to define mock.On call

  • ctx *contexts.Context
  • namespace string
  • name string
  • opts WaitForReadyCertificateOpts

func (*MockClientInterface_Expecter) WaitForReadyIssuer

func (_e *MockClientInterface_Expecter) WaitForReadyIssuer(ctx interface{}, namespace interface{}, name interface{}, opts interface{}) *MockClientInterface_WaitForReadyIssuer_Call

WaitForReadyIssuer is a helper method to define mock.On call

  • ctx *contexts.Context
  • namespace string
  • name string
  • opts WaitForReadyIssuerOpts

type MockClientInterface_GetCertificate_Call added in v0.0.2

type MockClientInterface_GetCertificate_Call struct {
	*mock.Call
}

MockClientInterface_GetCertificate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCertificate'

func (*MockClientInterface_GetCertificate_Call) Return added in v0.0.2

func (*MockClientInterface_GetCertificate_Call) Run added in v0.0.2

func (*MockClientInterface_GetCertificate_Call) RunAndReturn added in v0.0.2

type MockClientInterface_GetClusterIssuer_Call added in v0.0.7

type MockClientInterface_GetClusterIssuer_Call struct {
	*mock.Call
}

MockClientInterface_GetClusterIssuer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClusterIssuer'

func (*MockClientInterface_GetClusterIssuer_Call) Return added in v0.0.7

func (*MockClientInterface_GetClusterIssuer_Call) Run added in v0.0.7

func (*MockClientInterface_GetClusterIssuer_Call) RunAndReturn added in v0.0.7

type MockClientInterface_GetIssuer_Call added in v0.0.2

type MockClientInterface_GetIssuer_Call struct {
	*mock.Call
}

MockClientInterface_GetIssuer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIssuer'

func (*MockClientInterface_GetIssuer_Call) Return added in v0.0.2

func (*MockClientInterface_GetIssuer_Call) Run added in v0.0.2

func (*MockClientInterface_GetIssuer_Call) RunAndReturn added in v0.0.2

type MockClientInterface_ReissueCertificate_Call

type MockClientInterface_ReissueCertificate_Call struct {
	*mock.Call
}

MockClientInterface_ReissueCertificate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReissueCertificate'

func (*MockClientInterface_ReissueCertificate_Call) Return

func (*MockClientInterface_ReissueCertificate_Call) Run

func (*MockClientInterface_ReissueCertificate_Call) RunAndReturn

type MockClientInterface_WaitForReadyCertificate_Call

type MockClientInterface_WaitForReadyCertificate_Call struct {
	*mock.Call
}

MockClientInterface_WaitForReadyCertificate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForReadyCertificate'

func (*MockClientInterface_WaitForReadyCertificate_Call) Return

func (*MockClientInterface_WaitForReadyCertificate_Call) Run

type MockClientInterface_WaitForReadyIssuer_Call

type MockClientInterface_WaitForReadyIssuer_Call struct {
	*mock.Call
}

MockClientInterface_WaitForReadyIssuer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForReadyIssuer'

func (*MockClientInterface_WaitForReadyIssuer_Call) Return

func (*MockClientInterface_WaitForReadyIssuer_Call) Run

type WaitForReadyCertificateOpts

type WaitForReadyCertificateOpts struct {
	helpers.MaxWaitTime
}

type WaitForReadyIssuerOpts

type WaitForReadyIssuerOpts struct {
	helpers.MaxWaitTime
}

Jump to

Keyboard shortcuts

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