wrapper

package
v0.58.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSR

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

CSR wraps v1 and v1beta1 for convenient read/write. The one and only reason for this type is because there are 2 versions of CertificateSigningRequest that need to be supported and always checking version is not convenient. Note for future: no business logic should be added to this wrapper.

func NewCSR

func NewCSR(clientset kubernetes.Interface, csrObj interface{}) (*CSR, error)

NewCSR validates and creates new certificateRequestFacade.

func (*CSR) Approve

func (f *CSR) Approve(ctx context.Context, message string) error

Approve add approved condition to the CertificateRequest if it is not already approved.

func (*CSR) Approved

func (f *CSR) Approved() bool

Approved returns whether the CertificateRequest is approved.

func (*CSR) CreateOrRefresh

func (c *CSR) CreateOrRefresh(ctx context.Context) error

CreateOrRefresh creates the CertificateSigningRequest if it does not exist. If it does exist, it refreshes internally stored CSR object.

func (*CSR) CreatedAt

func (f *CSR) CreatedAt() time.Time

CreatedAt reads and returns the creation timestamp of the CertificateRequest from v1 or v1beta1.

func (*CSR) Delete

func (c *CSR) Delete(ctx context.Context) error

func (CSR) Groups

func (f CSR) Groups() []string

func (*CSR) Name

func (f *CSR) Name() string

Name returns the name of the CertificateRequest.

func (*CSR) ParsedCertificateRequest

func (f *CSR) ParsedCertificateRequest() *x509.CertificateRequest

ParsedCertificateRequest returns the CertificateRequest parsed from v1 or v1beta1.

func (*CSR) RequestingUser

func (f *CSR) RequestingUser() string

RequestingUser reads and returns the user that requested the CertificateRequest from v1 or v1beta1.

func (*CSR) SignerName

func (f *CSR) SignerName() string

SignerName reads and returns the signer name from v1 or v1beta1.

func (*CSR) Usages

func (f *CSR) Usages() []string

Usages reads and returns the usages from v1 or v1beta1.

Jump to

Keyboard shortcuts

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