Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CmdWebhook = &cobra.Command{ Use: "storageClass-webhook", Args: cobra.MaximumNArgs(0), Run: main, }
CmdWebhook is user by Cobra
Functions ¶
This section is empty.
Types ¶
type Admitter ¶ added in v0.2.4
type Admitter struct {
// contains filtered or unexported fields
}
func NewAdmitter ¶ added in v0.2.4
func NewAdmitterWithClient ¶ added in v0.2.4
func (*Admitter) AdmitPVC ¶ added in v0.2.4
func (a *Admitter) AdmitPVC(ar admissionv1.AdmissionReview) *admissionv1.AdmissionResponse
type CertWatcher ¶
CertWatcher watches certificate and key files for changes. When either file changes, it reads and parses both and calls an optional callback with the new certificate.
func NewCertWatcher ¶
func NewCertWatcher(certPath, keyPath string) (*CertWatcher, error)
NewCertWatcher returns a new CertWatcher watching the given certificate and key.
func (*CertWatcher) GetCertificate ¶
func (cw *CertWatcher) GetCertificate(_ *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate fetches the currently loaded certificate, which may be nil.
func (*CertWatcher) ReadCertificate ¶
func (cw *CertWatcher) ReadCertificate() error
ReadCertificate reads the certificate and key files from disk, parses them, and updates the current certificate on the watcher. If a callback is set, it is invoked with the new certificate.
func (*CertWatcher) Start ¶
func (cw *CertWatcher) Start(ctx context.Context) error
Start starts the watch on the certificate and key files.
func (*CertWatcher) Watch ¶
func (cw *CertWatcher) Watch()
Watch reads events from the watcher's channel and reacts to changes.